1

I have java general path with random points. I want to crop one side of it and get straight line. crop general path

How to make it?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
karasiov
  • 163
  • 1
  • 8

1 Answers1

5
  1. Create an Area based on the 1st GeneralPath based on this constructor. I'll call it mainArea.
  2. Create a Rectangle2D based on the line, covering the area to the left of it as well. I'll call it lineArea.
  3. Call Area.subtract(Area) using mainArea.subtract(lineArea);

An example can be seen in this answer.

Community
  • 1
  • 1
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433