<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Can I script a parametric ellipsoidal shape? in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285928#M3704</link>
    <description>&lt;BLOCKQUOTE&gt;Arnaut2604 wrote:&lt;BR /&gt;
How can I get more than one NSP into a Poly?
&lt;/BLOCKQUOTE&gt;

There is only "one" NSP &lt;E&gt;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/E&gt;&lt;BR /&gt;
NSP is a special type of global parameter/variable which holds the number of values on the stack.&lt;BR /&gt;
So just `put` everything you need onto the buffer and retrieve it with `get()`.&lt;BR /&gt;
"Get" empties the buffer while reading its elements, while "use" will leave the values alone and just read them.&lt;BR /&gt;
&lt;BR /&gt;
By the way: You can use as many "put" operations as you want. They always append.&lt;BR /&gt;
The stack in GDL is first-in-first-out.</description>
    <pubDate>Fri, 11 Dec 2020 14:02:08 GMT</pubDate>
    <dc:creator>runxel</dc:creator>
    <dc:date>2020-12-11T14:02:08Z</dc:date>
    <item>
      <title>Can I script a parametric ellipsoidal shape?</title>
      <link>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285910#M3686</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I've attached an image and I was wondering how to do it. Firstly, is this achievable?&lt;BR /&gt;The idea is basically to create a rounded shape but allow these dimensions to be added in to create it.&lt;BR /&gt;&lt;BR /&gt;Any help would be much appreciated.&lt;BR /&gt;Thanks&lt;/DIV&gt;</description>
      <pubDate>Wed, 15 Sep 2021 07:44:14 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285910#M3686</guid>
      <dc:creator>JGoode</dc:creator>
      <dc:date>2021-09-15T07:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create this...?</title>
      <link>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285911#M3687</link>
      <description>&lt;BLOCKQUOTE&gt;JGoode wrote:&lt;BR /&gt;CAN I CREATE THIS...?&lt;/BLOCKQUOTE&gt;
I presume, by the fact that you can enter different dimensions on each parameter, that your circle could end being a double eccentric ellipse, right?&lt;BR /&gt;
Could you elaborate on what the object is for?</description>
      <pubDate>Sat, 03 Oct 2020 10:33:22 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285911#M3687</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-03T10:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create this...?</title>
      <link>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285912#M3688</link>
      <description>If you want to put in the dimensions in the floor plan, this is only possible with moveable Hotpots, which also have a numerical input field; but I think these input fields are not placed in the center and are only visible when you click on the hotspot.</description>
      <pubDate>Sat, 03 Oct 2020 11:20:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285912#M3688</guid>
      <dc:creator>Jochen Suehlo</dc:creator>
      <dc:date>2020-10-03T11:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create this...?</title>
      <link>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285913#M3689</link>
      <description>Absolutely right Joachim.&lt;BR /&gt;
I didn't get the parameter direct input value part.&lt;BR /&gt;
It looks like some Revit user wish. Right JGoode?  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_wink.gif" style="display : inline;" /&gt;</description>
      <pubDate>Sat, 03 Oct 2020 11:34:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285913#M3689</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-03T11:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create this...?</title>
      <link>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285914#M3690</link>
      <description>Sorry, the dimensions would be entered on the interface and I'd potentially have dynamic hotspots at the top, bottom and sides of the 'circle' that would end up not being a circle. The use of this would be for our tree object where in plan they can be a funny shape and therefore we want to reflect that and have a bit more control instead of a just a circle!  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_biggrin.gif" style="display : inline;" /&gt; &lt;BR /&gt;
&lt;BR /&gt;
The query was more so about creating the shape than it was inputting the dimensions!&lt;BR /&gt;
&lt;BR /&gt;
I hope this makes a little more sense now, I was a little unsure as to how to explain it to begin with! &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_biggrin.gif" style="display : inline;" /&gt;&lt;BR /&gt;
&lt;BR /&gt;
Braza, to answer you question... I am not a Revit user! &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_biggrin.gif" style="display : inline;" /&gt; Just trying to figure out if ArchiCAD has the functionality in GDL to do something a little more outside the box.</description>
      <pubDate>Mon, 05 Oct 2020 13:21:56 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285914#M3690</guid>
      <dc:creator>JGoode</dc:creator>
      <dc:date>2020-10-05T13:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create this...?</title>
      <link>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285915#M3691</link>
      <description>&lt;BLOCKQUOTE&gt;JGoode wrote:&lt;BR /&gt;Braza, to answer you question... I am not a Revit user!  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_biggrin.gif" style="display : inline;" /&gt;  &lt;/BLOCKQUOTE&gt;
