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

Verticle Polygons #5907

Closed
bmckilligan opened this issue Oct 16, 2017 · 6 comments
Closed

Verticle Polygons #5907

bmckilligan opened this issue Oct 16, 2017 · 6 comments

Comments

@bmckilligan
Copy link

In the past I noticed there was some issues with vertically oriented polygons and
have tried workarounds by regenerating the polygon with many narrow wall objects or a single rectangular wall with a material consisting of a transparent canvas element with the polygon drawn on the canvas..

trying the vertically oriented polygons again with a more recent version of cesium I noticed the issue with the geometries primarily crops up with polygons with a north south bearing.

the two kml files included in the zip file illustrate the issue in cesium and load without issue in GEarth, and are provided for ease of demonstration. the initial rendering was attempted using both polygon primitives and entities directly

qtBar_0 has a north south bearing bearing and generates a malformed polygon, qtBar_45 is rotated 45 degrees and renders without issue. As a work around I have found that preventing the plots from having a bearing of 0 or 180 and setting it to 0.5 degrees or 179.5 often works.

NorthSouth Polygon qtBar_0
image

rotated45 degrees qtBar_45
image

polygons.zip

@ggetz
Copy link
Contributor

ggetz commented Oct 17, 2017

Thanks for the report and the details @bmckilligan. Would you mind also writing up a quick Sandcastle example for when this is working and when it is prevented? It'll hep us track this down quicker. Thanks!

@hpinkos
Copy link
Contributor

hpinkos commented Oct 17, 2017

Closing as a duplicate: #3349

@bmckilligan the polygon primitive is designed to conform to the curvature of the ellipsoid, so it doesn't work for arbitrary polygons in space.

I played around a little bit with a 'space polygon' type on this branch: https://github.com/AnalyticalGraphicsInc/cesium/tree/space-polygon
It only works with coplanar points.

@bmckilligan
Copy link
Author

As a possible workaround for my use case I have also been looking at using a PolylineVolumeGraphic that has only two positions defined that are less than a meter apart

Would it be possible to have and additional property added to PolylineVolumeGraphics defining an anchor point (Cartesian2) with respect to the the shape that the positions(Cartesian3) are mapped to for the extrusion .

Currently a horizontal midpoint position is being calculated from the 'shapes' array. and things map along this midpoint and the bottom of the shape

Another use case scenario would be a drone or helicopter flight path, and a triangular camera view angle being displayed

https://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Hello%20World.html&label=Showcases&gist=c30a14da47e2ba82a9fc599c0a9d00ab

image

in the example the shape is defined as
[ Cartesian2(0, 0), Cartesian2(0, -100), Cartesian2(100, -100) ];

the red would be what I would like to do,
however it requires a two different paths to be defined and the polylinevolume path is dependent on the shape

in the example the orange entity has the polylineVolume extruding the shape along the effective Cartesian2(50,-100) ,

it would be nice to have the option to specify that the extruded shape intersects the positions along Cartesian2(0,0)

if the the same shape was defined as
[ Cartesian2(0, 100), Cartesian2(0, 0), Cartesian2(100, 0)]
the desired intersection would be along Cartesian2(0, 100)

@hpinkos
Copy link
Contributor

hpinkos commented Oct 18, 2017

That's a good idea @bmckilligan. I have a number of improvements I want to make to the polyline volume type, but it's unlikely that I'll have time to work on it anytime soon. I'm happy to review a pull request if you have time to take a look at it!

Do you think a wall geometry would work for what you're trying to do? https://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Wall.html&label=Geometries

@bmckilligan
Copy link
Author

I have been using wall geometries, splitting the complex polygons into a number of thin walls, however there is an issue with walls when things get close to the ground and the ellipsoid elevations are negative

#4274

Another approach I have taken is to draw the polygons onto canvas elements and applying the canvas element to a rectangular wall as a material.
However, depending on the data , the shape of the polygon, and distance things are viewed at, the edges can appear soft and washed out and often disconnected from polyline added to help sharpen the edges

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

No branches or pull requests

3 participants