Page 1 of 1

Draw Polyline - Extra options to create arcs

Posted: Sat Jan 10, 2015 1:38 am
by riverbuoy
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
ArcOptions.png (12.4 KiB) Viewed 149668 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.

End Pt, Radius
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

Re: Draw Polyline - Extra options to create arcs

Posted: Sat Jan 10, 2015 11:26 pm
by Clive
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

Re: Draw Polyline - Extra options to create arcs

Posted: Mon Jan 12, 2015 9:32 am
by Husky
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. :D :D :D

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

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!!! 8) Thanks again!

Re: Draw Polyline - Extra options to create arcs

Posted: Mon Jan 12, 2015 11:08 am
by Clive
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 :wink:

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.

As Regards the 'End Point, Radius option - I must admit I'm not too sure about this one either!

Re: Draw Polyline - Extra options to create arcs

Posted: Tue Jan 13, 2015 1:13 am
by riverbuoy
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 ... :(
Clive wrote:As Regards the 'End Point, Radius option - I must admit I'm not too sure about this one either!
The following figure helps explain End Pt, Radius.
EndPointRadius.png
EndPointRadius.png (7.87 KiB) Viewed 149611 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

Re: Draw Polyline - Extra options to create arcs

Posted: Tue Jan 13, 2015 12:59 pm
by Clive
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 ?

Re: Draw Polyline - Extra options to create arcs

Posted: Thu Apr 10, 2025 5:10 pm
by cfg
Hi all,
Thank you for this great community.
I've sat all day trying to get this file 'DrawPolyline.zip' copied to the folder without success. I have seen two folders in qcad, one is 'script' and the other, 'script'. Beyond that, I can't find '...../Draw/Polyline'.
Can someone please walk me through how to install this very important add-on. Please pardon my computer naivety.
These are my specs:

Version: 3.32.2.0 (3.32.2)
Internet: QCAD.org
Build Date: Feb 20 2025
Revision: 6616def
Qt Version: 5.13.2
Architecture: x86_64
Compiler: MSVC++ 14.0 (2015)


Edition Windows 10 Pro
Version 2009
Installed on ‎13-‎Dec-‎24
OS Build 19045.5608

Re: Draw Polyline - Extra options to create arcs

Posted: Thu Apr 10, 2025 5:11 pm
by cfg
.......one is 'scripts' and the other, 'script'.

Re: Draw Polyline - Extra options to create arcs

Posted: Fri Apr 11, 2025 7:48 am
by CVH
@cfg

It is unsure that this 2014 contribution of Robert S. aka riverbuoy is still valid.
The idea behind this is definitely something to think about further. :wink:
Even 'Arc tangentially' has limited functionality. See ArcTangential.js topic

For some reason it didn't make the cut and was not adopted in standard releases since 2014-15.
Knowing that Andrew is not a fan of tools with many optional settings ...


Most QCAD tool scripts are only present in compiled form.
Chances are that you won't find the complete folder structure under 'scripts'

With including the zip content under ...QCAD/scripts/Draw/Polyline/DrawPolyline/ we can supersede the compiled version.
Where the 3 dots stand for your QCAD or QCAD/CAM installation folder.
If absent you need to create the required folder structure yourself.


While QCAD is updated on regular base there are certainly code pieces that must be adapted.

I think that you must (at least) adapt the first line of code then:
include("../Polyline.js"); > > > include("scripts/Draw/Polyline/Polyline.js");
One folder up would be empty but the complete path will include the intended script from the compiled version.


If found to be not functional, then simply wipe the added folders and content. :wink:

Regards,
CVH