<?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: Rotating or rolling an object that is not horizontal in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Rotating-or-rolling-an-object-that-is-not-horizontal/m-p/51646#M35955</link>
    <description>&lt;BLOCKQUOTE&gt;Barry wrote:&lt;BR /&gt;..... I forgot about the ROT x, y, z, alpha ......&lt;/BLOCKQUOTE&gt;

Oh so simple.  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_lol.gif" style="display : inline;" /&gt; &lt;BR /&gt;
This is what it should be.&lt;BR /&gt;
Barry.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
pitch = 30&lt;BR /&gt;
roll = 45&lt;BR /&gt;
Hgt_Dff=tan(pitch)*a&lt;BR /&gt;
&lt;BR /&gt;
!This is the default object *********************************&lt;BR /&gt;
ROTZ 90&lt;BR /&gt;
ROTX 90&lt;BR /&gt;
EXTRUDE 5, 0, Hgt_Dff, a, 1+2+4+16+32,&lt;BR /&gt;
            0.0,     0.0,      0,&lt;BR /&gt;
            0.0,     -0.200,     0,&lt;BR /&gt;
           -0.020,    -0.200,     0,&lt;BR /&gt;
           -0.020,    0.0,   0,&lt;BR /&gt;
            0.0,      0.0,    0&lt;BR /&gt;
DEL 2&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
!The samet object but now rotated (rolled) *********************************&lt;BR /&gt;
!The top edge should follow the first object&lt;BR /&gt;
&lt;BR /&gt;
material 24&lt;BR /&gt;
&lt;BR /&gt;
ROT A, 0, Hgt_Dff, roll&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
ROTZ 90&lt;BR /&gt;
ROTX 90&lt;BR /&gt;
EXTRUDE 5, 0, Hgt_Dff, a, 1+2+4+16+32,&lt;BR /&gt;
			0.0,     0.0,      0,&lt;BR /&gt;
			0.0,     -0.200,     0,&lt;BR /&gt;
		   -0.020,    -0.200,     0,&lt;BR /&gt;
		   -0.020,    0.0,   0,&lt;BR /&gt;
			0.0,      0.0,    0&lt;BR /&gt;
DEL 3</description>
    <pubDate>Fri, 23 Sep 2005 01:55:14 GMT</pubDate>
    <dc:creator>Barry Kelly</dc:creator>
    <dc:date>2005-09-23T01:55:14Z</dc:date>
    <item>
      <title>Rotating or rolling an object that is not horizontal</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Rotating-or-rolling-an-object-that-is-not-horizontal/m-p/51641#M35950</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;I have an object that is a simple EXTRUDE cammand rotated so that it is in the X-Z plane.&lt;BR /&gt;
Now this object can have a pitch so one end is higher than the other.&lt;BR /&gt;
Let's say it is a barge board on a roof gable (which is exactly what the real object is).&lt;BR /&gt;
&lt;BR /&gt;
The problem I am having is I want to rotate or roll this barge board along its top edge, so the pitch remains the same and still follows the roof - i.e the top inside edge is to remain in exactly the same location.&lt;BR /&gt;
&lt;BR /&gt;
Because the object is not horizontal I can not simply rotate it around the x-axis.&lt;BR /&gt;
&lt;BR /&gt;
Below is a simplified 3D script.&lt;BR /&gt;
If the pitch is 0 (zero) you can see how I want the barge to rotate on itself.&lt;BR /&gt;
But as soon as you give the pitch a value you will see that the second object pulls away from the first.&lt;BR /&gt;
&lt;BR /&gt;
I did a little maths which is commented out.&lt;BR /&gt;
Un-comment this and it gets close again but still no cigar.&lt;BR /&gt;
Obviously each ROT command is affecting how the next ROT command works.&lt;BR /&gt;
&lt;BR /&gt;
Can anybody please help me in making this object rotate about an angled axis?&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance.&lt;BR /&gt;
Barry.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
!!!3D script&lt;BR /&gt;
&lt;BR /&gt;
pitch = 0&lt;BR /&gt;
roll = 45&lt;BR /&gt;
Hgt_Dff=tan(pitch)*a&lt;BR /&gt;
&lt;BR /&gt;
!This is the default object *********************************&lt;BR /&gt;
ROTZ 90&lt;BR /&gt;
ROTX 90&lt;BR /&gt;
EXTRUDE 5, 0, Hgt_Dff, a, 1+2+4+16+32,&lt;BR /&gt;
            0.0,     0.0,      0,&lt;BR /&gt;
            0.0,     -0.200,     0,&lt;BR /&gt;
           -0.020,    -0.200,     0,&lt;BR /&gt;
           -0.020,    0.0,   0,&lt;BR /&gt;
            0.0,      0.0,    0&lt;BR /&gt;
