GDL
About building parametric objects with GDL.

Can I cut the outer side of a polygon with the cutpolya?

yongler
Booster

Can I cut the outer side of a polygon with the cutpolya command? I want to keep the inside of the polygon and trim off the outside of the polygon. How to do it?

20230808104148.jpg

9 REPLIES 9
Gerry Leonor
Advisor

cutpolya?

 

doesn't sound like an ArchiCAD command.

AC25 | Win10 | 64 bit | 16Gb RAM |Intel i7 8700 @ 3.20Ghz

come join our unofficial Discord server
https://discord.gg/XGHjyvutt8

It's GDL  command.

 

CUTPOLYA n, status, d,
x1, y1, mask1, ..., xn, yn, maskn [,
x, y, z]
[statement1
statement2
...
statementn]
CUTEND



Similar to the CUTPOLY command, but with the possibility to control the visibility of the edges of the generated polygons. The cutting form
is a half-infinite tube with the defined polygonal cross-section. If the end of the cutting form hangs down into the body, it will cut out the
corresponding area.

 

status: controls the treatment of the generated cut polygons.
1: use the attributes of the body for the generated polygons and edges,
2: generated cut polygons will be treated as normal polygons.
d: the distance between the local origin and the end of the half-infinite tube.
0: means a cut with an infinite tube.
maski: similar to the PRISM_ command.
maski = j1 + 2*j2 + 4*j3 + 64*j7, where each j can be 0 or 1.

…… …… 

 

But there is no status code to determine whether the cutting is on the inside or outside

CUTPOLYA uses mask values similar to PRISM_.

So try adding a hole (mask -1) to it.

So basically you will be making a hole inside a hole that hopefully won't cut the inside.

 

I am not sure it will work, but worth a try.

 

If not you will have to use CUTPLANEs.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

It doesn't look good. It seems that we can only use cutplane.

This is a defect of GDL, and the option of cutting the inner or outer sides of cutpolya should be added.

 
20230808135231.jpg
 
 
 
 
 
 
 

 

 

cutpolya  8  ,1, 0 , 
   -2 , -2 , 15 ,
   2 ,  -2 , 15 ,
   0 , 2 , 15 ,
   -2 , -2 , -1 ,  

   -0.8 , -0.8 , 15 ,
   0.8 , - 0.8 , 15 ,
   0 , 0.8 , 15 ,
   -0.8 , -0.8 , -1  

prism_   5 , 0.1 , 
           -3 , -3 , 15,
        3 ,  -3 , 15,
        3 , 3 , 15,
         -3 ,  3 , 15,
         -3 , -3 , 15
cutend

 

 

Joachim Suehlo
Advisor

It works, yes, but it depends on the direction of the points given in. I am not sure, which is the working direction. (You are moving from left to right, try the other direction, which is mathematical positive)
Another way would be to use 2 half Cutpolys.

Joachim Suehlo . AC12-27 . MAC OSX 13.5 . WIN11
GDL object creation: b-prisma.de

Sorry it didn't work.

I guess looking at it, normally with a PRISM when you cut a hole.

The connecting points are hidden inside the prism and you only see the whole in the centre.

 

But because you are connecting across a hole, you see the connection, and a hole inside another hole really makes no sense, which is probably why it doesn't work.

 

I just tried reversing the direction of the points as Joachim suggested, and had no luck.

 

So CUTPLANEs or 2 CUTPOLYs it will have to be.

 

Or you could play around with GROUPS.

One group being a large outer PRISM_ with a hole the shape of your polygon.

The other inner group the polygon elements.

Then subtract the outer group from the inner group.

 

Barry.

 

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Joachim Suehlo
Advisor

I looked at my script, which was working some years ago and made some tries.
It seems that what I said is a bit different:
Attached a working script:

 

PUT 1, 1, 15, 
1, -3, 15,
-3, -3, 15,
-3, 1, 15, 
1, 1, -1,

- 0.5, - 0.5, 15,
- 1.5, - 0.5, 15,
- 1.5, - 1.5, 15,
- 0.5, - 1.5, 15,
- 0.5, - 0.5, -1

!ADDz - 0.1
!PRISM_ NSP/3, 0.1, USE(NSP)
!DEL 1
CUTPOLYa NSP/3, 1, 0, GET(NSP)

! ......................... !

PUT 0, 0, 15, 
-2, 0, 15, 
-2, -2, 15,
0, -2, 15,
0, 0, -1

ADDx 0
PRISM_ NSP/3, 0.1, GET(NSP)
DEL 1
! ......................... !

CUTEND

 

Here I first moved the outer contour from left to right and then the inner contour from right to left.
The commented PRISM_ is for to see what shape the Cutpolya has.

Joachim Suehlo . AC12-27 . MAC OSX 13.5 . WIN11
GDL object creation: b-prisma.de

The GDL component has been made using CUTPLANE. This allows you to freely drag and drop hotspots, freely design various shapes of exterior windows, and have a choice of 4-6 edges.

20230808160708.jpg

yongler
Booster

I have found a better way to use CUTFORM.

The status code of CUTFORM allows for the selection of whether cutting is done externally or internally.

 

Thank you all. 😊

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!