Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Complex poly math question.

Anonymous
Not applicable
Hey all,

I have a fairly complex math question (or at least for me). In a gdl object i want to draw a polygon that has 2 sides made from a curve and 2 sides a straight line. This is easy enough but i also want to fillet where they join, see sketch.

Does anyone know the how to work out the formula for this, i believe the formula lies in analytical geometry but is a bit beyond me.

P.S. I realise 2 lines can be filleted using status codes using poly_b but i need to know the start, end and centre points of the fillet when a straight line and curve intersect to use this.

Thanks for any help

Page0001.jpg
11 REPLIES 11
Frank Beister
Advisor
You need one more known distance f. The resulting radius r1 of the fitting circle is unique. The pink right triangle brings the formulas. To calculate the X/Y coordinates is still a lot of work, but this should bring you on the track.
HTH. Frank
rounded.jpg
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
LiHigh
Newcomer
I hope this is what you are looking for...

!-----------------------------------------
r2 = r1 + d
u = ATN(f/(r2-f))
w = ATN(f/(r1+f))

x1=r1+f :y1=0
x2=r2-f :y2=0
x3=r2*cos(u) :y3=r2*sin(u)
x4=r2*cos(alpha-u) :y4=r2*sin(alpha-u)
x5=(r2-f)*cos(alpha) :y5=(r2-f)*sin(alpha)
x6=(r1+f)*cos(alpha) :y6=(r1+f)*sin(alpha)
x7=r1*cos(alpha-w) :y7=r1*sin(alpha-w)
x8=r1*cos(w) :y8=r1*sin(w)
!-----------------------------------------

poly2_ 9,7,
x1, y1, 1,
x2, y2, 1,
x3, y3, 1001,
x4, y4, 1001,
x5, y5, 1001,
x6, y6, 1,
x7, y7, 1001,
x8, y8, 1001,
x1, y1, 1001
polyShape.jpg
Howard Phua

Win 10, Archicad 19 INT
LiHigh
Newcomer
the object.....enjoy!
Howard Phua

Win 10, Archicad 19 INT
Anonymous
Not applicable
Thanks for your help LiHigh and Frank. A very sound explanation, I should be able to implement this easily now.
Frank Beister
Advisor
@LiHigh
That's a quiet good approximation, but it is not the exact solution. Add this at the end of your script:

!-----------------------------------------
line2 r1,0,r1+d,0
arc2 0,0,r1,0,alpha
arc2 0,0,r1+d,0,alpha
rot2 alpha
line2 r1,0,r1+d,0
del 1
!-----------------------------------------

And you will see intersection of the boundarys, which might not exist. The reason:
X2 is NOT R2-F. If you have a look on it in a larger scale you will see. The dependance of the edge radius and the distance of the tangiantial point is as complex as I wrote in my posting above. So it is for all other points. Maybe it is easier to give the radius known instead of the distance. Does make not much difference as one can see. In every case I am shure that there is a simple solution, because the angle of the rounding arc can be found in any of the known triangles. I don't know the English expressions, but there is a basic trigonometric rule that lets me believe in this.

If I get my work done before I sleep I spent still a thought on it. 😉 Interesting problem.
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Frank Beister
Advisor
Some work and sleep in between. Here is teh exact calculation part:

!-----------------------------------------
r2 = r1 + d
L1 = sqr(r1) * sqr(2*f+r1) - R1
L2 = r2 - sqr(r2^2-2*f*r2)
u = ATN(f/(r2-L2))
w = ATN(f/(r1+L1))

x1=r1+L1 : y1=0
x2=f/tan(u) : y2=0
x3=r2*cos(u) : y3=f*r2/(r2-f)
x4=r2*cos(alpha-u) : y4=r2*sin(alpha-u)
x5=(r2-L2)*cos(alpha) : y5=(r2-L2)*sin(alpha)
x6=(r1+L1)*cos(alpha) : y6=(r1+L1)*sin(alpha)
x7=r1*cos(alpha-w) :y7=r1*sin(alpha-w)
x8=r1*cos(w) :y8=f*r1/(r1+f)
!-----------------------------------------
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
Frank Beister
Advisor
@LiHigh
May I use your illustration and script for a documentation page on opengdl?
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
LiHigh
Newcomer
F. wrote:
@LiHigh
May I use your illustration and script for a documentation page on opengdl?
Sure! feel free to do so.
Howard Phua

Win 10, Archicad 19 INT
LiHigh
Newcomer
F. wrote:
@LiHigh
That's a quiet good approximation, but it is not the exact solution.
You are right!

The Fix:

!-----------------------------------------
r2 = r1 + d
u = ASN(f/(r2-f))
w = ASN(f/(r1+f))

x1=(r1+f)*cos(w) :y1=0
x2=(r2-f)*cos(u) :y2=0
x3=r2*cos(u) :y3=r2*sin(u)
x4=r2*cos(alpha-u) :y4=r2*sin(alpha-u)
x5=(r2-f)*cos(u)*cos(alpha) :y5=(r2-f)*cos(u)*sin(alpha)
x6=(r1+f)*cos(w)*cos(alpha) :y6=(r1+f)*cos(w)*sin(alpha)
x7=r1*cos(alpha-w) :y7=r1*sin(alpha-w)
x8=r1*cos(w) :y8=r1*sin(w)
!-----------------------------------------

poly2_ 9,7,
x1, y1, 1,
x2, y2, 1,
x3, y3, 1001,
x4, y4, 1001,
x5, y5, 1001,
x6, y6, 1,
x7, y7, 1001,
x8, y8, 1001,
x1, y1, 1001
Howard Phua

Win 10, Archicad 19 INT