## Tool request: Arc 2 Points and Arc Length

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

Moderators: andrew, Husky, J-J

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

### Tool request: Arc 2 Points and Arc Length

Hi everybody!

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.

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 (3.17 KiB) Viewed 9466 times
I guess that isn't to complicated - but I'm not a programmer ....

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

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

### Re: Tool request: Arc 2 Points and Arc Length

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

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

### Re: Tool request: Arc 2 Points and Arc Length

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

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 (40.62 KiB) Viewed 9434 times
What do you think?
Work smart, not hard: QCad Pro

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

### Re: Tool request: Arc 2 Points and Arc Length

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

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

### Re: Tool request: Arc 2 Points and Arc Length

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 ....
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

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

### Re: Tool request: Arc 2 Points and Arc Length

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.
Thank you again for your help - I really appreciate it and I'm sure ... not only me!

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

andrew
Posts: 6164
Joined: Fri Mar 30, 2007 6:07 am

### Re: Tool request: Arc 2 Points and Arc Length

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

andrew
Posts: 6164
Joined: Fri Mar 30, 2007 6:07 am

### Re: Tool request: Arc 2 Points and Arc Length

riverbuoy: This tool now lives at: