2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations
2020-10-02 02:42 PM - last edited on 2021-09-15 09:44 AM by Noemi Balogh
2020-10-06 04:33 PM
2020-10-06 04:57 PM
HOTSPOT2 0, 0 FILL MyFill mul2 1, lTopHeight mul2 lRightWidth, 1 poly2_b{5} 5, 3, 1, 3, MyFillPen, MyFillBgdPen, 0, 0, 1, 0, 0, 1, 0, 0, 0.5, 32, 0, 0, 32, 0.5, 0, 33, 0, 0, 900, 0, 90, 4032 del 1 mul2 lLeftWidth, 1 poly2_b{5} 5, 3, 1, 3, MyFillPen, MyFillBgdPen, 0, 0, 1, 0, 0, 1, 0, -0.5, 0, 32, 0, 0, 32, 0, 0.5, 33, 0, 0, 900, 0, 90, 4032 del 1 del 1 mul2 1, lBottomHeight mul2 lRightWidth, 1 poly2_b{5} 5, 3, 1, 3, MyFillPen, MyFillBgdPen, 0, 0, 1, 0, 0, 1, 0, 0, -0.5, 32, 0, 0, 32, 0.5, 0, 33, 0, 0, 900, 0, -90, 4032 del 1 mul2 lLeftWidth, 1 poly2_b{5} 5, 3, 1, 3, MyFillPen, MyFillBgdPen, 0, 0, 1, 0, 0, 1, 0, -0.5, 0, 32, 0, 0, 32, 0, -0.5, 33, 0, 0, 900, 0, -90, 4032 del 1 del 1
2020-10-06 05:23 PM
2020-10-08 10:41 AM
RESOL 32 !Curve Resolution (Number of Segments) lRightWidth = 1.0 lLeftWidth = 1.5 lTopHeight = 2.0 lBottomHeight = 2.5 HOTSPOT2 0, 0 HOTSPOT2 0, lTopHeight HOTSPOT2 -lLeftWidth, 0 HOTSPOT2 lRightWidth, 0 HOTSPOT2 0, -lBottomHeight FILL MyFill mul2 1, lTopHeight mul2 lRightWidth, 1 poly2_b{5} 5, 3, 1, 3, MyFillPen, MyFillBgdPen, 0, 0, 1, 0, 0, 1, 0, 0, 1, 32, 0, 0, 32, 1, 0, 33, 0, 0, 900, 0, 90, 4032 del 1 mul2 lLeftWidth, 1 poly2_b{5} 5, 3, 1, 3, MyFillPen, MyFillBgdPen, 0, 0, 1, 0, 0, 1, 0, -1, 0, 32, 0, 0, 32, 0, 1, 33, 0, 0, 900, 0, 90, 4032 del 1 del 1 mul2 1, lBottomHeight mul2 lRightWidth, 1 poly2_b{5} 5, 3, 1, 3, MyFillPen, MyFillBgdPen, 0, 0, 1, 0, 0, 1, 0, 0, -1, 32, 0, 0, 32, 1, 0, 33, 0, 0, 900, 0, -90, 4032 del 1 mul2 lLeftWidth, 1 poly2_b{5} 5, 3, 1, 3, MyFillPen, MyFillBgdPen, 0, 0, 1, 0, 0, 1, 0, -1, 0, 32, 0, 0, 32, 0, -1, 33, 0, 0, 900, 0, -90, 4032 del 1 del 1
2020-10-09 05:41 AM
hotspot2 0,0 hotspot2 a, 0 hotspot2 a, b !! to be able to drag it with the mouse like editable hotspots dim contpoints[][] !! making the koordinate-Variables for each step-point angle = 360/steps add2 a/2, b/2 !! to get it in the middle for i = 1 to steps contpoints[1] = cos(angle*i)*a/2 !! calculates each shape-point-coordinate contpoints[2] = sin(angle*i)*b/2 ! circle2 contpoints[1], contpoints[2], 0.02 !!! just marking hotspot2 contpoints[1], contpoints[2] next i !! now having the coordinates a second time around for the lining line2 a/2, 0, contpoints[1][1], contpoints[1][2] !! first line extra.. for i = 1 to steps-1 line2 contpoints[1], contpoints[2], contpoints[i+1][1], contpoints[i+1][2] next i
2020-12-10 12:41 PM
2020-12-10 10:52 PM
for n = 0 to 360 step 360/gs_resol put xPOS +wEllipse*cos(n), yPOS +hEllipse*sin(n), 1 next n poly2_b nsp/3, 1+2+4, gs_fill_pen, gs_back_pen, get(nsp)The resolution should depend on the use; if is a small element like plumbing then a resolution of 12 is enough but if its a large design element the you may want to bump the resolution up to around 36, or 72 at most. You should make the resolution accessible in MVO's so it dynamically responds to specific outputs.
2020-12-11 01:46 PM
Kristian wrote:Thanks so much for the quick reply!
Of course you can make any shape and have it parametric in GDL! that's why its so much fun.
Just use simple math to chart the points like this:
you need 3 parameters:
hEllipse = height
wEllipse = width
gs_resol = resolution
you may also want to set the origin as parametric in which case you will need the coordinates:
xPOS = x position
yPOS = y position
for n = 0 to 360 step 360/gs_resol put xPOS +wEllipse*cos(n), yPOS +hEllipse*sin(n), 1 next n poly2_b nsp/3, 1+2+4, gs_fill_pen, gs_back_pen, get(nsp)The resolution should depend on the use; if is a small element like plumbing then a resolution of 12 is enough but if its a large design element the you may want to bump the resolution up to around 36, or 72 at most. You should make the resolution accessible in MVO's so it dynamically responds to specific outputs.
Gs_resol = 72 for n = 0 to 90 step 360/gs_resol put A-RA +RA*cos(n), B-RB +RB*sin(n), 1 next n Poly2_B 8+NSP/3, 7,19,19, RA , 0 , 1, A-RA , 0 , 1, A , RB , 1, A , B-RB , 1, get(NSP), A-RA , B , 1, RA , B , 1, 0 , B-RB , 1, 0 , RB , 1
2020-12-11 03:02 PM
Arnaut2604 wrote:There is only "one" NSP
How can I get more than one NSP into a Poly?
2020-12-11 05:00 PM
values "ra" range[0, a/2] values "rb" range[0, a/b]2D script
EPS=0.0001 Gs_resol = 72 st=1 if RA > EPS AND RB > EPS then put RA, 0, ST, !south line A-RA, 0, ST gosub "SE" !south-east corner put A, RB, ST, !east line A, B-RB, ST gosub "NE" !north-east corner put A-RA, B, ST, !north line RA, B, ST gosub "NW" !north-west corner put 0, B-RB, ST, !west line 0, RB, ST gosub "SW" !south-west corner else put 0, 0, ST, A, 0, ST, A, B, ST, 0, B, ST, 0, 0, -1 endif Poly2_B NSP/3, 7,19,19, get(nsp) END !__________________________END____________________ "SE": for n = 270 to 360 step 360/gs_resol put A-RA + RA*cos(n), RB + RB*sin(n), st next n return "NE": for n = 0 to 90 step 360/gs_resol put A-RA + RA*cos(n), B-RB + RB*sin(n), st next n return "NW": for n = 90 to 180 step 360/gs_resol put RA + RA*cos(n), B-RB + RB*sin(n), st next n return "SW": for n = 180 to 270 step 360/gs_resol put RA + RA*cos(n), RB + RB*sin(n), st next n returnEdit: you must create parameters RA and RB