<?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: Poly2_B{2} Fill Origin &amp;amp; Movement in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/Poly2-B-2-Fill-Origin-amp-Movement/m-p/365538#M1677</link>
    <description>&lt;P&gt;sorry, had school run, last day of term, didn't have time to finish the post.&lt;/P&gt;&lt;P&gt;just go for POLY2_B{3} which uses "Distorted fill" settings rather than "rotation relative to fill origin" setting for POLY2_B{2}.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Dec 2022 03:59:35 GMT</pubDate>
    <dc:creator>AllanP</dc:creator>
    <dc:date>2022-12-20T03:59:35Z</dc:date>
    <item>
      <title>Poly2_B{2} Fill Origin &amp; Movement</title>
      <link>https://community.graphisoft.com/t5/GDL/Poly2-B-2-Fill-Origin-amp-Movement/m-p/365512#M1674</link>
      <description>&lt;P&gt;I've reached a dead-end and can't work this out.&amp;nbsp; It's a first for me using the POLY2_B{2} command and I'm trying to set the fill origin for a fill to the center of the fill.&amp;nbsp; I've got the j4(8) code in the frame fill it responds to changes in the origin variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, before drawing the fill several cursor movements are made to get to that point.&amp;nbsp; Now when the fill is drawn the origin is all over the place.&amp;nbsp; I've included a test object code below (no parameters required) which shows this.&amp;nbsp; There's a loop that draws the fill, rotates 90° and draws the fill again.&amp;nbsp; Drawing it 4 times.&amp;nbsp; The origin is in the center and everything is good.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But then a simple ADD2 1,1 is added before the loop. Now the fill's origins are off by 200mm for each iteration of the loop in one or both the x &amp;amp; y directions.&amp;nbsp; If I throw in an angle for the fill origin it gets even more confusing.&amp;nbsp; I had assumed the fill origin x / y coordinates would be based off the cursor position, but that's not the case.&amp;nbsp; Does anyone know what's going on here?&amp;nbsp; Or do I need to draw the fills without any movement commands?&amp;nbsp; Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;x1 = 0
x2 = 4
y1 = 2
y2 = 4
fill_x = (x2-x1)/2+x1
fill_y = (y2-y1)/2+y1

HOTSPOT2 0,0					!!==== CENTER PRE MOVE				
!ADD2 1,1					!!==== TURN THIS ON / OFF
HOTSPOT2 0,0					!!==== CENTER AFTER MOVE					

FILL 127
FOR i = 1 TO 4

	fillosx = 0		!!=== USED TO TEST EDITING THE ORIGIN 
	fillosy = 0
	rot_angle = 0