Congratulations! This is a good start.  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_biggrin.gif" style="display : inline;" /&gt;&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;JGoode wrote:&lt;BR /&gt;Sorry, the dimensions would be entered on the interface&lt;/BLOCKQUOTE&gt;
Do you mean the User Interface inside Object Settings?&lt;BR /&gt;
If so... This is perfectly doable.</description>
      <pubDate>Mon, 05 Oct 2020 14:27:06 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285915#M3691</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-05T14:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create this...?</title>
      <link>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285916#M3692</link>
      <description>I did mean that but I'm very happy with creating the User Interface but it's the creating the actual geometry I'm struggling with as I want it to be a continuous arc rather than a point like a regular prism with curved sides would create. Does this make sense?</description>
      <pubDate>Mon, 05 Oct 2020 15:32:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285916#M3692</guid>
      <dc:creator>JGoode</dc:creator>
      <dc:date>2020-10-05T15:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: Can I script a parametric ellipsoidal shape?</title>
      <link>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285917#M3693</link>
      <description>Try this in your 2d script.&lt;BR /&gt;

&lt;PRE&gt;HOTSPOT2 0, 0
mul2 lRightWidth, 1
ARC2 0, 0, 0.5, -90, 90
del 1

mul2 lLeftWidth, 1
ARC2 0, 0, 0.5, 90, 270
del 1&lt;/PRE&gt;

Hope this helps.</description>
      <pubDate>Mon, 05 Oct 2020 18:31:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285917#M3693</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-05T18:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can I script a parametric ellipsoidal shape?</title>
      <link>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285918#M3694</link>
      <description>Ok.  Forgot to add the Height parameters.  Here it is:&lt;BR /&gt;

&lt;PRE&gt;HOTSPOT2 0, 0

mul2 1, lTopHeight
mul2 lRightWidth, 1
ARC2 0, 0, 0.5, 0, 90
del 1

mul2 lLeftWidth, 1
ARC2 0, 0, 0.5, 90, 180
del 1
del 1

mul2 1, lBottomHeight
mul2 lRightWidth, 1
ARC2 0, 0, 0.5, 270, 360
del 1

mul2 lLeftWidth, 1
ARC2 0, 0, 0.5, 180, 270
del 1
del 1&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Oct 2020 18:42:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285918#M3694</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-05T18:42:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can I script a parametric ellipsoidal shape?</title>
      <link>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285919#M3695</link>
      <description>Oh, that's brilliant! Thank you so much!&lt;BR /&gt;
&lt;BR /&gt;
Here's another step that I'm really not so confident about, is there anyway to create that with a fill?&lt;BR /&gt;
&lt;BR /&gt;
Many thanks,</description>
      <pubDate>Tue, 06 Oct 2020 12:06:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285919#M3695</guid>
      <dc:creator>JGoode</dc:creator>
      <dc:date>2020-10-06T12:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Can I script a parametric ellipsoidal shape?</title>
      <link>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285920#M3696</link>
      <description>Yes, use &lt;A href="http://gdl.graphisoft.com/reference-guide/drawing-elements#POLY2__gdlcommand" target="_blank"&gt;poly2_&lt;/A&gt; with &lt;A href="http://gdl.graphisoft.com/reference-guide/additional-status-codes" target="_blank"&gt;additional status codes&lt;/A&gt;.</description>
      <pubDate>Tue, 06 Oct 2020 14:33:40 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285920#M3696</guid>
      <dc:creator>Peter Baksa</dc:creator>
      <dc:date>2020-10-06T14:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: Can I script a parametric ellipsoidal shape?</title>
      <link>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285921#M3697</link>
      <description>Exactly Peter.&lt;BR /&gt;
