0

I have a bunch of (2D) polygons where I need to compute hatch (fill) lines for (distance between lines and angle is variable). Some of the polygons can be embedded in other ones forming some kind of "holes" which then should be excluded from being hatched.

My question: is there a package/library available in CGAL which supports such a calculation?

A plain OpenGL effect with textures or something like this would not do the trick in my case, I really need a bunch of vector lines as result of this operation because it not only has to be displayed at a screen.

Thanks!

Elmi
  • 5,899
  • 15
  • 72
  • 143

2 Answers2

0

For sure, you can achieve what you want using the Arrangement package. But there are many ways to do it.

Maybe the simplest would be to first crop your hatch lines to segments and then compute an arrangement of segments using the hatch lines and polygon segments. Then you can filter edges you are not interested in. It might be a good idea to use arrangement with history to get back to the original curves.

sloriot
  • 6,070
  • 18
  • 27
0

Clipping each hatch line against the polygons (and their holes) and merging the results would result in the desired vector representation. CGAL has a package for such boolean operations on polygons: 2D Regularized Boolean Set-Operations (see Boolean Set-Operations on Linear Polygons in the documention).

user3146587
  • 4,250
  • 1
  • 16
  • 25
  • this sounds good but a single hatch line is not a polygon...so does this package also work with these lines which are no closed polygons? – Elmi Jan 23 '17 at 07:15