Examples of TriangleXZ


Examples of org.osm2world.core.math.TriangleXZ

   
  }

  private static final TriangleXZ toTriangleXZ(DelaunayTriangle triangle) {
   
    return new TriangleXZ(
        toVectorXZ(triangle.points[0]),
        toVectorXZ(triangle.points[1]),
        toVectorXZ(triangle.points[2]));
   
  }
View Full Code Here

Examples of org.osm2world.core.math.TriangleXZ

  static final List<TriangleXZ> triangulateSimplePolygon(
      List<VectorXZ> outline) {
   
    if (outline.size() == 3) {
      return Collections.singletonList(
          new TriangleXZ(outline.get(1), outline.get(2), outline.get(3)));
    }
       
    outline.remove(0); //TODO: only while first/last vertex is still duplicated
   
    List<TriangleXZ> triangles = new ArrayList<TriangleXZ>(outline.size() - 2);
View Full Code Here

Examples of org.osm2world.core.math.TriangleXZ

  static boolean isEarTip(int i, List<VectorXZ> outline) {
   
    if (isConvex(i, outline)) {
     
      TriangleXZ triangleAtTip = triangleAtTip(i, outline);
     
      for (VectorXZ vertex : outline) {
        if (vertex != triangleAtTip.v1
            && vertex != triangleAtTip.v2
            && vertex != triangleAtTip.v3
            && triangleAtTip.contains(vertex)) {
          return false;
        }
      }
     
      return true;
View Full Code Here

Examples of org.osm2world.core.math.TriangleXZ

   
  }
   
  static final TriangleXZ triangleAtTip(int i, List<VectorXZ> outline) {
   
    return new TriangleXZ(vertexBefore(outline, i),
        outline.get(i), vertexAfter(outline, i));
   
  }
View Full Code Here

Examples of org.osm2world.core.math.TriangleXZ

    /* calculate the sectors */
   
    List<TriangleXZ> result = new ArrayList<TriangleXZ>();
       
    for (int i = 0; i+1 < centers.size(); i++) {
      result.add(new TriangleXZ(pointXZ,
          centers.get(i),
          centers.get(i+1)));
    }
   
    return result;
View Full Code Here

Examples of org.osm2world.core.math.TriangleXZ

   
    private TriangleXZ triangleXZ = null;
   
    public TriangleXZ asTriangleXZ() {
      if (triangleXZ == null) {
        triangleXZ = new TriangleXZ(p0.xz(), p1.xz(), p2.xz());
      }
      return triangleXZ;
    }
View Full Code Here

Examples of org.osm2world.core.math.TriangleXZ

       
        List<TriangleXYZ> trianglesXYZ =
            new ArrayList<TriangleXYZ>(triangles.size());
       
        for (TriangleXZ triangle : triangles) {
          TriangleXZ tCCW = triangle.makeCounterclockwise();
          trianglesXYZ.add(new TriangleXYZ(
              withRoofEle(tCCW.v1),
              withRoofEle(tCCW.v2),
              withRoofEle(tCCW.v3)));
          //TODO: avoid duplicate objects for points in more than one triangle
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.