Package org.poly2tri.geometry.polygon

Examples of org.poly2tri.geometry.polygon.Polygon


      Collection<LineSegmentXZ> segments,
      Collection<VectorXZ> points) throws TriangulationException {
   
    /* prepare data for triangulation */
   
    Polygon triangulationPolygon = toPolygon(outerPolygon);
   
    for (SimplePolygonXZ hole : holes) {
      triangulationPolygon.addHole(toPolygon(hole));
    }
   
    //TODO collect points and constraints from segments
   
    for (VectorXZ p : points) {
      triangulationPolygon.addSteinerPoint(toTPoint(p));
    }
   
    try {
     
      /* run triangulation */
     
      Poly2Tri.triangulate(triangulationPolygon);
     
      /* convert the result to the desired format */
     
      List<DelaunayTriangle> triangles = triangulationPolygon.getTriangles();
     
      List<TriangleXZ> result = new ArrayList<TriangleXZ>(triangles.size());
     
      for (DelaunayTriangle triangle : triangles) {
        result.add(toTriangleXZ(triangle));
View Full Code Here


   
    for (VectorXZ v : polygon.getVertices()) {
      points.add(new PolygonPoint(v.x, v.z));
    }
   
    return new Polygon(points);
   
  }
View Full Code Here

TOP

Related Classes of org.poly2tri.geometry.polygon.Polygon

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.