Wednesday
- last edited
Saturday
by
Laszlo Nagy
Hi everyone, I’m still learning GDL and wrote a simple script to create two triangular polygons using the pgon command. For some reason, it keeps throwing an error and I can’t figure out why. Any help would be much appreciated. Thanks!
vert 0.00, 0.00, 0.00 ! 01
vert 1.00, 0.00, 0.00 ! 02
vert 1.00, 1.00, 0.00 ! 03
vert 0.00, 1.00, 0.00 ! 04
edge 1, 2, 1, 0, 0 ! 01
edge 2, 3, 1, 0, 0 ! 02
edge 3, 1, 1, 2, 0 ! 03
edge 3, 4, 1, 0, 0 ! 04
edge 4, 1, 1, 0, 0 ! 05
vect 0, 0, 1
vect 0, 0, 1
pgon 3, 1, 0, 1, 2, 3
pgon 3, 2, 0, 4, 5, -3
Operating system used: Mac Intel-based
Thursday - last edited Thursday
I have not tried using pgons, but does it work without the the vert 4 points?
AC22-28 AUS 3110 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win11 | R5 2600 | 16GB | GTX1660 |
Thursday
No, it’s not possible. The points must be defined first before the edges can be determined.
Friday
I mean if you defined a single triangle rather than two with a common edge.
AC22-28 AUS 3110 | Help Those Help You - Add a Signature |
Self-taught, bend it till it breaks | Creating a Thread |
Win11 | i9 10850K | 64GB | RX6600 | Win11 | R5 2600 | 16GB | GTX1660 |
Monday - last edited Monday
Hi @RhinoX ,
It seems that the issue is coming from the definition of pgon1 (the 3rd argument) in edge 04 (line 31)
I'm not familiar with primitive elements but from my understanding, arguments pgon1 and pgon2 are the indices of the polygons they refer to. Edges 04 and 05 are edges of the second polygon so pgon1 should be 2 I think.
It you do this, does it work ?
edge 3, 4, 2, 0, 0 ! 04
edge 4, 1, 2, 0, 0 ! 05