/** Constructor for case (1). * Generate a simple circle cutoff plane. *@param point is the center point. *@param upperPoint is a point that must be on the circle plane. *@param lowerPoint is another point that must be on the circle plane. */ public SegmentEndpoint(final GeoPoint point, final Plane normalPlane, final GeoPoint upperPoint, final GeoPoint lowerPoint) { this.point = point; // Construct a sided plane that goes through the two points and whose normal is in the normalPlane. this.circlePlane = SidedPlane.constructNormalizedPerpendicularSidedPlane(point, normalPlane, upperPoint, lowerPoint); this.cutoffPlanes = NO_MEMBERSHIP; this.notablePoints = circlePoints; }
/** Constructor for case (2). * Generate an endpoint, given a single cutoff plane plus upper and lower edge points. *@param point is the center point. *@param cutoffPlane is the plane from the adjoining path segment marking the boundary between this endpoint and that segment. *@param topEdgePoint is a point on the cutoffPlane that should be also on the circle plane. *@param bottomEdgePoint is another point on the cutoffPlane that should be also on the circle plane. */ public SegmentEndpoint(final GeoPoint point, final SidedPlane cutoffPlane, final GeoPoint topEdgePoint, final GeoPoint bottomEdgePoint) { this.point = point; this.cutoffPlanes = new Membership[]{new SidedPlane(cutoffPlane)}; this.notablePoints = new GeoPoint[]{topEdgePoint, bottomEdgePoint}; // To construct the plane, we now just need D, which is simply the negative of the evaluation of the circle normal vector at one of the points. this.circlePlane = SidedPlane.constructNormalizedPerpendicularSidedPlane(point, cutoffPlane, topEdgePoint, bottomEdgePoint); }
/** Constructor for case (2.5). * Generate an endpoint, given two cutoff planes plus upper and lower edge points. *@param point is the center. *@param cutoffPlane1 is one adjoining path segment cutoff plane. *@param cutoffPlane2 is another adjoining path segment cutoff plane. *@param topEdgePoint is a point on the cutoffPlane that should be also on the circle plane. *@param bottomEdgePoint is another point on the cutoffPlane that should be also on the circle plane. */ public SegmentEndpoint(final GeoPoint point, final SidedPlane cutoffPlane1, final SidedPlane cutoffPlane2, final GeoPoint topEdgePoint, final GeoPoint bottomEdgePoint) { this.point = point; this.cutoffPlanes = new Membership[]{new SidedPlane(cutoffPlane1), new SidedPlane(cutoffPlane2)}; this.notablePoints = new GeoPoint[]{topEdgePoint, bottomEdgePoint}; // To construct the plane, we now just need D, which is simply the negative of the evaluation of the circle normal vector at one of the points. this.circlePlane = SidedPlane.constructNormalizedPerpendicularSidedPlane(point, cutoffPlane1, topEdgePoint, bottomEdgePoint); }
this.circlePlane = SidedPlane.constructNormalizedPerpendicularSidedPlane(center, normalPlane, upperPoint, lowerPoint); if (circlePlane == null) throw new IllegalArgumentException("Couldn't construct circle plane, probably too small? Cutoff angle = "+cutoffAngle+"; upperPoint = "+upperPoint+"; lowerPoint = "+lowerPoint);