Skip to content

Large polygons do not triangulate #620

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

3 participants

@pjcozzi
Analytical Graphics, Inc. member
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
Analytical Graphics, Inc. member
mramato commented Sep 16, 2013

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

@pjcozzi pjcozzi referenced this issue Oct 6, 2014
Open

KML Graphics Roadmap #2179

14 of 30 tasks complete
@bagnell bagnell was assigned by pjcozzi Oct 6, 2014
@pjcozzi
Analytical Graphics, Inc. member
pjcozzi commented Jun 30, 2015

Duplicate with #2788

@pjcozzi pjcozzi closed this Jun 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.