DEL 2&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
!The samet object but now rotated (rolled) *********************************&lt;BR /&gt;
!The top edge should follow the first object&lt;BR /&gt;
&lt;BR /&gt;
material 24&lt;BR /&gt;
&lt;BR /&gt;
!rot_hgt = Hgt_Dff - (Hgt_Dff*COS(roll))&lt;BR /&gt;
!&lt;BR /&gt;
!roll_ang = ATN((Hgt_Dff*COS(roll))/A)&lt;BR /&gt;
!rot_ang = pitch-roll_ang&lt;BR /&gt;
!&lt;BR /&gt;
!roty -rot_ang&lt;BR /&gt;
!rotz -ATN((Hgt_Dff*SIN(roll))/A)&lt;BR /&gt;
&lt;BR /&gt;
rotx -roll&lt;BR /&gt;
&lt;BR /&gt;
ROTZ 90&lt;BR /&gt;
ROTX 90&lt;BR /&gt;
EXTRUDE 5, 0, Hgt_Dff, a, 1+2+4+16+32,&lt;BR /&gt;
			0.0,     0.0,      0,&lt;BR /&gt;
			0.0,     -0.200,     0,&lt;BR /&gt;
		   -0.020,    -0.200,     0,&lt;BR /&gt;
		   -0.020,    0.0,   0,&lt;BR /&gt;
			0.0,      0.0,    0&lt;BR /&gt;
DEL 3&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 22 Sep 2005 08:10:31 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Rotating-or-rolling-an-object-that-is-not-horizontal/m-p/51641#M35950</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2005-09-22T08:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating or rolling an object that is not horizontal</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Rotating-or-rolling-an-object-that-is-not-horizontal/m-p/51642#M35951</link>
      <description>If I understand you right, this could solve the problem.&lt;BR /&gt;
	ADDy -0.02         ! new line&lt;BR /&gt;
rotx -roll                     ! old line&lt;BR /&gt;
	ADDy 0.02          ! new line&lt;BR /&gt;
But can it be so easy?</description>
      <pubDate>Thu, 22 Sep 2005 10:20:55 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Rotating-or-rolling-an-object-that-is-not-horizontal/m-p/51642#M35951</guid>
      <dc:creator>Jochen Suehlo</dc:creator>
      <dc:date>2005-09-22T10:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating or rolling an object that is not horizontal</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Rotating-or-rolling-an-object-that-is-not-horizontal/m-p/51643#M35952</link>
      <description>I havent studied your script but try putting the roll command before the command to angle it</description>
      <pubDate>Thu, 22 Sep 2005 11:47:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Rotating-or-rolling-an-object-that-is-not-horizontal/m-p/51643#M35952</guid>
      <dc:creator>Aussie John</dc:creator>
      <dc:date>2005-09-22T11:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating or rolling an object that is not horizontal</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Rotating-or-rolling-an-object-that-is-not-horizontal/m-p/51644#M35953</link>
      <description>&lt;BLOCKQUOTE&gt;Joachim wrote:&lt;BR /&gt;If I understand you right, this could solve the problem.&lt;BR /&gt;
	ADDy -0.02         ! new line&lt;BR /&gt;
