GDL
About building parametric objects with GDL.
SOLVED!

Solid "Primitive" but wrong?

rudl
Contributor

Hello,

As I'm experimenting around with gdl primitive elements I have some questions.
As far as I know all edges need to be used once 1x in positive direction 1x in negative direction also all faces should be counterclockwise. Considering the following mesh I have no Idea why it is turned inside out? All Faces in the following example should have the counter clockwise direction.

This is a very simple example of some much bigger parametric primitiv I'm working on

Screenshot 2023-12-21 103855.jpg

 

 

 

 

 

 

 

!EDGESTYLE
es= 0!

VERT 0,0,1
VERT 0,1,1
VERT 0,2,1
 
VERT 1,0,1
VERT 1,1,1
VERT 1,2,1

VERT 2,0,1
VERT 2,1,1
VERT 2,2,1

VERT 0,0,0
VERT 0,1,0
VERT 0,2,0
 
VERT 1,0,0
VERT 1,1,0
VERT 1,2,0

VERT 2,0,0
VERT 2,1,0
VERT 2,2,0

!1 SEC 1 EDGES -> SUBCOUNTB

EDGE 1,2,-1,-1,es
EDGE 2,3,-1,-1,es

EDGE 4,5,-1,-1,es
EDGE 5,6,-1,-1,es

EDGE 7,8,-1,-1,es
EDGE 8,9,-1,-1,es

!7 SEC 2 EDGES -> DIAGONALS

EDGE 2,4,-1,-1,es !1,5
EDGE 3,5,-1,-1,es

EDGE 5,7,-1,-1,es
EDGE 6,8,-1,-1,es

!11 SEC 3 EDGES -> SUBCOUNT

EDGE 4,1,-1,-1,es
EDGE 5,2,-1,-1,es
EDGE 6,3,-1,-1,es
EDGE 7,4,-1,-1,es
EDGE 8,5,-1,-1,es
EDGE 9,6,-1,-1,es

!17 SEC 4 EDGES -> SUBCOUNTB2

EDGE 10,11,-1,-1,es
EDGE 11,12,-1,-1,es

EDGE 13,14,-1,-1,es
EDGE 14,15,-1,-1,es

EDGE 16,17,-1,-1,es
EDGE 17,18,-1,-1,es

!23 SEC 5 EDGES -> DIAGONALS2

EDGE 2+9,4+9,-1,-1,es
EDGE 3+9,5+9,-1,-1,es

EDGE 5+9,7+9,-1,-1,es
EDGE 6+9,8+9,-1,-1,es

!27 SEC 6 EDGES -> SUBCOUNT2

EDGE 4+9,1+9,-1,-1,es
EDGE 5+9,2+9,-1,-1,es
EDGE 6+9,3+9,-1,-1,es
EDGE 7+9,4+9,-1,-1,es
EDGE 8+9,5+9,-1,-1,es
EDGE 9+9,6+9,-1,-1,es

!33 SEC 7 EDGES SUBCOUNT INNER

EDGE 1,10,-1,-1,es
EDGE 4,13,-1,-1,es
EDGE 7,16,-1,-1,es

!36 SEC 8 EDGES SUBCOUNT INNER

EDGE 3,12,-1,-1,es
EDGE 6,15,-1,-1,es
EDGE 9,18,-1,-1,es

!39 SEC 9 EDGES SUBCOUNTB INNER

EDGE 2,11,-1,-1,es

!40 SEC 10 EDGES SUBCOUNTB INNER

EDGE 8,17,-1,-1,es

!41 SEC 11 EDGES SUBCOUNT INNER DIAGONAL

EDGE 10,4,-1,-1,es
EDGE 13,7,-1,-1,es

!43 SEC 12 EDGES SUBCOUNT OUTER DIAGONAL

EDGE 12,6,-1,-1,es
EDGE 15,9,-1,-1,es

!45 SEC 13 EDGES SUBCOUNTB INNER DIAGONAL

EDGE 11,1,-1,-1,es
EDGE 12,2,-1,-1,es

!47 SEC 14 EDGES SUBCOUNTB OUTER DIAGONAL

EDGE 17,7,-1,-1,es
EDGE 18,8,-1,-1,es

VECT 0,0,1

!PGONS TOP

PGON 3,0,-1,1,7,11
PGON 3,0,-1,-3,-7,-12
!PGON 3,0,-1,11,7,-3 !
!PGON 3,0,-1,1,-12,-7 !

PGON 3,0,-1,2,8,12
PGON 3,0,-1,-4,-8,-13

