cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
genarch
Advocate

GDL: POLY2 Example with Arc?

Could someone please provide working GDL code for a POLY2 command that gives a half circle? I just can't figure out the correct syntax for the POLY2 commands and it's driving me crazy!
MacOS Sonoma

AC28, Artlantis 2020, TwinMotion

Mac Studio M2 Max 2024
6 Replies 6
Anonymous
Not applicable
Acording the GDL manual, POLY2 does not implement
additional status codes but POLY2_ does unless you have
a resol statement earlier in the script set to eight or less.
Peter Devlin
genarch
Advocate
Okay, you got me on semantics... in any case, I'll just answer my own post:

FILL circ_fill ! fill setting
POLY2_ 6, 3,
0,0,1, ! node
-bcirc,0,1, ! node
1,90,800, ! set tangent (see Additional Status Codes)
bcirc,-180,2000, ! tangential arc by radius and angle
bcirc,0,1, ! node
0,0,1 ! repeat first node

Where "bcirc" is a dimension defined in the parameters. The result of the POLY2_ above give a half circle fill of radius "bcirc".
MacOS Sonoma

AC28, Artlantis 2020, TwinMotion

Mac Studio M2 Max 2024
Anonymous
Not applicable
Your example:

FILL circ_fill
POLY2_ 6, 3,
0,0,15,
-bcirc,0,15,
0,90,815,
bcirc,-180,2015,
bcirc,0,15,
0,0,-1

another example

FILL circ_fill
POLY2_ 4,3,
bcirc,0,15,
0,0,915,
bcirc,180,4015,
bcirc,0,-1

CU mirco
Frank Beister
Moderator
Or you can use this one:

FILL circ_fill
POLY2_ 3,1+2+4,
bcirc,0,1,
0,1,801,
-bcirc,0,1001

In your examples, you have used 15 for the status-values. This works, but is normally used for 3D-commands. In 2D status is defined with 0 or 1, what you should use.

To use a 4 in the mask (1+2+4) makes the last point superfluously.

@genarch
In your working example is the tangent IMHO not proper done, because it shouldn't have an x component. You have some needless points too.
It works proper like this:

POLY2_ 3, 1+2+4,
-bcirc,0,1,
0,1,801,
bcirc,-180,2001

And last possibility is

POLY2_ 3, 1+2+4,
-bcirc,0,1,
0,0,901,
bcirc,0,3001
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
... und im Übrigen bin ich der Meinung, dass Trockenbauwände einschichtig zu modellieren sind.
Anonymous
Not applicable
In your examples, you have used 15 for the status-values. This works, but is normally used for 3D-commands. In 2D status is defined with 0 or 1, what you should use.
I know Frank but ....

what seems an error can become an advantage.

Put bcirc,0,15,
0,0,915,
bcirc,180,4015,
bcirc,0,-1

FILL circ_fill

POLY2_ nsp/3,3,
use (nsp)

PRISM_ nsp/3, ZZYZX,
get(nsp)

CU mirco
Frank Beister
Moderator
That's right, but you set unused bits of the status, which might become in coming GDL-Versions a meaning. Maybe such old objects will not work proper anymore. It might be conservative, but I try to use the exact syntax.


I try to solve it like this:


IF GLOB_CONTEXT=2 THEN msk=1 ELSE msk=15

PUT bcirc,0,msk,
0,0,900+msk,
bcirc,180,4000+msk,
bcirc,0,-1
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm
... und im Übrigen bin ich der Meinung, dass Trockenbauwände einschichtig zu modellieren sind.

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!