<?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: Adjustable hotspot - set boundaries to Ellipse &amp;amp; Circle in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Adjustable-hotspot-set-boundaries-to-Ellipse-amp-Circle/m-p/230886#M4404</link>
    <description>Point on a circle is:&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;x^2 + y^2 = r^2&lt;/PRE&gt;

&lt;BR /&gt;
Point on an eclipse is:&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;x^2 / ( x_max )^2 + y^2 / ( y_max )^2 = 1&lt;/PRE&gt;

&lt;BR /&gt;
Where x_max and y_max are the extremities of your eclipse.&lt;BR /&gt;
&lt;BR /&gt;
If  x_max = y_max then you have a circle and the equation is the same as the first one here.&lt;BR /&gt;
&lt;BR /&gt;
Following that:&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;IF x^2 / ( x_max )^2 + y^2 / ( y_max )^2 # 1 then			!false return equation of an eclipse
theta = arctan ( y / x )							!angle of selected points
r = ( a.b ) / ( sqr ( a^2 . ( cos ( theta ))^2 +  b^2 . ( sin ( theta ))^2 ))	!radius at any given point
x = r . cos ( theta )							!x point of ecplise with given angle
y = r . sin ( theta )							!y point of ecplise with given angle
endIF&lt;/PRE&gt;

&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ling.</description>
    <pubDate>Wed, 25 Mar 2020 01:48:58 GMT</pubDate>
    <dc:creator>Lingwisyer</dc:creator>
    <dc:date>2020-03-25T01:48:58Z</dc:date>
    <item>
      <title>Adjustable hotspot - set boundaries to Ellipse &amp; Circle</title>
      <link>https://community.graphisoft.com/t5/GDL/Adjustable-hotspot-set-boundaries-to-Ellipse-amp-Circle/m-p/230885#M4403</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I have an object that uses 0, 0 as the centre point (so the 4 maximum points are -a/2, a/2, b/2, -b/2).&lt;BR /&gt;&lt;BR /&gt;I have a node that I don't want to be able to move outside of my ellipse / circle (Think tree trunk moving under a canopy, wouldn't be able to put the trunk outside of the canopy &lt;IMG style="display: inline;" src="https://community.graphisoft.com/legacyfs/online/emojis/icon_lol.gif" border="0" /&gt; ). I don't know if anyone has had to do this so has the code / calculations to hand? or if there's an Archicad object that can do this?&lt;BR /&gt;&lt;BR /&gt;Any help is much appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/DIV&gt;</description>
      <pubDate>Mon, 26 Sep 2022 20:52:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Adjustable-hotspot-set-boundaries-to-Ellipse-amp-Circle/m-p/230885#M4403</guid>
      <dc:creator>JGoode</dc:creator>
      <dc:date>2022-09-26T20:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Adjustable hotspot - set boundaries to Ellipse &amp; Circle</title>
      <link>https://community.graphisoft.com/t5/GDL/Adjustable-hotspot-set-boundaries-to-Ellipse-amp-Circle/m-p/230886#M4404</link>
      <description>Point on a circle is:&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;x^2 + y^2 = r^2&lt;/PRE&gt;

&lt;BR /&gt;
Point on an eclipse is:&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;x^2 / ( x_max )^2 + y^2 / ( y_max )^2 = 1&lt;/PRE&gt;

&lt;BR /&gt;
Where x_max and y_max are the extremities of your eclipse.&lt;BR /&gt;
&lt;BR /&gt;
If  x_max = y_max then you have a circle and the equation is the same as the first one here.&lt;BR /&gt;
&lt;BR /&gt;
Following that:&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;IF x^2 / ( x_max )^2 + y^2 / ( y_max )^2 # 1 then			!false return equation of an eclipse
theta = arctan ( y / x )							!angle of selected points
r = ( a.b ) / ( sqr ( a^2 . ( cos ( theta ))^2 +  b^2 . ( sin ( theta ))^2 ))	!radius at any given point
x = r . cos ( theta )							!x point of ecplise with given angle
y = r . sin ( theta )							!y point of ecplise with given angle
endIF&lt;/PRE&gt;

&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ling.</description>
      <pubDate>Wed, 25 Mar 2020 01:48:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Adjustable-hotspot-set-boundaries-to-Ellipse-amp-Circle/m-p/230886#M4404</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2020-03-25T01:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Adjustable hotspot - set boundaries to Ellipse &amp; Circle</title>
      <link>https://community.graphisoft.com/t5/GDL/Adjustable-hotspot-set-boundaries-to-Ellipse-amp-Circle/m-p/230887#M4405</link>
      <description>Thanks so much for your reply. I think I follow... is x_max equivalent to my A/2?&lt;BR /&gt;