Here it is:
&lt;PRE&gt;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&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Oct 2020 14:57:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285921#M3697</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-06T14:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: Can I script a parametric ellipsoidal shape?</title>
      <link>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285922#M3698</link>
      <description>It is also important to set the proper &lt;A href="http://gdl.graphisoft.com/reference-guide/directives" target="_blank"&gt;RESOL or TOLER&lt;/A&gt;, the ellipsoid arcs will be approximated with straight segments.</description>
      <pubDate>Tue, 06 Oct 2020 15:23:33 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285922#M3698</guid>
      <dc:creator>Peter Baksa</dc:creator>
      <dc:date>2020-10-06T15:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: Can I script a parametric ellipsoidal shape?</title>
      <link>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285923#M3699</link>
      <description>Ok.  I posted the code without testing it.  The dimensions were set for diameters.  Here is the correct code with more HOTSPOTS and a proper RESOL command, well pointed by Peter.&lt;BR /&gt;
Cheers,&lt;BR /&gt;

&lt;PRE&gt;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

&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Oct 2020 08:41:59 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285923#M3699</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-08T08:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Can I script a parametric ellipsoidal shape?</title>
      <link>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285924#M3700</link>
      <description>The other Way around - Maybe you get some ideas by downloading (draw it into Archicad)  my GDL from bimcomponents and look at the code?&lt;BR /&gt;
&lt;BR /&gt;
Its not an elliptical shape, but its for the building-site to be able to construct elliptical shapes there with the most simple method form the 2 centerpoints of an ellipse.  &lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="https://bimcomponents.com/GSM/Details/20917" target="_blank"&gt;&lt;/A&gt;&lt;S&gt;&lt;A href="https://bimcomponents.com/GSM/Details/20917" target="_blank"&gt;&lt;/A&gt;&lt;A href="&amp;lt;/s&amp;gt;https://bimcomponents.com/GSM/Details/20917&amp;lt;e&amp;gt;"&gt;&lt;/A&gt;&lt;/S&gt;https://bimcomponents.com/GSM/Details/20917&lt;E&gt;&lt;/E&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Direct elliptical shapes without muly:&lt;BR /&gt;
&lt;BR /&gt;
Mathematical - you can get a circle by angle, sin and cos.&lt;BR /&gt;
To "bend" it in y, just an an factor to y&lt;BR /&gt;
&lt;BR /&gt;
little example: You need parameter "Steps" with an ammount of about 30 to get good visual results&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;
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&lt;I&gt;[1] = cos(angle*i)*a/2  !! calculates each shape-point-coordinate
		contpoints&lt;I&gt;[2] = sin(angle*i)*b/2

		!  circle2 contpoints&lt;I&gt;[1], contpoints&lt;I&gt;[2], 0.02  !!! just marking
		hotspot2 contpoints&lt;I&gt;[1], contpoints&lt;I&gt;[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&lt;I&gt;[1], contpoints&lt;I&gt;[2], contpoints[i+1][1], contpoints[i+1][2]

next i


&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Oct 2020 03:41:17 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285924#M3700</guid>
      <dc:creator>Hmooslechner</dc:creator>
      <dc:date>2020-10-09T03:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Can I script a parametric ellipsoidal shape?</title>
      <link>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285925#M3701</link>
      <description>Is it possible to get an ellipsoidal curve without using mul?&lt;BR /&gt;
&lt;BR /&gt;
On example 1 on the Additional Status Codes site is a ellipsodial curve but I can't seem to fathom how it works.&lt;BR /&gt;
Through deleting lines and seeing what happens I've figured out that is has something to do with status code 2000&lt;BR /&gt;
&lt;A href="https://gdl.graphisoft.com/reference-guide/additional-status-codes" target="_blank"&gt;&lt;LINK_TEXT text="https://gdl.graphisoft.com/reference-gu ... atus-codes"&gt;https://gdl.graphisoft.com/reference-guide/additional-status-codes&lt;/LINK_TEXT&gt;&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
The reason why I'm asking is because I'm trying to programm a basin with Rounded corners with the ability to adjust the point where it begins to round off. And that for each side&lt;BR /&gt;
&lt;BR /&gt;
I'm lost  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_eek.gif" style="display : inline;" /&gt; &lt;BR /&gt;
&lt;BR /&gt;
Something like this:&lt;BR /&gt;
					RA			, 0			, ST,&lt;BR /&gt;
					A-RA		, 0			, ST,&lt;BR /&gt;
					A			, RB		        , ST,&lt;BR /&gt;
					A			, B-RB		, ST,&lt;BR /&gt;
					A-RA		, B			, ST,&lt;BR /&gt;
					RA			, B			, ST,&lt;BR /&gt;
					0			, B-RB		, ST,&lt;BR /&gt;
					0			, RB		        , ST&lt;BR /&gt;
&lt;BR /&gt;
Any Suggestions?  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_idea.gif" style="display : inline;" /&gt;</description>
      <pubDate>Thu, 10 Dec 2020 11:41:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285925#M3701</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-12-10T11:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Can I script a parametric ellipsoidal shape?</title>
      <link>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285926#M3702</link>
      <description>Of course you can make any shape and have it parametric in GDL! that's why its so much fun.&lt;BR /&gt;
Just use simple math to chart the points like this:&lt;BR /&gt;
&lt;BR /&gt;
you need 3 parameters:&lt;BR /&gt;
hEllipse = height&lt;BR /&gt;
wEllipse = width&lt;BR /&gt;
gs_resol = resolution&lt;BR /&gt;
you may also want to set the origin as parametric in which case you will need the coordinates:&lt;BR /&gt;
xPOS = x position&lt;BR /&gt;
yPOS = y position&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;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)
&lt;/PRE&gt;

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.</description>
      <pubDate>Thu, 10 Dec 2020 21:52:08 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285926#M3702</guid>
      <dc:creator>Kristian Bursell</dc:creator>
      <dc:date>2020-12-10T21:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can I script a parametric ellipsoidal shape?</title>
      <link>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285927#M3703</link>
      <description>&lt;BLOCKQUOTE&gt;Kristian wrote:&lt;BR /&gt;
