cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

The 2025 Technology Preview Program is now live. Join today!

GDL
About building parametric objects with GDL.

GDL Pgon code issue

RhinoX
Booster

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!

 

RhinoX_0-1756910643793.pngRhinoX_1-1756910668223.png

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

RhinoX_2-1756910845678.png

 

Operating system used: Mac Intel-based

4 REPLIES 4
Lingwisyer
Guru

I have not tried using pgons, but does it work without the the vert 4 points?

AC22-28 AUS 3110Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win11 | R5 2600 | 16GB | GTX1660

No, it’s not possible. The points must be defined first before the edges can be determined.

I mean if you defined a single triangle rather than two with a common edge.

AC22-28 AUS 3110Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win11 | R5 2600 | 16GB | GTX1660
MF BIM
Enthusiast

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.

 

RhinoX_0-1756910643793.png

 

It you do this, does it work ?

edge 3, 4, 2, 0, 0 ! 04
edge 4, 1, 2, 0, 0 ! 05

https://mfbim.fr | https://youtube.com/@mfbim | My GDL course on Udemy, try it !
AC24 FRA 7600 - AC26 FRA 4027 | MacBook M1 Pro

Setup info provided by author