CGAL / cgal

The public CGAL repository, see the README below
https://github.com/CGAL/cgal#readme
Other
4.98k stars 1.39k forks source link

Feature request: Parallel offset for 2d polylines/curves #5027

Open warrenbocphet opened 4 years ago

warrenbocphet commented 4 years ago

Hi,

This is not a bug. Recently I have a need to generate parallel curves for one non self-intersecting 2d curve. I thought this would be a trivial thing to implement until I found myself failed miserably. I then came across Shapely's parallel offset (https://shapely.readthedocs.io/en/stable/manual.html#object.parallel_offset) which I have mix results with (it works well 99.9% of the time, but it can behave unexpectedly).

So I guess my question is does CGAL have this capability hidden somewhere in the library? I thought this is a widely used feature, especially in CAD modeling software.

lrineau commented 4 years ago

For polygons, we have 2D Straight Skeleton and Polygon Offsetting. Polygon offsetting is what you are looking for, except that it seems you would like that feature for unclosed curves.

warrenbocphet commented 4 years ago

Yeah, unfortunately that is the case (unclosed curves).

WindingWinter commented 2 years ago

@vitsensei , what about using something like CavalierContours? Does it help?