PGON 3,0,-1,3,9,14
PGON 3,0,-1,-5,-9,-15

PGON 3,0,-1,4,10,15
PGON 3,0,-1,-6,-10,-16

!PGONS 2 BOTTOM

PGON 3,0,-1,-17,-27,-23
PGON 3,0,-1,19,28,23

PGON 3,0,-1,-18,-28,-24
PGON 3,0,-1,20,29,24

PGON 3,0,-1,-19,-30,-25
PGON 3,0,-1,21,31,25

PGON 3,0,-1,-20,-31,-26
PGON 3,0,-1,22,32,26

!PGONS 3 INNER SUBCOUNT


PGON 3,0,-1,27,41,34
PGON 3,0,-1,30,42,35

PGON 3,0,-1,-11,-41,-33
PGON 3,0,-1,-14,-42,-34

!PGONS 4 OUTER SUBCOUNT

PGON 3,0,-1,-29,-37,-43
PGON 3,0,-1,-32,-38,-44

PGON 3,0,-1,13,36,43
PGON 3,0,-1,16,37,44

!PGONS 5 INNER SUBCOUNT

PGON 3,0,-1,-1,-45,-39
PGON 3,0,-1,-2,-46,-36

PGON 3,0,-1,39,18,46
PGON 3,0,-1,33,17,45

!PGONS 6 OUTER SUBCOUNT

PGON 3,0,-1,5,40,47
PGON 3,0,-1,6,38,48

PGON 3,0,-1,-21,-35,-47
PGON 3,0,-1,-22,-40,-48

BODY -1

 

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Solution

@rudl wrote:

And finally managed to fix it for now. In short it didn't like the 3D hotlines in the script before i did all the Primitive base/verts/edges/Pgons/body 😅😂😂
Moved the hotlines to the end of the script.


Oh that's a very good clue, that we hadn't before without the full version of the script.

It makes sense, in a way, if one understands how the deep the underlaying tech is interwoven. A 3D hotline is nothing else but an actual physical line that has it's edge being hidden. It actually contributes to the model like any other element. (At least I think that is what happens here; I was not aware of this either before to that extent. I knew other model elements like "prism"s and so on do, tho.)

 

It's generally a good idea to start off building primitives with a BASE command, this will restart the indizes at 0, and also end primitives with a BODY -1.

If you would try that I guess the hotlines could be moved back to the beginning, becaues I think the appearance of them without BASE made them "part" of your ramp.

Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»

View solution in original post

Solution
@runxel wrote:
Oh that's a very good clue, that we hadn't before without the full version of the script.

It makes sense, in a way, if one understands how the deep the underlaying tech is interwoven. A 3D hotline is nothing else but an actual physical line that has it's edge being hidden. It actually contributes to the model like any other element. (At least I think that is what happens here; I was not aware of this either before to that extent. I knew other model elements like "prism"s and so on do, tho.)

I guess it does make sense 👍
I kind of figured after converting it into  a morph, which was also not solid, but after collapsing the hotlines it suddenly did turn solid.

 

@runxel wrote:

It's generally a good idea to start off building primitives with a BASE command, this will restart the indizes at 0, and also end primitives with a BODY -1.

If you would try that I guess the hotlines could be moved back to the beginning, becaues I think the appearance of them without BASE made them "part" of your ramp.


There was a BASE command between the  Hotlines (HOTLINE and LIN_ line to be accurate), and the primitive, seems like they really have to be after the body

View solution in original post

6 REPLIES 6
rudl
Contributor

Info This is just a "dumb" version of the following:
Ramp like shapes that can create any ramp you want defined by two lines that are arbitary in space.
It was quite a challenge so far. Now it just needs to be solid.

Screenshot 2023-12-22 101000.jpg
Screenshot 2023-12-22 101051.jpg

Pertti Paasky
Expert

Surprisingly I changed the direction of the first polygon and the result was good. I can´t say why.

PGON 3,0,-1,-1,-11,-7
!PGON 3,0,-1,1,7,11

I think You have some algorithm that produces the result?

These are not easy to imagine. I usually make a 2d graphic of verts, edges and polygons.

__________________

!EDGESTYLE
es= 0!

VERT 0,0,1
VERT 0,1,1
VERT 0,2,1

VERT 1,0,1
VERT 1,1,1
VERT 1,2,1

VERT 2,0,1
VERT 2,1,1
VERT 2,2,1

VERT 0,0,0
VERT 0,1,0
VERT 0,2,0

