## Draw Polyline - Extra options to create arcs

This forum is for 'Work-in-Progress' QCAD user developed script Add Ons and Plug-ins.

Moderators: andrew, Husky, J-J

riverbuoy
Senior Member
Posts: 109
Joined: Thu Oct 03, 2013 5:37 pm

### Draw Polyline - Extra options to create arcs

Hi

As you will be aware the polyline command only creates tangential arcs. This means you need to create other types of arcs manually and then convert them to polylines. I have added the ability to create different types of arcs while drawing a polyline.
ArcOptions.png (12.4 KiB) Viewed 8211 times
As you can see there are 5 options, plus two direction buttons (top right).

The options work in a similar way to the way in which you can draw arcs. The main difference, of course, is that the current vertex is the first point of the arc.

Tangential
This option draws arcs as it does now. You'll notice the two direction buttons are greyed out, as they do not affect the arcs.

Center Pt
This option prompts you to enter a center point for the arc. The radius entry box is greyed out because the radius is the distance from the current vertex to the center point. The two direction buttons are enabled, so you can decide which way to draw the arcs. Select the endpoint of the arc to finish the option.

Second Pt
This option draws an arc through three points so this prompts you for the second point of the three. Then you select the third point to finish the option. The radius and direction buttons are greyed out, because there is only one way to draw an arc through the three points, in the order they are entered.

This option prompts you for an end point of the arc. The radius of the arc is the value in the radius entry box. If the distance between the current vertex and the end point is less than twice the radius there are two possible center points, and therefore two possible arcs for each dirction of the arc. You are prompted to select the arc you wish to use. Use the direction buttons to get the arc you want. When the arc you want is displayed, click the mouse to finish the option.

End Pt, Sweep
This option allows you to select any end point and uses the value in the sweep entry box. You can also change the direction of the arc.

(Note: The value in the sweep entry box can be used with all these options, so you can get an exact angle.)

I have attached the file 'DrawPolyline.zip', which contains a directory 'DrawPolyline' which should replace the 'DrawPolyline' directory in the 'scripts/Draw/Polyline' directory.

Try it out, and let me know what you think.

Thanks

riverbuoy
Attachments
DrawPolyline.zip

Clive
Moderator / Drawing Help
Posts: 1327
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

### Re: Draw Polyline - Extra options to create arcs

riverbuoy wrote:Try it out, and let me know what you think.
Hey riverbuoy this is great, just love the 'sweep' options!

Truly a much needed addition and in my opinion should be added to the next release of QCAD

Husky
Moderator/Drawing Help/Testing
Posts: 2490
Joined: Wed May 11, 2011 9:25 am
Location: USA

### Re: Draw Polyline - Extra options to create arcs

riverbuoy wrote:Try it out, and let me know what you think.
Hello riverbuoy,

very nice - thank you very much for this indeed useful addition.

I tested all possibility's and I love how this tool works. I will use it a lot!

But on the other hand I have to say that I'm confused by the labeling of the options.
In my opinion a tool/option label should try to give the user a close idea what will happens when (s)he will use the tool.

This works perfect for me with the option labeling for: "Tangential", "Center Pt", and "End Pt, Sweep". Yep, thats absolutely self-explaining!

But I'm confused by this name: "Second Pt" and "End Pt, Radius".
Why is it called: "Second Pt"?
It's an Arc created with "3 Points" and that is the same what you wrote in your description. So, that means to me it should be called "3 Points", or not?

"End Pt, Radius" same here! Is that an End point? No, it's an extension from the start of the arc across the center - but that's not a point on or even the end of the arc ...

However - thats just how the kid is named - the tool itself works great!!! Thanks again!
Work smart, not hard: QCad Pro

Clive
Moderator / Drawing Help
Posts: 1327
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

### Re: Draw Polyline - Extra options to create arcs

Husky wrote:Why is it called: "Second Pt"?
It's an Arc created with "3 Points" and that is the same what you wrote in your description. So, that means to me it should be called "3 Points", or not?
Don't forget your creating a Polyline to include an arc , selecting to create an arc makes the tool 'dual' purpose at this stage

1.Select Polyline tool, you are first prompted to select the first vertex of the Polyline which is also the first point of the arc !

2.Now tick the arc box with 'Second Point' (this is of course the second point of the arc), you are now prompted to place the point (second) on the arc.

3.Once the second point of the arc is placed you are now prompted for the next Vertex of the Polyline ... but also this acts as the last point of the arc. Once this next vertex is placed you will notice that the create arc option is un-ticked and we are back again to our standard draw polyline state.

So altogether 3 points of an arc are placed.

I guess it seems confusing at first but it is also logical too.

riverbuoy
Senior Member
Posts: 109
Joined: Thu Oct 03, 2013 5:37 pm

### Re: Draw Polyline - Extra options to create arcs

Hi
Husky wrote:Why is it called: "Second Pt"?
Thanks Clive for your clear explanation.

Husky wrote:"End Pt, Radius" same here! Is that an End point? No, it's an extension from the start of the arc across the center - but that's not a point on or even the end of the arc ...
The following figure helps explain End Pt, Radius.
EndPointRadius.png (7.87 KiB) Viewed 8154 times
In this figure I am drawing a polyline from left to right. In option 'End pt, Radius', if the distance between the start point of the arc, and the endpoint of the arc, is less than two times the radius. (in the diagram above the distance = 10, and the radius = 8 ) then there are two possible centre points. You can find the two possible centre points by drawing a circle at the start point and end point. The two intersections are the possible centre points. (I have labelled them 'Centre 1' and 'Centre 2'.) This means there are two possible arcs, a small one with centre point at 'Centre 1', and a larger arc with centre point at 'Centre 2'. (I have drawn these two possible arcs in red.) As you move the mouse pointer, if it is closer to 'Centre 1', the small arc is shown. If it is closer to 'Centre 2', the larger arc will be shown. When the arc you want is shown, select it by clicking the left mouse button. (You do not need to click on the arc itself.) To show the two possible arcs above the line, change the direction.
If the distance between the start point and end point is equal to, or greater than two times the radius, then only one possible arc (a semi-circle) is shown. Again, change the direction if you want the arc above the line. When you select the arc you want, the 'next vertex' is placed at the end of the arc segment, irrespective of where you chose the endpoint.

Hope this explains what is happening.

riverbuoy

Clive
Moderator / Drawing Help
Posts: 1327
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

### Re: Draw Polyline - Extra options to create arcs

Hi riverbuoy

Okay now I understand the relationship between the start and end points of the Arc and the radius better thanks, however in order to produce your example the entry in the Sweep field needs to be 0 degrees !

Maybe the option to tick or not tick sweep could be added ? If the sweep is un-ticked, i.e not needed then the angle of the arc could be set to 0 or 360 ?