rotx -roll                     ! old line&lt;BR /&gt;
	ADDy 0.02          ! new line&lt;BR /&gt;
But can it be so easy?&lt;/BLOCKQUOTE&gt;

Unfortunately not.  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_cry.gif" style="display : inline;" /&gt; &lt;BR /&gt;
Thanks for trying.&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Fri, 23 Sep 2005 01:39:58 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Rotating-or-rolling-an-object-that-is-not-horizontal/m-p/51644#M35953</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2005-09-23T01:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating or rolling an object that is not horizontal</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Rotating-or-rolling-an-object-that-is-not-horizontal/m-p/51645#M35954</link>
      <description>&lt;BLOCKQUOTE&gt;Aussie wrote:&lt;BR /&gt;I havent studied your script but try putting the roll command before the command to angle it&lt;/BLOCKQUOTE&gt;

Tried that but no luck.&lt;BR /&gt;
&lt;BR /&gt;
I thought this would be a fairly obviuos and easy thing to do so i thought about it again.&lt;BR /&gt;
I'm so use to using just the ROTx alpha, ROTy alpha, ROTz alpha commands on their own I forgot about the ROT x, y, z, alpha where you can define the co-ordinates of the axis and then the angle.&lt;BR /&gt;
&lt;BR /&gt;
I'll give it a go in a minute and will get back to you with the results.&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Fri, 23 Sep 2005 01:49:51 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Rotating-or-rolling-an-object-that-is-not-horizontal/m-p/51645#M35954</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2005-09-23T01:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Rotating or rolling an object that is not horizontal</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Rotating-or-rolling-an-object-that-is-not-horizontal/m-p/51646#M35955</link>
      <description>&lt;BLOCKQUOTE&gt;Barry wrote:&lt;BR /&gt;..... I forgot about the ROT x, y, z, alpha ......&lt;/BLOCKQUOTE&gt;

Oh so simple.  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_lol.gif" style="display : inline;" /&gt; &lt;BR /&gt;
This is what it should be.&lt;BR /&gt;
Barry.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
pitch = 30&lt;BR /&gt;
roll = 45&lt;BR /&gt;
Hgt_Dff=tan(pitch)*a&lt;BR /&gt;
&lt;BR /&gt;
!This is the default object *********************************&lt;BR /&gt;
ROTZ 90&lt;BR /&gt;
ROTX 90&lt;BR /&gt;
EXTRUDE 5, 0, Hgt_Dff, a, 1+2+4+16+32,&lt;BR /&gt;
            0.0,     0.0,      0,&lt;BR /&gt;
            0.0,     -0.200,     0,&lt;BR /&gt;
           -0.020,    -0.200,     0,&lt;BR /&gt;
           -0.020,    0.0,   0,&lt;BR /&gt;
            0.0,      0.0,    0&lt;BR /&gt;
DEL 2&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
!The samet object but now rotated (rolled) *********************************&lt;BR /&gt;
!The top edge should follow the first object&lt;BR /&gt;
&lt;BR /&gt;
material 24&lt;BR /&gt;
&lt;BR /&gt;
ROT A, 0, Hgt_Dff, roll&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
ROTZ 90&lt;BR /&gt;
ROTX 90&lt;BR /&gt;
EXTRUDE 5, 0, Hgt_Dff, a, 1+2+4+16+32,&lt;BR /&gt;
			0.0,     0.0,      0,&lt;BR /&gt;
			0.0,     -0.200,     0,&lt;BR /&gt;
		   -0.020,    -0.200,     0,&lt;BR /&gt;
		   -0.020,    0.0,   0,&lt;BR /&gt;
			0.0,      0.0,    0&lt;BR /&gt;
DEL 3</description>
      <pubDate>Fri, 23 Sep 2005 01:55:14 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Rotating-or-rolling-an-object-that-is-not-horizontal/m-p/51646#M35955</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2005-09-23T01:55:14Z</dc:date>
    </item>
  </channel>
</rss>

