cesium icon indicating copy to clipboard operation
cesium copied to clipboard

Polylines slice through 3D Tiles rather than draping over them

Open lilleyse opened this issue 7 years ago • 9 comments

When clamping a polyline to 3D Tiles it slices through the mesh rather than draping over the topmost surface. This is a limitation of the way ground polylines are rendered.

image

lilleyse avatar Jan 02 '19 23:01 lilleyse

This also applies to ground primitives on 3D Tiles but might actually be the desired look:

ground

lilleyse avatar Jan 02 '19 23:01 lilleyse

The use case here is being able to draw lines on vertical surfaces. I just got this request over email. It works fine on top of the building:

image

But if you want to draw a line that goes over the 2nd floor windows it colors the entire vertical surface:

image

OmarShehata avatar Jan 29 '20 16:01 OmarShehata

@OmarShehata are you trying to use a GroundPrimitive? You would need to use a non-clamped polyline to draw on a vertical surface.

hpinkos avatar Jan 29 '20 17:01 hpinkos

Thanks @hpinkos . You're right, I was setting clampToGround: true there. This should be sufficient for this use case, you'd just have to be careful not to draw the line exactly on the surface so it doesn't clip through it, or perhaps use a depthFailMaterial. So what isn't supported is specifically clamping lines to vertical surfaces.

Sandcastle I used for testing for future reference.

OmarShehata avatar Jan 29 '20 17:01 OmarShehata

@hpinkos I came across this issue rendering OSM building footprints along with the OSM Buildings 3D tile layer. Our footprints are rendered as clamped polylines, and it appears clamped lines that parallel the edge of a 3D tile influence how the surface of the 3D tile is rendered.

Sandcastle Demo

In this demo, I have added a clamped polyline that outlines a building from the OSM Buildings 3D tile layer. The end result is a red building, but I would expect a red outline around the base of the building.

Screen Shot 2020-10-12 at 11 32 30 AM

Is this expected behavior?

schmidtk avatar Oct 12 '20 17:10 schmidtk

@schmidtk this does appear to be the same bug. Easiest workaround would be to set clampToGround: false and sample the terrain height at each point along the polyline to place the outline on the ground "manually" that way. Feel free to post on the community forum (https://community.cesium.com/) if you're having trouble with this so we can move the discussion about workarounds to this specific use case there.

OmarShehata avatar Oct 12 '20 18:10 OmarShehata

What should I do if I encounter a rock protruding horizontally when drawing a polyline on 3dtiles, here I set clampToGround to true 1626860576418013552

In fact, I just want to cross the line formed by these green balls and stick to the rock

jiunuan avatar Jul 27 '21 07:07 jiunuan

Hello, is there any follow-up to this question? Is there any way to fix this

Lafeu-p avatar Mar 22 '24 08:03 Lafeu-p

Hi @Lafeu-p, there hasn't been any activity on this item recently. Likely we would need to change our overall approach to draping polylines.

If you'd like to add more information about your use case, that may help us prioritize. If you are interesting in contributing, please let us know and we'd be happy to discuss implementation or review a PR. Thanks!

ggetz avatar Mar 22 '24 13:03 ggetz