[英]Crop general path in Java 2D
I have java general path with random points. 我有随机点的Java一般路径。 I want to crop one side of it and get straight line.
我想剪裁它的一侧并获得直线。
How to make it? 怎么做?
Area
based on the 1st GeneralPath
based on this constructor . GeneralPath
创建一个Area
。 I'll call it mainArea
. mainArea
。 Rectangle2D
based on the line, covering the area to the left of it as well. Rectangle2D
,并覆盖其左侧的区域。 I'll call it lineArea
. lineArea
。 Area.subtract(Area)
using mainArea.subtract(lineArea);
mainArea.subtract(lineArea);
调用Area.subtract(Area)
mainArea.subtract(lineArea);
An example can be seen in this answer . 在这个答案中可以看到一个例子。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.