VERT 1,0,0
VERT 1,1,0
VERT 1,2,0

VERT 2,0,0
VERT 2,1,0
VERT 2,2,0

!1 SEC 1 EDGES -> SUBCOUNTB
EDGE 1,2,-1,-1,es
EDGE 2,3,-1,-1,es
EDGE 4,5,-1,-1,es
EDGE 5,6,-1,-1,es
EDGE 7,8,-1,-1,es
EDGE 8,9,-1,-1,es

!7 SEC 2 EDGES -> DIAGONALS
EDGE 2,4,-1,-1,es !1,5
EDGE 3,5,-1,-1,es
EDGE 5,7,-1,-1,es
EDGE 6,8,-1,-1,es

!11 SEC 3 EDGES -> SUBCOUNT
EDGE 4,1,-1,-1,es
EDGE 5,2,-1,-1,es
EDGE 6,3,-1,-1,es
EDGE 7,4,-1,-1,es
EDGE 8,5,-1,-1,es
EDGE 9,6,-1,-1,es

!17 SEC 4 EDGES -> SUBCOUNTB2
EDGE 10,11,-1,-1,es
EDGE 11,12,-1,-1,es
EDGE 13,14,-1,-1,es
EDGE 14,15,-1,-1,es
EDGE 16,17,-1,-1,es
EDGE 17,18,-1,-1,es

!23 SEC 5 EDGES -> DIAGONALS2
EDGE 2+9,4+9,-1,-1,es
EDGE 3+9,5+9,-1,-1,es
EDGE 5+9,7+9,-1,-1,es
EDGE 6+9,8+9,-1,-1,es

!27 SEC 6 EDGES -> SUBCOUNT2
EDGE 4+9,1+9,-1,-1,es
EDGE 5+9,2+9,-1,-1,es
EDGE 6+9,3+9,-1,-1,es
EDGE 7+9,4+9,-1,-1,es
EDGE 8+9,5+9,-1,-1,es
EDGE 9+9,6+9,-1,-1,es

!33 SEC 7 EDGES SUBCOUNT INNER
EDGE 1,10,-1,-1,es
EDGE 4,13,-1,-1,es
EDGE 7,16,-1,-1,es

!36 SEC 8 EDGES SUBCOUNT INNER
EDGE 3,12,-1,-1,es
EDGE 6,15,-1,-1,es
EDGE 9,18,-1,-1,es

!39 SEC 9 EDGES SUBCOUNTB INNER
EDGE 2,11,-1,-1,es

!40 SEC 10 EDGES SUBCOUNTB INNER
EDGE 8,17,-1,-1,es

!41 SEC 11 EDGES SUBCOUNT INNER DIAGONAL
EDGE 10,4,-1,-1,es
EDGE 13,7,-1,-1,es

!43 SEC 12 EDGES SUBCOUNT OUTER DIAGONAL
EDGE 12,6,-1,-1,es
EDGE 15,9,-1,-1,es

!45 SEC 13 EDGES SUBCOUNTB INNER DIAGONAL
EDGE 11,1,-1,-1,es
EDGE 12,2,-1,-1,es

!47 SEC 14 EDGES SUBCOUNTB OUTER DIAGONAL
EDGE 17,7,-1,-1,es
EDGE 18,8,-1,-1,es
VECT 0,0,1

!PGONS TOP
PGON 3,0,-1,-1,-11,-7
!PGON 3,0,-1,1,7,11
PGON 3,0,-1,-3,-7,-12
PGON 3,0,-1,2,8,12
PGON 3,0,-1,-4,-8,-13
PGON 3,0,-1,3,9,14
PGON 3,0,-1,-5,-9,-15
PGON 3,0,-1,4,10,15
PGON 3,0,-1,-6,-10,-16

!PGONS 2 BOTTOM
PGON 3,0,-1,-17,-27,-23
PGON 3,0,-1,19,28,23
PGON 3,0,-1,-18,-28,-24
PGON 3,0,-1,20,29,24
PGON 3,0,-1,-19,-30,-25
PGON 3,0,-1,21,31,25
PGON 3,0,-1,-20,-31,-26
PGON 3,0,-1,22,32,26

!PGONS 3 INNER SUBCOUNT
PGON 3,0,-1,27,41,34
PGON 3,0,-1,30,42,35
PGON 3,0,-1,-11,-41,-33
PGON 3,0,-1,-14,-42,-34

