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?
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
Hello,
Just one idea: Cadtool can do this (and much more) quite affordably:
http://macromonster.com/product/alexander-penkins-cadtool-5/
i think G.Garnov just wants to write its own macro and needs the code (:
You could be right. But from my CorelDRAW experience over the last 25 years, I've learned something... When CorelDRAW users seek to code specialized functions, it's because they suspect no one else has done it already.
Some people like coding macros for the challenge of it, and will spend 10-20 hours trying to accomplish this. Others just quickly want the feature itself, and are happy to support coders who have already created macros like this. Just an option. :-)
Hi there
Looks good!
But I note that cad tool is quite old - version X5 I think. Will this work on CD2021? Does it use VBA to do its functions?
Regards
Jeremiah