2023-08-08 04:43 AM
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?
2023-08-08 05:04 AM
cutpolya?
doesn't sound like an ArchiCAD command.
2023-08-08 05:12 AM - last edited on 2023-08-10 01:59 PM by Laszlo Nagy
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
2023-08-08 05:38 AM
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.
2023-08-08 08:00 AM - edited 2023-08-08 08:01 AM
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.
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
2023-08-08 09:09 AM
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.
2023-08-08 09:39 AM
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.
2023-08-08 09:58 AM - edited 2023-08-08 10:10 AM
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.
2023-08-08 10:11 AM
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.
2023-08-29 05:12 AM
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. 😊