Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue rendering outlines for polygons with many positions #7599

Closed
ulrichson opened this issue Feb 26, 2019 · 5 comments · Fixed by #7600
Closed

Issue rendering outlines for polygons with many positions #7599

ulrichson opened this issue Feb 26, 2019 · 5 comments · Fixed by #7600

Comments

@ulrichson
Copy link

As you can see in the screenshot there seems to be a problem rendering outlines for polygons with many positions (34000 positions in the hierarchy with extrudedHeight in this case):

2019-02-26_13-08

Green: 32000 positions, rendering ok w/ outlines
Yellow: 34000 positions, rendering ok w/o outline
Red: 34000 positions, rendering fails w/ outlines

Yellow and red have the same geometry.

Solid shapes seem to work but it looks like Cesium doesn't connect the outlines right - at some point it seems they're getting closed although they don't enclose the complete geometry.

The Sandcastle example below uses the Entity API but the issue also exists with the Primitive API (using PolygonOutlineGeometry).

Sandcastle example:

https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/index.html#c=zVZRU+M2EP4ral7ObnxyAjnmJgRahgvHTenBUFpKCQ/CVmINiuSRZJJww3/vyrYcxYEZ+tCb04ujXe23q+/bdTwtRGKYFGhGzYXUzP4+4lLMTilJmZgFE4FgScVmTETVJqtc9S5l2hCR0IkI0bfK9EgUUtL8gw7QMdWsmOPficmwkZcQSIQO+h97uIe6DincX8flUsPhdeSVgoCpVHONKdHmq1Qm+zO/kidsSdMTReY0qIrzQQxRcJ+/AaW3Zb0Bq6t5f6NeYmh6IZmw2eub2LUcOrxobVw5441nfBqiXrV7rpF9VLwEXFfZz6ikJJE6sEyF6H1TXu3STFSul6BW21DN+W2oJotPhuMVTii23JAK9gM8VXJeks+JbYpgfU2/ksrqA0+ZIPw10HnBDcv5ykOrBPdYbFXmeQRdtACDcLMARU2hhH/wmCgDv4jY9XJ6Nd72d+6iVzy7r3oGd+u8zxMxEVM3R4miQM6F5KsZkKZpYqTSkb1lOVsbM+KMGoi6vfM55Cw/Lvuw17Ja3VXhGhdYQoF1sfIoPEaoTgmbbjf0+7jJhvNCZx4bdr02/i4oQgGDdtrd64UoRs21ypJ+Qf0PPVhoiPoD+yNcYzth7PK4rO7X7b7oZVMUNAwcHKA+IPoX8RA8hnwPmH+yT8/1XA9m9Whx0Wxve3etVmpcTmlL9yOjC6ogi9dof5W24F1Sbo+lMIQJqt5ZvImIY3T+2xDt7lie1rq/P4TNikOroIVUDxoRjegyB3ppihZIFoYDiK6y2hOgSd1bkL0qA1NhAI5qTNI0+OYuWB0a+sRljCqikgxeXl7hNd6pcwabLVyWHG2PU/mC+ERnilIdfIzQYC8MI2jj0JuZnCrXVaeUzTIzRFPCNfWOZLW9zLI20yW0eUpTFzbYdM+hQMUIHzZ1SS4V/nw5Hn/FC2ayI55nJOjhD345NZ3DcoS27SVGC/H69MvVuGmd500xB/9FzFi+LOc1VAuO88r33VQdvEHV/s6PIevN+Ozs/PoNupZVtNUq9To5+nL2omJ1LMpALKZ14dS5V/KBiu89a29SZe/HUOVy/On/H7Wa9icJHyMyaIkQ7neizkibFaeHVeCvbJ7DFyIqFA8wjg2d5/D5QnV8XyQP1OBEa4s7il3QKGWPiKUHk07rvT3poIQTrcEzLTj/gz3RSedwFMP5jTAuyz/K80eqOFnZI1n/8KwyYoxHMWy3o4yU/J4oD/Ff

Browser: Chrome 72 & Firefox 65

Operating System: Ubuntu 18.04.2 LTS

@hpinkos
Copy link
Contributor

hpinkos commented Feb 26, 2019

Thanks for including the Sandcastle example @ulrichson! It looks like something is going weird with computing the outline when the polygon is extruded. The outline looks correct if you remove the extrudedHeight option.
I'm not sure how soon we'll be able to look into this, but I'd be happy to review a pull request if you're able to find a solution. My guess is something is going weird with the indices here: https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Core/PolygonOutlineGeometry.js#L199

@jbo023
Copy link
Contributor

jbo023 commented Feb 26, 2019

The problem is in the following line

https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Core/PolygonOutlineGeometry.js#L200

If the line

        var indices = IndexDatatype.createTypedArray(length, indicesSize);

is changed to

        var indices = IndexDatatype.createTypedArray(length + cornersLength, indicesSize);

The Outline geometry is correct.

The function IndexDatatype.createTypedArray returns a UINT16Array which is not enough for the index range of 0 to 68000 (points + cornerPoints)

I could create a Pullrequest tomorrow

@hpinkos
Copy link
Contributor

hpinkos commented Feb 27, 2019

Awesome @jbo023, thank you! Yes, please open a pull request when you can =)

@hpinkos
Copy link
Contributor

hpinkos commented Feb 27, 2019

Thanks again @ulrichson, this has been fixed and will be included in the 1.55 release available March 1st

@ulrichson
Copy link
Author

Thanks @hpinkos @jbo023 for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants