8081828384858687
*/ private Plane3D findBestFitPlane(Polygon poly) { CoordinateSequence seq = poly.getExteriorRing().getCoordinateSequence(); Coordinate basePt = averagePoint(seq); Vector3D normal = averageNormal(seq); return new Plane3D(normal, basePt); }
110111112113114115116117
sum.z += (p1.x - p2.x)*(p1.y + p2.y); } sum.x /= n; sum.y /= n; sum.z /= n; Vector3D norm = Vector3D.create(sum).normalize(); return norm; }