!PGONS 4 OUTER SUBCOUNT
PGON 3,0,-1,-29,-37,-43
PGON 3,0,-1,-32,-38,-44
PGON 3,0,-1,13,36,43
PGON 3,0,-1,16,37,44

!PGONS 5 INNER SUBCOUNT
PGON 3,0,-1,-1,-45,-39
PGON 3,0,-1,-2,-46,-36
PGON 3,0,-1,39,18,46
PGON 3,0,-1,33,17,45

!PGONS 6 OUTER SUBCOUNT
PGON 3,0,-1,5,40,47
PGON 3,0,-1,6,38,48
PGON 3,0,-1,-21,-35,-47
PGON 3,0,-1,-22,-40,-48

BODY -1
- AC-24 FIN - WIN 10 - HP Zbook -
“A winner is just a loser who tried one more time.”
George M. Moore, Jr.

Hi Pertti

Thank you for the suggestion, unfortuantely this does not fix it. While it appears correct in 3D it is not solid anymore if you look into the section.
But I think i found the problem: All pgons have the wrong orientation ^^
IMG_20231228_105035.jpg

As a workaround I could move "all the top vertices to the bottom", by changing the order of the vertices which turns the whole thing inside out.

 

 

!EDGESTYLE
es= 0!

VERT 0,0,0
VERT 0,1,0
VERT 0,2,0
 
VERT 1,0,0
VERT 1,1,0
VERT 1,2,0

VERT 2,0,0
VERT 2,1,0
VERT 2,2,0

VERT 0,0,1
VERT 0,1,1
VERT 0,2,1
 
VERT 1,0,1
VERT 1,1,1
VERT 1,2,1

VERT 2,0,1
VERT 2,1,1
VERT 2,2,1


!1 SEC 1 EDGES -> SUBCOUNTB
EDGE 1,2,-1,-1,es
EDGE 2,3,-1,-1,es
EDGE 4,5,-1,-1,es
EDGE 5,6,-1,-1,es
EDGE 7,8,-1,-1,es
EDGE 8,9,-1,-1,es

!7 SEC 2 EDGES -> DIAGONALS
EDGE 2,4,-1,-1,es !1,5
EDGE 3,5,-1,-1,es
EDGE 5,7,-1,-1,es
EDGE 6,8,-1,-1,es

!11 SEC 3 EDGES -> SUBCOUNT
EDGE 4,1,-1,-1,es
EDGE 5,2,-1,-1,es
EDGE 6,3,-1,-1,es
EDGE 7,4,-1,-1,es
EDGE 8,5,-1,-1,es
EDGE 9,6,-1,-1,es

!17 SEC 4 EDGES -> SUBCOUNTB2
EDGE 10,11,-1,-1,es
EDGE 11,12,-1,-1,es
EDGE 13,14,-1,-1,es
EDGE 14,15,-1,-1,es
EDGE 16,17,-1,-1,es
EDGE 17,18,-1,-1,es

!23 SEC 5 EDGES -> DIAGONALS2
EDGE 2+9,4+9,-1,-1,es
EDGE 3+9,5+9,-1,-1,es
EDGE 5+9,7+9,-1,-1,es
EDGE 6+9,8+9,-1,-1,es

!27 SEC 6 EDGES -> SUBCOUNT2
EDGE 4+9,1+9,-1,-1,es
EDGE 5+9,2+9,-1,-1,es
EDGE 6+9,3+9,-1,-1,es
EDGE 7+9,4+9,-1,-1,es
EDGE 8+9,5+9,-1,-1,es
EDGE 9+9,6+9,-1,-1,es

!33 SEC 7 EDGES SUBCOUNT INNER
EDGE 1,10,-1,-1,es
EDGE 4,13,-1,-1,es
EDGE 7,16,-1,-1,es

!36 SEC 8 EDGES SUBCOUNT INNER
EDGE 3,12,-1,-1,es
EDGE 6,15,-1,-1,es
EDGE 9,18,-1,-1,es

!39 SEC 9 EDGES SUBCOUNTB INNER
EDGE 2,11,-1,-1,es

!40 SEC 10 EDGES SUBCOUNTB INNER
EDGE 8,17,-1,-1,es

!41 SEC 11 EDGES SUBCOUNT INNER DIAGONAL
EDGE 10,4,-1,-1,es
EDGE 13,7,-1,-1,es

!43 SEC 12 EDGES SUBCOUNT OUTER DIAGONAL
EDGE 12,6,-1,-1,es
EDGE 15,9,-1,-1,es

