We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

GDL
About building parametric objects with GDL.

Find X and Y of where line intersects with chamfer / fillet

JGoode
Expert

I have a box where any of the corners can be filleted or chamfer... or just a plain right angle. 

 

My goal is for the diagonal lines to come to a stop when they reach the chamfer or fillet and not extend past to the corner. Hopefully the images attached demonstrate this.

 

Is there anything similar to a cutpoly for 2D? I haven't been able to find a formula to figure out how to calculate the x and y of the points.

 

Any help would be very much appreciated,

Thanks


Intersecting corners.JPGIntersecting corners 2.JPG
ArchiCAD 23

Windows 10
2 REPLIES 2
Lingwisyer
Guru

You know the coordinates of the two ends of your diagonal line.

From those two ends, you can work out the equation for the line that runs between the two.

 

You know where your chamfer corners are.

From your chamfer corners, you can work out the equation for the line that runs between the two.

 

You now have two equations. Well, four if you are working your x and y separately... Anyway, now with your two equations, you can use an IF statement for when they equal each other. When they do, x (diagonal) = x (chamfer) and y (diagonal) = y (chamfer)

 

The fillet will be a similar process using x^2 + y^2 = r together with your circles centre offset. You will get two intersection points with this though so you will need to eliminate them depending on which corner you are solving for.

 

 

Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win10 | R5 2600 | 16GB | GTX1660
Peter Baksa
Graphisoft
Graphisoft

There is no language support for this, but we have

Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!