question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue rendering outlines for polygons with many positions

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jbo023commented, 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

0reactions
ulrichsoncommented, Feb 27, 2019

Thanks @hpinkos @jbo023 for the quick fix!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue rendering outlines for polygons with many positions #7599
Solid shapes seem to work but it looks like Cesium doesn't connect the outlines right - at some point it seems they're getting...
Read more >
Artifacts when rendering TopoJSON geometries on Cesium
EDIT: I have displayed the outline of the polygon and it seems that the artifacts do not have an outline, which leeds me...
Read more >
How do I render thick 2D lines as polygons? - Stack Overflow
The problem is handling the corner joins, miters, caps etc. The resulting polygon needs to be "perfect" in the sense of no overdraw,...
Read more >
Creating Building Outline Polygons - Esri Community
I am trying to develop an efficient method of creating polygons for Building Outlines and am looking for feedback on the processes I...
Read more >
US8456474B2 - Method for rendering outline of polygon and ...
A database compiler sequentially selects element points constituting an outline of a polygon corresponding to polygon data obtained from a map database.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found