Search in sources :

Example 1 with ArdorVector3PolygonPoint

use of org.poly2tri.triangulation.point.ardor3d.ArdorVector3PolygonPoint in project energy3d by concord-consortium.

the class CustomRoof method applySteinerPoint.

@Override
protected Polygon applySteinerPoint(final Polygon polygon) {
    final ArrayList<Vector3> steinerPoints = new ArrayList<Vector3>(points.size());
    for (int i = 1; i < points.size(); i++) {
        final Vector3 p = getAbsPoint(i);
        boolean found = false;
        for (final Vector3 existingP : steinerPoints) {
            if (Util.isEqual(p, existingP)) {
                found = true;
                break;
            }
        }
        if (!found) {
            steinerPoints.add(p);
            polygon.addSteinerPoint(new ArdorVector3PolygonPoint(p));
        }
    }
    return polygon;
}
Also used : ArdorVector3PolygonPoint(org.poly2tri.triangulation.point.ardor3d.ArdorVector3PolygonPoint) ArrayList(java.util.ArrayList) ReadOnlyVector3(com.ardor3d.math.type.ReadOnlyVector3) Vector3(com.ardor3d.math.Vector3) ArdorVector3PolygonPoint(org.poly2tri.triangulation.point.ardor3d.ArdorVector3PolygonPoint)

Example 2 with ArdorVector3PolygonPoint

use of org.poly2tri.triangulation.point.ardor3d.ArdorVector3PolygonPoint in project energy3d by concord-consortium.

the class HipRoof method applySteinerPoint.

@Override
protected Polygon applySteinerPoint(final Polygon polygon) {
    final TriangulationPoint roofUpperPoint1 = new ArdorVector3PolygonPoint(getAbsPoint(1));
    final TriangulationPoint roofUpperPoint2 = new ArdorVector3PolygonPoint(getAbsPoint(2));
    polygon.addSteinerPoint(roofUpperPoint1);
    if (!roofUpperPoint2.equals(roofUpperPoint1)) {
        polygon.addSteinerPoint(roofUpperPoint2);
    }
    return polygon;
}
Also used : ArdorVector3PolygonPoint(org.poly2tri.triangulation.point.ardor3d.ArdorVector3PolygonPoint) TriangulationPoint(org.poly2tri.triangulation.TriangulationPoint)

Aggregations

ArdorVector3PolygonPoint (org.poly2tri.triangulation.point.ardor3d.ArdorVector3PolygonPoint)2 Vector3 (com.ardor3d.math.Vector3)1 ReadOnlyVector3 (com.ardor3d.math.type.ReadOnlyVector3)1 ArrayList (java.util.ArrayList)1 TriangulationPoint (org.poly2tri.triangulation.TriangulationPoint)1