We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2022-10-24 06:50 PM - last edited on 2022-10-25 02:51 PM by Noemi Balogh
Howdy folks,
what's the secret for having primitives being displayed as solid?
The following script will still be hollow...
base
!------
vert 0, 0, 0
vert A, 0, 0
vert A/2, 0, zzyzx
vert 0, B, 0
vert A, B, 0
vert A/2, B, zzyzx
vect 0,0,-1 !1
vect 0,-1,0 !2
vect 0,1,0 !3
!-----
edge 1, 2, -1, -1, 0 !#1
edge 2, 3, -1, -1, 0
edge 3, 1, -1, -1, 0
edge 4, 5,-1, -1, 0
edge 5, 6,-1, -1, 0
edge 6, 4,-1, -1, 0
edge 1, 4, -1, -1, 0 !#7
edge 2, 5, -1, -1, 0
edge 3, 6, -1, -1, 0
!-----
pgon 3, 2, -1, 1, 2, 3
pgon 3, 3, -1, 4, 5, 6
pgon 4, 1, -1, 1, 8, -4 ,-7
pgon 4, 0, -1, 3, 7, -6, -9
pgon 4, 0, -1, 2, 9, -5, -8
body -1
Solved! Go to Solution.
2022-10-25 10:12 PM
Thanks @Miha_M for the link to the GDL center. Sometimes you just have to read the manual very carefully for the 100th time. There is an innocent sentence hidden in plain sight:
In the case of closed bodies, the polygon’s orientation is correct if the edge has different prefixes in the edge list of the two polygons.
And that is the issue...
A solid is defined by the simple rule that every defined edge must be referenced exactly 2 times. AND to have an actual cut fill the sign of the number must be different. E.g. edge #1 must be referenced as "1" and as "-1" the other time.
In other news: All polygons strictly need to be defined counter clockwise (when viewed from the "outside"). So screw VECTs. You would assume that defining them would be able to "heal" the wrong orientation, but nope! Note that this works only if you already defined the EDGEs in a correct manner. If they are wrong you are out of luck.
My example script corrected would look like this:
base
vert 0, 0, 0
vert A, 0, 0
vert A/2, 0, zzyzx
vert 0, B, 0
vert A, B, 0
vert A/2, B, zzyzx
edge 1,2, -1, -1, 0
edge 2,3, -1, -1, 0
edge 3,1, -1, -1, 0
edge 5,4, -1, -1, 0
edge 6,5, -1, -1, 0
edge 4,6, -1, -1, 0
edge 1,4, -1,-1, 0
edge 2,5, -1,-1, 0
edge 3,6, -1,-1, 0
pgon 3, 0, -1, 1,2,3
pgon 3, 0, -1, 4,6,5
pgon 4, 0, -1, -1,7,-4,-8
pgon 4, 0, -1, -3,9,-6,-7
pgon 4, 0, -1, 8,-5,-9,-2
body -1
2022-10-24 07:13 PM
@runxel Random suggestion as I have never ventured into creating solids but there is a Directive MODEL SOLID, which you may need to issue in your script?
Other than that I bow to your far greater knowledge of GDL.
2022-10-24 10:32 PM
Thanks for input and compliment @DGSketcher!
The "model solid" does not help but of course I tried it.
What's even more curious: When converted to a morph the element will report as solid, even tho it cleary is not (check with a section or a cut plane in 3D).
If a boolean is performed on the body it will suddenly be filled.
Maybe @Peter Baksa has some insights.
2022-10-25 02:17 PM - edited 2022-10-25 04:44 PM
My GDL knowledge is very basic and I can't even imagine how far GDL can reach. My compliments to all of you who dare to walk the GDL path.
I tried one simple thing though, based on a GDL example here, which I added to your script:
Primitive Elements | Graphisoft GDL Center
and this one does give me a solid body. @runxel I am sure you can figure out why this one is working fine and find a solution for your triangled body to become solid - at my knowledge level it would take a long time so I won't even try it.
!your script here |
EDIT: Well, I tried to replicate the GS script on your geometry and even without the VECT definitions the body doesn't become solid. Interesting.
| Archicad 4.55 - 27
| HP Z840 | 2× E5-2643 v4 | 64 GB RAM | Quadro M5000 | Windows 10 Pro x64
| HP Z4 G4 | W-2245 | 64 GB RAM | RTX A4000 | Windows 11
2022-10-25 10:12 PM
Thanks @Miha_M for the link to the GDL center. Sometimes you just have to read the manual very carefully for the 100th time. There is an innocent sentence hidden in plain sight:
In the case of closed bodies, the polygon’s orientation is correct if the edge has different prefixes in the edge list of the two polygons.
And that is the issue...
A solid is defined by the simple rule that every defined edge must be referenced exactly 2 times. AND to have an actual cut fill the sign of the number must be different. E.g. edge #1 must be referenced as "1" and as "-1" the other time.
In other news: All polygons strictly need to be defined counter clockwise (when viewed from the "outside"). So screw VECTs. You would assume that defining them would be able to "heal" the wrong orientation, but nope! Note that this works only if you already defined the EDGEs in a correct manner. If they are wrong you are out of luck.
My example script corrected would look like this:
base
vert 0, 0, 0
vert A, 0, 0
vert A/2, 0, zzyzx
vert 0, B, 0
vert A, B, 0
vert A/2, B, zzyzx
edge 1,2, -1, -1, 0
edge 2,3, -1, -1, 0
edge 3,1, -1, -1, 0
edge 5,4, -1, -1, 0
edge 6,5, -1, -1, 0
edge 4,6, -1, -1, 0
edge 1,4, -1,-1, 0
edge 2,5, -1,-1, 0
edge 3,6, -1,-1, 0
pgon 3, 0, -1, 1,2,3
pgon 3, 0, -1, 4,6,5
pgon 4, 0, -1, -1,7,-4,-8
pgon 4, 0, -1, -3,9,-6,-7
pgon 4, 0, -1, 8,-5,-9,-2
body -1