!45 SEC 13 EDGES SUBCOUNTB INNER DIAGONAL
EDGE 11,1,-1,-1,es
EDGE 12,2,-1,-1,es

!47 SEC 14 EDGES SUBCOUNTB OUTER DIAGONAL
EDGE 17,7,-1,-1,es
EDGE 18,8,-1,-1,es

VECT 0,0,1

!PGONS TOP
!PGON 3,0,-1,-1,-11,-7
PGON 3,0,-1,1,7,11
PGON 3,0,-1,-3,-7,-12
!PGON 3,0,-1,11,7,-3 !
!PGON 3,0,-1,1,-12,-7 !

PGON 3,0,-1,2,8,12
PGON 3,0,-1,-4,-8,-13
PGON 3,0,-1,3,9,14
PGON 3,0,-1,-5,-9,-15
PGON 3,0,-1,4,10,15
PGON 3,0,-1,-6,-10,-16

!PGONS 2 BOTTOM
PGON 3,0,-1,-17,-27,-23
PGON 3,0,-1,19,28,23
PGON 3,0,-1,-18,-28,-24
PGON 3,0,-1,20,29,24
PGON 3,0,-1,-19,-30,-25
PGON 3,0,-1,21,31,25
PGON 3,0,-1,-20,-31,-26
PGON 3,0,-1,22,32,26

!PGONS 3 INNER SUBCOUNT
PGON 3,0,-1,27,41,34
PGON 3,0,-1,30,42,35
PGON 3,0,-1,-11,-41,-33
PGON 3,0,-1,-14,-42,-34

!PGONS 4 OUTER SUBCOUNT
PGON 3,0,-1,-29,-37,-43
PGON 3,0,-1,-32,-38,-44
PGON 3,0,-1,13,36,43
PGON 3,0,-1,16,37,44

!PGONS 5 INNER SUBCOUNT
PGON 3,0,-1,-1,-45,-39
PGON 3,0,-1,-2,-46,-36
PGON 3,0,-1,39,18,46
PGON 3,0,-1,33,17,45

!PGONS 6 OUTER SUBCOUNT
PGON 3,0,-1,5,40,47
PGON 3,0,-1,6,38,48
PGON 3,0,-1,-21,-35,-47
PGON 3,0,-1,-22,-40,-48

BODY -1

 

 

Now that I knew that it works in the simple version I went back to the scary parametric verison.
And finally managed to fix it for now. In short it didn't like the 3D hotlines in the script before i did all the Primitive base/verts/edges/Pgons/body 😅😂😂
Moved the hotlines to the end of the script:


Screenshot 2023-12-29 012751.png

Solution

@rudl wrote:

And finally managed to fix it for now. In short it didn't like the 3D hotlines in the script before i did all the Primitive base/verts/edges/Pgons/body 😅😂😂
Moved the hotlines to the end of the script.


Oh that's a very good clue, that we hadn't before without the full version of the script.

It makes sense, in a way, if one understands how the deep the underlaying tech is interwoven. A 3D hotline is nothing else but an actual physical line that has it's edge being hidden. It actually contributes to the model like any other element. (At least I think that is what happens here; I was not aware of this either before to that extent. I knew other model elements like "prism"s and so on do, tho.)

 

It's generally a good idea to start off building primitives with a BASE command, this will restart the indizes at 0, and also end primitives with a BODY -1.

If you would try that I guess the hotlines could be moved back to the beginning, becaues I think the appearance of them without BASE made them "part" of your ramp.

Lucas Becker | AC 27 on Mac | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text |
«Furthermore, I consider that Carth... yearly releases must be destroyed»
Solution
@runxel wrote:
Oh that's a very good clue, that we hadn't before without the full version of the script.

It makes sense, in a way, if one understands how the deep the underlaying tech is interwoven. A 3D hotline is nothing else but an actual physical line that has it's edge being hidden. It actually contributes to the model like any other element. (At least I think that is what happens here; I was not aware of this either before to that extent. I knew other model elements like "prism"s and so on do, tho.)

I guess it does make sense 👍
I kind of figured after converting it into  a morph, which was also not solid, but after collapsing the hotlines it suddenly did turn solid.

 

@runxel wrote:

It's generally a good idea to start off building primitives with a BASE command, this will restart the indizes at 0, and also end primitives with a BODY -1.

If you would try that I guess the hotlines could be moved back to the beginning, becaues I think the appearance of them without BASE made them "part" of your ramp.


There was a BASE command between the  Hotlines (HOTLINE and LIN_ line to be accurate), and the primitive, seems like they really have to be after the body