&lt;BR /&gt;
How would I then implement this into
&lt;PRE&gt;values "pos_x" range [ , ]
values "pos_y" range [ , ]&lt;/PRE&gt;
lines? That's where I'm really struggling with it.&lt;BR /&gt;
&lt;BR /&gt;
Many thanks again</description>
      <pubDate>Wed, 25 Mar 2020 10:21:42 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Adjustable-hotspot-set-boundaries-to-Ellipse-amp-Circle/m-p/230887#M4405</guid>
      <dc:creator>JGoode</dc:creator>
      <dc:date>2020-03-25T10:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Adjustable hotspot - set boundaries to Ellipse &amp; Circle</title>
      <link>https://community.graphisoft.com/t5/GDL/Adjustable-hotspot-set-boundaries-to-Ellipse-amp-Circle/m-p/230888#M4406</link>
      <description>I missed a line in my original post:&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;r = ( a.b ) / ( sqr ( a^2 . ( cos ( theta ))^2 +  b^2 . ( sin ( theta ))^2 ))
&lt;/PRE&gt;

&lt;BR /&gt;
And substitute &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;arctan&lt;E&gt;&lt;/E&gt; for &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;atn&lt;E&gt;&lt;/E&gt;.&lt;BR /&gt;
&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;JGoode wrote:&lt;BR /&gt;
Thanks so much for your reply. I think I follow... is x_max equivalent to my A/2?&lt;/BLOCKQUOTE&gt;

&lt;BR /&gt;
If A.B is the bounding box of your eclipse, then x_max . y_max is indeed your A/2 . B/2&lt;BR /&gt;
&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;JGoode wrote:&lt;BR /&gt;
How would I then implement this into
&lt;PRE&gt;values "pos_x" range [ , ]
values "pos_y" range [ , ]&lt;/PRE&gt;
lines? That's where I'm really struggling with it.
&lt;/BLOCKQUOTE&gt;

&lt;BR /&gt;
You are wanting to give a list of all possible integer values for a given eclipse? So the user inputs the bounding box, then can select a point within an eclipse that is bound by that?&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;(+-) A/2 + cx = pos_x			!cx = center x offset
(+-) B/2 + cy = pos_y			!cy = center y offset&lt;/PRE&gt;

&lt;BR /&gt;
Insert that however... I have not used the &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;Range&lt;E&gt;&lt;/E&gt; value before.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ling.</description>
      <pubDate>Thu, 26 Mar 2020 01:50:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Adjustable-hotspot-set-boundaries-to-Ellipse-amp-Circle/m-p/230888#M4406</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2020-03-26T01:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Adjustable hotspot - set boundaries to Ellipse &amp; Circle</title>
      <link>https://community.graphisoft.com/t5/GDL/Adjustable-hotspot-set-boundaries-to-Ellipse-amp-Circle/m-p/230889#M4407</link>
      <description>Wow, that's very helpful, gives a bit more context behind the r!  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_biggrin.gif" style="display : inline;" /&gt; &lt;BR /&gt;
&lt;BR /&gt;
What I'm trying to do is set the absolute minimum and maximum that pos_x and pos_y can be so when I move the hotspot, it can't be dragged outside of the circle / ellipse.&lt;BR /&gt;
&lt;BR /&gt;
Hope that makes sense.&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
      <pubDate>Thu, 26 Mar 2020 10:39:56 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Adjustable-hotspot-set-boundaries-to-Ellipse-amp-Circle/m-p/230889#M4407</guid>
      <dc:creator>JGoode</dc:creator>
      <dc:date>2020-03-26T10:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: Adjustable hotspot - set boundaries to Ellipse &amp; Circle</title>
      <link>https://community.graphisoft.com/t5/GDL/Adjustable-hotspot-set-boundaries-to-Ellipse-amp-Circle/m-p/230890#M4408</link>
      <description>Hi JGoode,&lt;BR /&gt;
