Help with radius

Drop in here to discuss whatever you want.

Moderator: andrew

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 67 times

CVH
Premier Member
Posts: 763
Joined: Wed Sep 27, 2017 4:17 pm
Location: Belgium; Antwerp

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.
QCADpro 3.24.3.0 / win7pro 32 bit / 4GB / 1e generation i7 2.6Ghz / HDD GeForce GT 520

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: 3155
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

If a thread is considered as "solved" please change the title of the first post to "[solved] Title...". Thanks!

CVH
Premier Member
Posts: 763
Joined: Wed Sep 27, 2017 4:17 pm
Location: Belgium; Antwerp

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
QCADpro 3.24.3.0 / win7pro 32 bit / 4GB / 1e generation i7 2.6Ghz / HDD GeForce GT 520

CVH
Premier Member
Posts: 763
Joined: Wed Sep 27, 2017 4:17 pm
Location: Belgium; Antwerp

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
QCADpro 3.24.3.0 / win7pro 32 bit / 4GB / 1e generation i7 2.6Ghz / HDD GeForce GT 520

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”