Clamp single point of polyline to 3d tile?

I am trying to make a dimensioning primitive to show dimension lines with extension lines. I want two vertical extension lines that go from the 3d tile ground to a given height.

Right now I’m using PolygonCollection to add the extension and dimension lines based on a set of original points. I compute the top points of the extension lines by just adding a fixed height to the original points. The problem is that when the original points don’t line on the 3d tile the extension lines float above the surface.

Any way to clamp just one of the points in a line to the 3d tile surface? The set of 3d tiles may be changed independent of this primitive so it is hard to know exactly what is will be underneath it.

The left extension line appears floating over the polyline that is clamped to the 3d tile.

1 Like

So it looks like there is no way to clamp just a single point using the same shader technique as other ground primitives.

The solution I used was to add a function to my primitive that would manually update the clamping of the needed points with with Scene.clampToHeightMostDetailed. This required knowing when the 3d tiles loaded in the view had changed and calling my new method to re-clamp after the change…

1 Like


Thank you for providing a follow-up to your previous post. I am glad to see that you were able to find a workaround and share it with the community!