Package org.osm2world.core.math

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


  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

  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

   
  }
   
  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

    /* 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

   
    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

       
        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

Related Classes of org.osm2world.core.math.TriangleXZ

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.