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

Large polygons do not triangulate #620

Closed
pjcozzi opened this issue Apr 5, 2013 · 2 comments
Closed

Large polygons do not triangulate #620

pjcozzi opened this issue Apr 5, 2013 · 2 comments

Comments

@pjcozzi
Copy link
Contributor

pjcozzi commented Apr 5, 2013

From the forum:

When I draw polygons with large distance between points, Cesium throws this error:
"Uncaught DeveloperError: At least three positions are required."
or 
"Uncaught TypeError: Cannot call method 'subtract' of undefined."

My code:

    var lonLatToCartesian = function(x, y, z) {
        return ellipsoid.cartographicToCartesian(Cesium.Cartographic.fromDegrees(x, y, z));
    };

    var positions = [lonLatToCartesian(-44, -5,0), lonLatToCartesian(-100,-1,0), lonLatToCartesian(70,0,0),lonLatToCartesian(-44, -5,0)];
    var polygon = new Cesium.Polygon();
    polygon.setPositions(positions);
    primitives.add(polygon);

if I change the point (70,0,0) to (60,0,0), it works.

https://groups.google.com/forum/?fromgroups=#!topic/cesium-dev/xRqn3PQRrvQ

This is most likely because polygon triangulation happens on a tangent plane. At the least, we should try for a better error message.

@mramato
Copy link
Contributor

mramato commented Sep 16, 2013

As of the above pull, this no longer crashes, but is still incorrect. See that pull for details.

@pjcozzi
Copy link
Contributor Author

pjcozzi commented Jun 30, 2015

Duplicate with #2788

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

No branches or pull requests

3 participants