Of course you can make any shape and have it parametric in GDL! that's why its so much fun.&lt;BR /&gt;
Just use simple math to chart the points like this:&lt;BR /&gt;
&lt;BR /&gt;
you need 3 parameters:&lt;BR /&gt;
hEllipse = height&lt;BR /&gt;
wEllipse = width&lt;BR /&gt;
gs_resol = resolution&lt;BR /&gt;
you may also want to set the origin as parametric in which case you will need the coordinates:&lt;BR /&gt;
xPOS = x position&lt;BR /&gt;
yPOS = y position&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;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)
&lt;/PRE&gt;

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.
&lt;/BLOCKQUOTE&gt;

Thanks so much for the quick reply!&lt;BR /&gt;
&lt;BR /&gt;
How can I get more than one NSP into a Poly?&lt;BR /&gt;
&lt;BR /&gt;
Because at the end I want to use it in 3d with hprism_ So I need to get all 4 corners in one script.&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;
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

&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Dec 2020 12:46:18 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285927#M3703</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-12-11T12:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can I script a parametric ellipsoidal shape?</title>
      <link>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285928#M3704</link>
      <description>&lt;BLOCKQUOTE&gt;Arnaut2604 wrote:&lt;BR /&gt;
How can I get more than one NSP into a Poly?
&lt;/BLOCKQUOTE&gt;

There is only "one" NSP &lt;E&gt;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/E&gt;&lt;BR /&gt;
NSP is a special type of global parameter/variable which holds the number of values on the stack.&lt;BR /&gt;
So just `put` everything you need onto the buffer and retrieve it with `get()`.&lt;BR /&gt;
"Get" empties the buffer while reading its elements, while "use" will leave the values alone and just read them.&lt;BR /&gt;
&lt;BR /&gt;
By the way: You can use as many "put" operations as you want. They always append.&lt;BR /&gt;
The stack in GDL is first-in-first-out.</description>
      <pubDate>Fri, 11 Dec 2020 14:02:08 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285928#M3704</guid>
      <dc:creator>runxel</dc:creator>
      <dc:date>2020-12-11T14:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can I script a parametric ellipsoidal shape?</title>
      <link>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285929#M3705</link>
      <description>that should work&lt;BR /&gt;
&lt;BR /&gt;
PARAMETER script
&lt;PRE&gt;values "ra" range[0, a/2]
values "rb" range[0, a/b]&lt;/PRE&gt;

2D script
&lt;PRE&gt;EPS=0.0001
Gs_resol = 72
st=1
if RA &amp;gt; EPS AND RB &amp;gt; 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
return
&lt;/PRE&gt;

Edit: you must create parameters RA and RB</description>
      <pubDate>Fri, 11 Dec 2020 16:00:31 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Can-I-script-a-parametric-ellipsoidal-shape/m-p/285929#M3705</guid>
      <dc:creator>A_ Smith</dc:creator>
      <dc:date>2020-12-11T16:00:31Z</dc:date>
    </item>
  </channel>
</rss>

