Skip to content
This repository

Large polygons do not triangulate #620

pjcozzi opened this Issue · 1 comment

2 participants

Patrick Cozzi Matthew Amato
Patrick Cozzi

From the forum:

When I draw polygons with large distance between points, Cesium throws this error:
"Uncaught DeveloperError: At least three positions are required."
"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();

if I change the point (70,0,0) to (60,0,0), it works.!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.

Matthew Amato

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

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.