Help with radius

Drop in here to discuss whatever you want.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
MM1970
Newbie Member
Posts: 4
Joined: Sat Apr 18, 2020 9:10 pm

Help with radius

Post by MM1970 » Tue Apr 21, 2020 2:16 pm

Hello,

can please someone help how to draw with script attached curve?

Many thanks Martin
Attachments
qcadforum.dxf
(104 KiB) Downloaded 455 times

CVH
Premier Member
Posts: 3417
Joined: Wed Sep 27, 2017 4:17 pm

Re: Help with radius

Post by CVH » Tue Apr 21, 2020 3:42 pm

A: Your arc has a radius of 25000, not 50000
There is a second text "R 50.000" @ (2900,1142.35677...)

B: By simple math ... calculate the centerpoint from two points on an arc and the radius.
C: Calculate the inclosed arc and the start and end angle.
D: Use the simple API function addArc(center, radius, startAngle, endAngle, reversed)
Where: 'center' is a Rvector, 'radius' and 'angles' are values, the angles are in degrees, reversed is a boolean.

Regards,
CVH.

MM1970
Newbie Member
Posts: 4
Joined: Sat Apr 18, 2020 9:10 pm

Re: Help with radius

Post by MM1970 » Tue Apr 21, 2020 6:55 pm

Hello CVH,

Thank you, for your reply. I understand how work addArc, but how to calculate start and end angle. I want to find some setup for different radius and width between two parallel lines. I import numbers as coordinates from excel table and do not know how to calculate in this setup start and end angle for different radius... Can you please let me know how to do it?

Thank you Martin

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

Re: Help with radius

Post by Husky » Tue Apr 21, 2020 9:15 pm

Hi,
MM1970 wrote:
Tue Apr 21, 2020 6:55 pm
I import numbers as coordinates from excel table and do not know how to calculate in this setup start and end angle for different radius...
Do I understand that correctly that your plan is to automatically create a script based drawing for pool enclosures but you are struggeling to calculate the different radii parameter ...
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

CVH
Premier Member
Posts: 3417
Joined: Wed Sep 27, 2017 4:17 pm

Re: Help with radius

Post by CVH » Tue Apr 21, 2020 11:03 pm

Assuming:
The chord is always horizontal.
The arc passes thrue P1(x1,y) and P2(x2,y).
The arc has radius R.

The chord length: c = x2-x1
The x coordinate of the center is x1+(c/2)

The central angle: a = 2arcsin(c/2R) (! in degrees)
The sagitta: h = R(1-cos(a/2))

The center is R-h lower then P1 & P2
The y coordinate of the center is y-(R-h)

Straight up is 90 degrees.
Start angle is 90+(a/2), End angle is 90-(a/2), non-reversed

Done. :wink:
CVH

CVH
Premier Member
Posts: 3417
Joined: Wed Sep 27, 2017 4:17 pm

Re: Help with radius

Post by CVH » Wed Apr 29, 2020 10:41 am

MM1970,
you had send me a PM where I did reply on.
I see my reply is still in my Outbox.
Pls have a look at your 'Private messages'.

CVH

MM1970
Newbie Member
Posts: 4
Joined: Sat Apr 18, 2020 9:10 pm

Re: Help with radius

Post by MM1970 » Wed May 27, 2020 8:26 pm

Hello CVH,

I am sorry for not replying sooner, I solved my request alone thank to your explanation how to draw curved lines. I made calculation(was not so easy for me, but after some mistakes I finished it..) in Excel for curved and straight lines and then I made set of coordinates for complicated drawing and with help of Ctrl C and Ctrl V I load set of coordinates into QCAD, where nice and exact drawing is finished in 2 seconds...this is absolutely outstanding solution, because I can spend 3-4 hours with each customer drawing!!!! So very easy change of parameters in few seconds.

Many thanks for your time and help!
Martin

Post Reply

Return to “Chat”