Create Parallel SubPath / Segment / Curve

There is Shape.CreateParallelCurves(int count, double distance) method, and ShapeRange.CreateParallelCurves methods.

Those are great methods but there are some inconveniences.

1. You can't create parallel curves for virtual shape located on virtual layer

2. Because this methods works on shapes they trigger all things associated with shapes - logging actions etc. So it's not so fast.

3. You can't create virtual parallel curve for calculation purposes only, they added to document and you must delete them after use, and turn on optimizations to prevent undo logging, drawing etc.

Maybe somebody can share working algorithm for calculating parallel bezier curves mathematically for corel subpaths and segments?

Parents
No Data
Reply
  • I have not seen an algorithm for calculating parallel bezier curves. If you find one I would be interested. 

    My crazy solution for this back before there was the CreateParallelCurves was to add an outline to the curve, then create a perpendicular line at the start and end node of the original curve. This let me find the intersection to the new outline and trim it.

    If you look at the middle image you can see my outline in Red and then the perpendicular lines in green.

    I know, it was a crazy solution, but it worked for what I needed. :-) 

    Happy coding, 

    -Shelby

Children
No Data