/** * Returns a point on the edge of the bezier path which crosses the line * from the center of the bezier path to the specified point. * If no edge crosses the line, the nearest C0 control point is returned. */ public Point2D.Double chop(Point2D.Double p) { return Geom.chop(this, p); }
public Point2D.Double chop(Point2D.Double p) { Shape triangle = getBezierPath(); double grow = AttributeKeys.getPerpendicularHitGrowth(this); if (grow != 0d) { GrowStroke gs = new GrowStroke((float) grow, (float) (AttributeKeys.getStrokeTotalWidth(this) * get(STROKE_MITER_LIMIT)) ); triangle =gs.createStrokedShape(triangle); } return Geom.chop(triangle, p); } /**
public Point2D.Double chop(Point2D.Double p) { if (isClosed()) { double grow = AttributeKeys.getPerpendicularHitGrowth(this); if (grow == 0d) { return path.chop(p); } else { GrowStroke gs = new GrowStroke(grow, AttributeKeys.getStrokeTotalWidth(this) * get(STROKE_MITER_LIMIT)); return Geom.chop(gs.createStrokedShape(path), p); } } else { return path.chop(p); } }