!	IF i = 2 THEN		!!=== USED TO TEST EDITING THE ORIGIN FOR EACH LOOP
!		fillosy = -0.200
!		rot_angle = 0
!	ENDIF
!	IF i = 3 THEN
!		fillosx = -0.200
!		fillosy = -0.200
!		rot_angle = 0
!	ENDIF
!	IF i = 4 THEN
!		fillosx = -0.200
!		rot_angle = 0
!	ENDIF

	HOTSPOT2 x1, y1
	HOTSPOT2 x1, y2
	HOTSPOT2 x2, y1
	HOTSPOT2 x2, y2

	HOTSPOT2 fill_x, fill_y		!!=== WHAT SHOULD BE THE FILL'S ORIGIN
	POLY2_B{2} 5, 1+2+4+8, 1, 19, fill_x +fillosx, fill_y +fillosy, rot_angle,
		x1,	y1,	15,
		x2, y1,	15,
		x2,	y2,	15,
		x1,	y2,	15,
		x1,	y1,	15
	ROT2 90
 NEXT i&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="http://community.graphisoft.com/t5/image/serverpage/image-id/55844i0369AFEB399F2CE1/image-size/large?v=v2&amp;amp;px=999" border="0" alt="Fill Origins - Moved 1-1.JPG" title="Fill Origins - Moved 1-1.JPG" /&gt;&lt;IMG src="http://community.graphisoft.com/t5/image/serverpage/image-id/55845i83AC38F5F4571BB8/image-size/large?v=v2&amp;amp;px=999" border="0" alt="Fill Origins - No Movement.JPG" title="Fill Origins - No Movement.JPG" /&gt;</description>
      <pubDate>Mon, 16 Jan 2023 08:56:23 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Poly2-B-2-Fill-Origin-amp-Movement/m-p/365512#M1674</guid>
      <dc:creator>Lachlan Green</dc:creator>
      <dc:date>2023-01-16T08:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: Poly2_B{2} Fill Origin &amp; Movement</title>
      <link>https://community.graphisoft.com/t5/GDL/Poly2-B-2-Fill-Origin-amp-Movement/m-p/365524#M1675</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;don't confuse what you think you see with what you should look at.&lt;/P&gt;&lt;P&gt;if you explode the object (Ctrl+=) then you see the origin is off by 1mx1m.(i added in a slight rotation and a larger scaled fill to pick this up)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AllanP_0-1671498602718.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/32655i8D0DA6DFAC98026A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AllanP_0-1671498602718.png" alt="AllanP_0-1671498602718.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AllanP_1-1671498608604.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/32656i8FD7F278EF5D5E78/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AllanP_1-1671498608604.png" alt="AllanP_1-1671498608604.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AllanP_2-1671498615639.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/32657i5A2638CED06BC0CD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AllanP_2-1671498615639.png" alt="AllanP_2-1671498615639.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;because the temp origin is being calculated then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ox = 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !!==== move any amount&lt;BR /&gt;oy = 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !!==== move any amount&lt;BR /&gt;x1 = 0&lt;BR /&gt;x2 = 4&lt;BR /&gt;y1 = 2&lt;BR /&gt;y2 = 4&lt;BR /&gt;fill_x = (x2-x1)/2+x1&lt;BR /&gt;fill_y = (y2-y1)/2+y1&lt;BR /&gt;line2 0,0,1,0.25&lt;BR /&gt;HOTSPOT2 0,0 !!==== CENTER PRE MOVE&lt;BR /&gt;ADD2 ox,oy&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !!==== move any amount&lt;BR /&gt;HOTSPOT2 0,0 !!==== CENTER AFTER MOVE&lt;/P&gt;&lt;P&gt;FILL fillAttribute_1&lt;BR /&gt;&lt;BR /&gt;FOR i = 1 TO 4&lt;BR /&gt;fillosx = -ox +ox !!==== move back to the origin&amp;nbsp; then move forward in the new direction&lt;BR /&gt;fillosy = -oy +oy !!==== move back to the origin&amp;nbsp; then move forward in the new direction&lt;BR /&gt;rot_angle = 11&lt;BR /&gt;&lt;BR /&gt;IF i = 2 THEN !!=== USED TO TEST EDITING THE ORIGIN FOR EACH LOOP&lt;BR /&gt;fillosx = -ox+oy&amp;nbsp;&amp;nbsp; !!==== move back to the origin&amp;nbsp; then move forward in the new rotated direction&lt;BR /&gt;fillosy = -oy -ox&amp;nbsp; !!==== move back to the origin then move forward in the new rotated direction&lt;BR /&gt;ENDIF&lt;BR /&gt;IF i = 3 THEN&lt;BR /&gt;fillosx = -ox -ox !!==== move back to the origin&amp;nbsp; then move forward in the new rotated direction&lt;BR /&gt;fillosy = -oy -oy !!==== move back to the origin&amp;nbsp; then move forward in the new rotated direction&lt;BR /&gt;ENDIF&lt;BR /&gt;IF i = 4 THEN&lt;BR /&gt;fillosx = -ox-oy !!==== move back to the origin&amp;nbsp; then move forward in the new rotated direction&lt;BR /&gt;fillosy = -oy+ox !!==== move back to the origin&amp;nbsp; then move forward in the new rotated direction&lt;BR /&gt;ENDIF&lt;/P&gt;&lt;P&gt;HOTSPOT2 x1, y1&lt;BR /&gt;HOTSPOT2 x1, y2&lt;BR /&gt;HOTSPOT2 x2, y1&lt;BR /&gt;HOTSPOT2 x2, y2&lt;/P&gt;&lt;P&gt;HOTSPOT2 fill_x, fill_y !!=== WHAT SHOULD BE THE FILL'S ORIGIN&lt;BR /&gt;POLY2_B{2} 5, 1+2+4+8, 1, 19, fill_x +fillosx, fill_y +fillosy, rot_angle,&lt;BR /&gt;x1, y1, 15,&lt;BR /&gt;x2, y1, 15,&lt;BR /&gt;x2, y2, 15,&lt;BR /&gt;x1, y2, 15,&lt;BR /&gt;x1, y1, 15&lt;BR /&gt;ROT2 90&lt;BR /&gt;NEXT i&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AllanP_4-1671500621008.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/32662i073DBBD82BFC7AAB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AllanP_4-1671500621008.png" alt="AllanP_4-1671500621008.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AllanP_5-1671500634181.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/32663i2ACC855C29684159/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AllanP_5-1671500634181.png" alt="AllanP_5-1671500634181.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I hope this explains the strange behavior .&lt;/P&gt;&lt;P&gt;you could use sin and cos for non 90degree angles&lt;/P&gt;&lt;P&gt;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;/P&gt;&lt;P&gt;fillosx = -ox +ox*cos(rotangle)+oy*sin(rotangle)&lt;BR /&gt;fillosy = -oy +oy*cos(rotangle)-ox*sin(rotangle)&lt;/P&gt;&lt;P&gt;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;/P&gt;&lt;P&gt;i.e.&lt;/P&gt;&lt;P&gt;i_angle = 30&lt;/P&gt;&lt;P&gt;rotangle = 0&lt;BR /&gt;FOR i = 1 TO 4&lt;BR /&gt;rot_angle = 11&lt;BR /&gt;fillosx = -ox +ox*cos(rotangle)+oy*sin(rotangle)&lt;BR /&gt;fillosy = -oy +oy*cos(rotangle)-ox*sin(rotangle)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;HOTSPOT2 x1, y1&lt;BR /&gt;HOTSPOT2 x1, y2&lt;BR /&gt;HOTSPOT2 x2, y1&lt;BR /&gt;HOTSPOT2 x2, y2&lt;/P&gt;&lt;P&gt;HOTSPOT2 fill_x, fill_y !!=== WHAT SHOULD BE THE FILL'S ORIGIN&lt;BR /&gt;POLY2_B{2} 5, 1+2+4+8, 1, 19, fill_x +fillosx, fill_y +fillosy, rot_angle,&lt;BR /&gt;x1, y1, 15,&lt;BR /&gt;x2, y1, 15,&lt;BR /&gt;x2, y2, 15,&lt;BR /&gt;x1, y2, 15,&lt;BR /&gt;x1, y1, 15&lt;BR /&gt;ROT2 i_angle&lt;BR /&gt;rotangle = rotangle +i_angle&lt;/P&gt;&lt;P&gt;NEXT i&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AllanP_6-1671505177596.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/32665i692BBBC73A4C2EA5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AllanP_6-1671505177596.png" alt="AllanP_6-1671505177596.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or you can jump to POLY2_B{3} where the problem doesn't exist....&lt;/P&gt;&lt;P&gt;FOR i = 1 TO 4&lt;BR /&gt;rot_angle = 11&lt;/P&gt;&lt;P&gt;HOTSPOT2 x1, y1&lt;BR /&gt;HOTSPOT2 x1, y2&lt;BR /&gt;HOTSPOT2 x2, y1&lt;BR /&gt;HOTSPOT2 x2, y2&lt;/P&gt;&lt;P&gt;HOTSPOT2 fill_x, fill_y !!=== WHAT SHOULD BE THE FILL'S ORIGIN&lt;BR /&gt;&lt;BR /&gt;POLY2_B{3} 5, 1+2+4+8, 1, 19, fill_x , fill_y ,!!!!! rot_angle,replaced by next 4 values&lt;BR /&gt;1*cos(rot_angle),1*sin(rot_angle),0-1*sin(rot_angle),1*cos(rot_angle),&lt;BR /&gt;x1, y1, 15,&lt;BR /&gt;x2, y1, 15,&lt;BR /&gt;x2, y2, 15,&lt;BR /&gt;x1, y2, 15,&lt;BR /&gt;x1, y1, 15&lt;BR /&gt;ROT2 i_angle&lt;BR /&gt;NEXT i&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AllanP_8-1671506542656.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/32667iD88FAFAE28571381/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AllanP_8-1671506542656.png" alt="AllanP_8-1671506542656.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 03:22:34 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Poly2-B-2-Fill-Origin-amp-Movement/m-p/365524#M1675</guid>
      <dc:creator>AllanP</dc:creator>
      <dc:date>2022-12-20T03:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: Poly2_B{2} Fill Origin &amp; Movement</title>
      <link>https://community.graphisoft.com/t5/GDL/Poly2-B-2-Fill-Origin-amp-Movement/m-p/365534#M1676</link>
      <description>&lt;P&gt;That made me think of Obi-Wan - "Your eyes deceive you. Don't trust them".&amp;nbsp; Exploding the object to find the actual origin is a nice trick I hadn't thought of.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached is an image of the exploded fills from the object I'm working on.&amp;nbsp; It's one fill command that sits within two loops.&amp;nbsp; Now that I know where the actual origins are, I'm considering if I should spend the time to work out how to control these fills.&amp;nbsp; Or just change the script to draw some lines over the top and make it look like the fill I need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for the help.&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="http://community.graphisoft.com/t5/image/serverpage/image-id/55846iBC31B16C41CD6B49/image-size/large?v=v2&amp;amp;px=999" border="0" alt="Fill Origins - exploded.JPG" title="Fill Origins - exploded.JPG" /&gt;</description>
      <pubDate>Tue, 20 Dec 2022 02:33:09 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Poly2-B-2-Fill-Origin-amp-Movement/m-p/365534#M1676</guid>
      <dc:creator>Lachlan Green</dc:creator>
      <dc:date>2022-12-20T02:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: Poly2_B{2} Fill Origin &amp; Movement</title>
      <link>https://community.graphisoft.com/t5/GDL/Poly2-B-2-Fill-Origin-amp-Movement/m-p/365538#M1677</link>
      <description>&lt;P&gt;sorry, had school run, last day of term, didn't have time to finish the post.&lt;/P&gt;&lt;P&gt;just go for POLY2_B{3} which uses "Distorted fill" settings rather than "rotation relative to fill origin" setting for POLY2_B{2}.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 03:59:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/Poly2-B-2-Fill-Origin-amp-Movement/m-p/365538#M1677</guid>
      <dc:creator>AllanP</dc:creator>
      <dc:date>2022-12-20T03:59:35Z</dc:date>
    </item>
  </channel>
</rss>