&lt;BR /&gt;
If I were in your situation, I would just leave the parameters with no boundaries, and create a trigger with a print message. if the user put the trunk outside the canopy (-a/2&amp;lt;ParamX&amp;lt;a/2 and -b/2&amp;lt;ParamY&amp;lt;b/2), the following message would appear "ARE YOU KIDDING ME?"  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt;</description>
      <pubDate>Thu, 26 Mar 2020 12:14:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Adjustable-hotspot-set-boundaries-to-Ellipse-amp-Circle/m-p/230890#M4408</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-26T12:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Adjustable hotspot - set boundaries to Ellipse &amp; Circle</title>
      <link>https://community.graphisoft.com/t5/GDL/Adjustable-hotspot-set-boundaries-to-Ellipse-amp-Circle/m-p/230891#M4409</link>
      <description>&lt;BLOCKQUOTE&gt;JGoode wrote:&lt;BR /&gt;What I'm trying to do is set the absolute minimum and maximum that pos_x and pos_y can be so when I move the hotspot, it can't be dragged outside of the circle / ellipse.&lt;/BLOCKQUOTE&gt;

&lt;BR /&gt;
If there is not a need to tell the user what those limits are, you can just use my first post. If the equation for your eclipse is false, it will solve the intersection point between a line defined by cxcy . xy and your eclipse.&lt;BR /&gt;
&lt;BR /&gt;
ie. If A &amp;gt; B then A = B&lt;BR /&gt;
&lt;BR /&gt;



&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ling.</description>
      <pubDate>Fri, 27 Mar 2020 01:33:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Adjustable-hotspot-set-boundaries-to-Ellipse-amp-Circle/m-p/230891#M4409</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2020-03-27T01:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: Adjustable hotspot - set boundaries to Ellipse &amp; Circle</title>
      <link>https://community.graphisoft.com/t5/GDL/Adjustable-hotspot-set-boundaries-to-Ellipse-amp-Circle/m-p/230892#M4410</link>
      <description>Seeing you post over on the GDL forum, I just realised that your restriction was WITHIN the ellipse, not ON the ellipse...&lt;BR /&gt;
&lt;BR /&gt;
So the first line would be GREATER THAN instead of NOT EQUAL&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;IF x^2 / ( x_max )^2 + y^2 / ( y_max )^2 &amp;gt; 1 &lt;/PRE&gt;

&lt;BR /&gt;
Hope that did not mess you up,&lt;BR /&gt;
Ling.</description>
      <pubDate>Tue, 26 May 2020 03:18:10 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Adjustable-hotspot-set-boundaries-to-Ellipse-amp-Circle/m-p/230892#M4410</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2020-05-26T03:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Adjustable hotspot - set boundaries to Ellipse &amp; Circle</title>
      <link>https://community.graphisoft.com/t5/GDL/Adjustable-hotspot-set-boundaries-to-Ellipse-amp-Circle/m-p/342143#M4411</link>
      <description>&lt;P&gt;This is super helpful in understanding the radius and angles of the ellipse! I'm personally looking to do something much more simple for a few objects Im editing. A few of the objects need just a curved line, and one needs a full ellipse.&lt;BR /&gt;&lt;BR /&gt;How would the actual script of this ellipse look if I just wanted a 2D ellipse w/ fill capabilities? Would this just be plugging in the radius and x/y equations into something like a POLY_ command?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 18:08:26 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Adjustable-hotspot-set-boundaries-to-Ellipse-amp-Circle/m-p/342143#M4411</guid>
      <dc:creator>Mike Rosado</dc:creator>
      <dc:date>2022-06-23T18:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: Adjustable hotspot - set boundaries to Ellipse &amp; Circle</title>
      <link>https://community.graphisoft.com/t5/GDL/Adjustable-hotspot-set-boundaries-to-Ellipse-amp-Circle/m-p/342160#M4412</link>
      <description>&lt;P&gt;You cannot use the previous equations to draw an ellipse unless you are wanting just a straight line approximation using angular divisions or are actually just wanting something like a three point arch, maybe, since AC does not draw shapes based on equations but based on points and tangents. These equations are what you would use when you are defining &lt;STRONG&gt;hotspots&lt;/STRONG&gt; in your object.&amp;nbsp;You will have to stick with the suggestions in your &lt;A href="https://community.Graphisoft.com/t5/Design-forum/GLD-scripts-for-Ellipse-and-curved-line/td-p/342146" target="_self"&gt;other post&lt;/A&gt; regarding the actual drawing of the shape.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ling.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 01:28:13 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Adjustable-hotspot-set-boundaries-to-Ellipse-amp-Circle/m-p/342160#M4412</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2022-06-24T01:28:13Z</dc:date>
    </item>
  </channel>
</rss>

