This section is for general discussion about Gadgets
jimandi5000
Vectric Wizard
Posts: 1054 Joined: Wed Mar 11, 2015 6:50 pm
Model of CNC Machine: Home Made 60 x 120
Location: North Houston Tx.
Contact:
Post
by jimandi5000 » Mon Nov 11, 2019 2:28 am
Hi all,
Looking for some help. before I do the deep dive on spending a bunch of time, I would ask... I am looking for the formula to calculate arc bulge. Anyone out there crossed that bridge?
This is what I have so far:
Code: Select all
function BulgeCalculator (Rad, Ang)
return math.tan (math.rad(Ang) * Rad)
end
Thanks,
Jim
jimandi5000
Vectric Wizard
Posts: 1054 Joined: Wed Mar 11, 2015 6:50 pm
Model of CNC Machine: Home Made 60 x 120
Location: North Houston Tx.
Contact:
Post
by jimandi5000 » Mon Nov 11, 2019 4:39 am
Hi,
I wrote this and ran 30 to 40 test. I am thing it is working.
Code: Select all
function Arc2Bulge (p1, p2, Rad)
local chord = math.sqrt(((p2.x - p1.x) ^ 2) + ((p2.y - p1.y) ^ 2))
local seg = (Rad - (0.5 * (math.sqrt((4.0 * Rad^2) - chord^2))))
local bulge = (2 * seg) / chord
return bulge
end
Thanks,
Jim
vgraves
Vectric Craftsman
Posts: 122 Joined: Sat Sep 29, 2012 2:04 am
Model of CNC Machine: CNC Router Parts PRO4848 w/LinuxCNC
Location: Knoxville, TN
Post
by vgraves » Mon Nov 11, 2019 6:46 pm
Not exactly sure what you mean by bulge, but I interpreted it to refer to circular segments. This may help you validate the results of your existing function.
https://en.wikipedia.org/wiki/Circular_segment
Van
jimandi5000
Vectric Wizard
Posts: 1054 Joined: Wed Mar 11, 2015 6:50 pm
Model of CNC Machine: Home Made 60 x 120
Location: North Houston Tx.
Contact:
Post
by jimandi5000 » Tue Nov 12, 2019 5:05 am
Hi Van,
Thanks for the reply. Here is what the SDK states on page 95.
Attachments
Thanks,
Jim
jimandi5000
Vectric Wizard
Posts: 1054 Joined: Wed Mar 11, 2015 6:50 pm
Model of CNC Machine: Home Made 60 x 120
Location: North Houston Tx.
Contact:
Post
by jimandi5000 » Fri Nov 15, 2019 8:19 am
Hi armbrusterco,
Not sure I agree. the SDK states
The bulge represents a ratio between the chord length of an arc and its height (bulge = (2*arc_height) / chord_length).
So you are somewhat correct we do need the sagitta but we need the ratio to the chord to the sagitta.
Thoughts?
Thanks,
Jim
armbrusterco
Vectric Craftsman
Posts: 128 Joined: Tue Feb 14, 2012 5:26 am
Model of CNC Machine: Roland MDX-40A
Location: Lake Barrington, IL
Contact:
Post
by armbrusterco » Sun Nov 17, 2019 5:06 am
You are correct. I missed the ratio. Oooops.
jimandi5000
Vectric Wizard
Posts: 1054 Joined: Wed Mar 11, 2015 6:50 pm
Model of CNC Machine: Home Made 60 x 120
Location: North Houston Tx.
Contact:
Post
by jimandi5000 » Sun Nov 17, 2019 5:43 pm
No Problem... I am just trying to learn as much as I can...
Thanks,
Jim