growing a polyline
Moderators: SDS, support, admin
growing a polyline
Hi,
Can anyone assist with the maths?
I have a polyline (usually closed) that needs to be grown by a specified distance perpendicular to each edge line.
Think of a house plan showing the outside walls. I need to grow this polyline by adding 600mm all round for the roof eaves to get the roof footprint.
My polyline is stored as a set of vertices and is drawn onto the canvas of an underlying sgimage. I need to calculate the new set of vertices.
thanks,
Steve
Can anyone assist with the maths?
I have a polyline (usually closed) that needs to be grown by a specified distance perpendicular to each edge line.
Think of a house plan showing the outside walls. I need to grow this polyline by adding 600mm all round for the roof eaves to get the roof footprint.
My polyline is stored as a set of vertices and is drawn onto the canvas of an underlying sgimage. I need to calculate the new set of vertices.
thanks,
Steve
Re: growing a polyline
Hello Steve,
We suppose this task could be solved by the following way:
We suppose this task could be solved by the following way:
- get every section of a poliline;
- draw a line parallel to the section;
- repeat steps 1 and 2 for every section of the polyline;
- find intesections between every pare of neighbouring parallel lines;
- draw new polyline on a list of intersection points.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: growing a polyline
Hi Sergey,
Thanks for the quick response. I figured that would be the way to do it but was hoping someone else already had code to do it or parts of it.
e.g. finding parallel lines, intersection points, determining which side (outside the area) to place parallel line etc.
My maths is a bit rusty here.
I know AutoCAD does it with the offset command etc and wondered if anyone else had done anything similar using your components, or even another CAD package where source is available.
cheers,
Steve
Thanks for the quick response. I figured that would be the way to do it but was hoping someone else already had code to do it or parts of it.
e.g. finding parallel lines, intersection points, determining which side (outside the area) to place parallel line etc.
My maths is a bit rusty here.
I know AutoCAD does it with the offset command etc and wondered if anyone else had done anything similar using your components, or even another CAD package where source is available.
cheers,
Steve
Re: growing a polyline
Hello Steve,
We have similar function in ABViewer v.7 (Web page is http://www.cadsofttools.com/en/products/abviewer.html): "Tools -> Modify -> Scale" menu item. If you'd like to have our code example, it sounds like a kind of commercial offer. So, if you are interested please contact us to info@cadsofttools.com accordingly to this question.
Sergey.
We have similar function in ABViewer v.7 (Web page is http://www.cadsofttools.com/en/products/abviewer.html): "Tools -> Modify -> Scale" menu item. If you'd like to have our code example, it sounds like a kind of commercial offer. So, if you are interested please contact us to info@cadsofttools.com accordingly to this question.
Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support