Tool request: Arc 2 Points and Arc Length

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

Please use this forum to request/submit your script Add-Ons & Plug-in idea's.

Moderators: andrew, Husky, J-J

Post Reply
User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 2185
Joined: Wed May 11, 2011 9:25 am
Location: USA

Tool request: Arc 2 Points and Arc Length

Post by Husky » Tue Aug 04, 2015 9:55 am

Hi everybody! 8)

Right now we have nice Arc tools in QCAD for "2 Points and radius" and " 2 Points and Angle".
What I need from time to time is a "2 Points and Arc length" tool but we don't have it. :cry:

Yes - with extern calculation I'm able to solve this problem but it is time consuming and it would be nice to have a "One click solution" directly in QCAD. And no, you can't solve this problem simply with the Property Editor ...

Goal (Like the other 2 point Arc tools): Snap to two points - tell the option menu the length of the arc and the direction (positive/negative) - done.

This sketch shows on the left side what I have and on the right side what I like to get. I know only the arc length e.g. 189 ...
Husky-2015.08.04-01.png
Husky-2015.08.04-01.png (3.17 KiB) Viewed 8584 times
I guess that isn't to complicated - but I'm not a programmer .... :oops:

What do you think?
Work smart, not hard: QCad Pro

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

Re: Tool request: Arc 2 Points and Arc Length

Post by Clive » Wed Aug 05, 2015 9:38 am

Hey Husky, nice suggestion. Can you give an example of where you would only know the arc length.

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

Re: Tool request: Arc 2 Points and Arc Length

Post by Husky » Wed Aug 05, 2015 9:13 pm

Hi Clive,
Clive wrote:Hey Husky, nice suggestion. Can you give an example of where you would only know the arc length.
sure - in Mechanical engineering are many cases where you need something like this but right now I like to use this example to challenge YOU 8)

It's a pretty easy drawing - but you can't finish the task ONLY with QCAD. With a new tool "Arc 2 Points and Length" it would be a piece of cake - but now ...

Try to draw this example by yourself. All what we have is:
... the Inner circle with a Radius of 70 and the guideline that we have to put in Drill holes - center of the Magenta Line with an "Arc length" distance of 21.
Husky-2015.08.05-04.png
Husky-2015.08.05-04.png (40.62 KiB) Viewed 8552 times
What do you think? 8)
Work smart, not hard: QCad Pro

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

Re: Tool request: Arc 2 Points and Arc Length

Post by Clive » Thu Aug 06, 2015 9:26 am

Hey thanks Husky for the example, that's all I was asking for, no need for the challenge.

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

Re: Tool request: Arc 2 Points and Arc Length

Post by riverbuoy » Wed Aug 12, 2015 11:01 am

Hi Husky,

Like Clive I think this is a nice suggestion, and would be a good option to have.

So I decided to give this a go.
Husky wrote:I guess that isn't to complicated - but I'm not a programmer .... :oops:
Ha... Maybe it isn't too complicated for an engineer, but coming from an architectural background, I have never had to solve something like this before. (Architects let the engineers do the hard stuff).
So I started googling. The script would actually know two pieces of information, the arc length and a chord length (the distance between the two points). Very few people know how to do this, or are unwilling to share this information. However, a few days later I came across a small function, written in Autolisp, which calculates the included angle of the arc, and also the radius. This was what I needed. Having used Autolisp in the past, I was able to convert it to ecmascript.
Husky wrote:Goal (Like the other 2 point Arc tools): Snap to two points - tell the option menu the length of the arc and the direction (positive/negative) - done.
I have now completed a script which does exactly this. I have tried it with quite a few lengths, even going to 6 decimal places, and so far the property editor has reported the lengths to be the same as the value in the Length entry box.

The attached file 'Arc2PL.zip' contains a compressed directory with the same name. Extract this directory to the '/scripts/Draw/Arc/' directory. This adds a new command "arclength", and a shortcut, 'AL'. The icon is placed in the arc toolbar just after the '2 Points and Angle' icon.

Test it out, and let me know what you think. Also, if you find a bug, again let me know.

Thanks

riverbuoy
Attachments
Arc2PL.zip
(17.6 KiB) Downloaded 219 times

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

Re: Tool request: Arc 2 Points and Arc Length

Post by Husky » Thu Aug 13, 2015 9:07 am

Hello riverbuoy,

I downloaded and tested your new tool in many difference scenarios and I have just to say: VERY NICE! It works just like that what I was asking for. :D
Thank you again for your help - I really appreciate it and I'm sure ... not only me! :wink:


@Andrew
Could we get this implemented in one of the next QCAD releases ...... ?
Work smart, not hard: QCad Pro

User avatar
andrew
Site Admin
Posts: 5696
Joined: Fri Mar 30, 2007 6:07 am

Re: Tool request: Arc 2 Points and Arc Length

Post by andrew » Fri Aug 14, 2015 11:36 am

Yes, this looks good. I will add documentation, translations and unit tests and hopefully this will make it into the next release. Thanks riverbuoy!

User avatar
andrew
Site Admin
Posts: 5696
Joined: Fri Mar 30, 2007 6:07 am

Re: Tool request: Arc 2 Points and Arc Length

Post by andrew » Fri Aug 14, 2015 11:50 am

riverbuoy: This tool now lives at:
https://github.com/qcad/qcad/tree/maste ... Arc/Arc2PL

Please refer to the repository for the latest version before updating or changing anything, thanks.

User avatar
andrew
Site Admin
Posts: 5696
Joined: Fri Mar 30, 2007 6:07 am

Re: Tool request: Arc 2 Points and Arc Length

Post by andrew » Tue Aug 25, 2015 10:06 am

This tool has been integrated in the latest QCAD 3.10.0 release:
viewtopic.php?f=16&t=3657

Post Reply

Return to “QCAD 'Script Add-On & Plug-in challenge' - Work in Progress”