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

GDL
About building parametric objects with GDL.
SOLVED!

GDL Geometry Intersection

Pink Projects
Participant

Hi there:

I'm creating a GDL drawer object for detaioed millwork drawings. I'm a complete noob to GDL scripting.

Having trouble with creating a clean intersection for the dado at the drawer bottom/drawer side intersection. See attached image.

 

Any hints?

 

Code looks like this:

 

! Drawer Sides
building_material box_building_material
PRISM_ 10, ZZYZX,
0, 0, 15,
A, 0, 15,
A, B, 15,
0, B, 15,
0, 0, -1,

box_material_thickness, box_material_thickness, 15,
A-box_material_thickness, box_material_thickness, 15,
A-box_material_thickness, B-box_material_thickness, 15,
box_material_thickness, B-box_material_thickness, 15,
box_material_thickness, box_material_thickness, -1


! Drawer Bottom
building_material bottom_building_material
ADDZ bottom_location
PRISM_ 4, bottom_material_thickness,
0+box_material_thickness-bottom_dado_thickness, 0+box_material_thickness-bottom_dado_thickness, 15,
A-box_material_thickness+bottom_dado_thickness, 0+box_material_thickness-bottom_dado_thickness, 15,
A-box_material_thickness+bottom_dado_thickness, B-box_material_thickness+bottom_dado_thickness, 15,
0+box_material_thickness-bottom_dado_thickness, B-box_material_thickness+bottom_dado_thickness, 15

 

Operating system used: Mac Apple Silicon


Image 9-4-24 at 6.06 PM.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Lingwisyer
Guru

It is pretty easy to use. You just need to define groups as you go.

GROUP "Drawer Box"
...
endGROUP

GROUP "Drawer Bottom"
...
endGROUP

Drawer_Sides = SUBGROUP ("Drawer Box", "Drawer Bottom")

PLACEGROUP Drawer_Sides
PLACEGROUP "Drawer Bottom"

 

There is also an option to define a material to a group if need be.

 

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

View solution in original post

7 REPLIES 7
Lingwisyer
Guru

Have you tried using SUBGROUP? Subtract your bottom from your box, then place the result together with the bottom. Though it you are needing this sort of detail, I feel like you should be modelling the sides separate from the front and back or your drawer...

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

Hmm, have not explore that. Will dig in to the referene guide. Any tips in the meantime?

Solution
Lingwisyer
Guru

It is pretty easy to use. You just need to define groups as you go.

GROUP "Drawer Box"
...
endGROUP

GROUP "Drawer Bottom"
...
endGROUP

Drawer_Sides = SUBGROUP ("Drawer Box", "Drawer Bottom")

PLACEGROUP Drawer_Sides
PLACEGROUP "Drawer Bottom"

 

There is also an option to define a material to a group if need be.

 

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
Barry Kelly
Moderator

Another way to do it is to create a CUTPOLYA or CUTSHAPE that is the same size and position as the base.

 

Script the CUTPOLYA.

Then script the drawer sides (box).

Then CUTEND

Then script the base.

 

Using GROUPS basically does that for you.

As Ling suggested, a group for the box.

A group for the base

Subtract the base from the box and place the result.

Then place the base to fill the base you used as the cut (subtract).

 

Barry.

 

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

Doesn't CUTPOLY use infinite / half infinite extrusions so it would cut out the sides of the box? Though if the OP did the drawer front separately, that could work. Maybe one of the other CUT commands, but then you are defining the base shape twice, which if you do not need to model tolerances would be a waste. CUTPOLY would be good if you do a box with a drop-in base though.

 

 

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

I think you can control the length of the half infinite tube, or maybe that is the distance that the half infinite tube starts above the origin, which i think is what it might be.

I think cut shape ma be the same now I read then manual again.

CUTFORM I believe gives you total control

 

But grouping is the easier way to cut one portion from another.

 

Barry

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

Awesomeness. This worked perfectly. Thanks so much for the hand-holding 🙂 

Setup info provided by author