Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Rotating or rolling an object that is not horizontal

Barry Kelly
Moderator
I have an object that is a simple EXTRUDE cammand rotated so that it is in the X-Z plane.
Now this object can have a pitch so one end is higher than the other.
Let's say it is a barge board on a roof gable (which is exactly what the real object is).

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.

Because the object is not horizontal I can not simply rotate it around the x-axis.

Below is a simplified 3D script.
If the pitch is 0 (zero) you can see how I want the barge to rotate on itself.
But as soon as you give the pitch a value you will see that the second object pulls away from the first.

I did a little maths which is commented out.
Un-comment this and it gets close again but still no cigar.
Obviously each ROT command is affecting how the next ROT command works.

Can anybody please help me in making this object rotate about an angled axis?

Thanks in advance.
Barry.


!!!3D script

pitch = 0
roll = 45
Hgt_Dff=tan(pitch)*a

!This is the default object *********************************
ROTZ 90
ROTX 90
EXTRUDE 5, 0, Hgt_Dff, a, 1+2+4+16+32,
0.0, 0.0, 0,
0.0, -0.200, 0,
-0.020, -0.200, 0,
-0.020, 0.0, 0,
0.0, 0.0, 0
DEL 2


!The samet object but now rotated (rolled) *********************************
!The top edge should follow the first object

material 24

!rot_hgt = Hgt_Dff - (Hgt_Dff*COS(roll))
!
!roll_ang = ATN((Hgt_Dff*COS(roll))/A)
!rot_ang = pitch-roll_ang
!
!roty -rot_ang
!rotz -ATN((Hgt_Dff*SIN(roll))/A)

rotx -roll

ROTZ 90
ROTX 90
EXTRUDE 5, 0, Hgt_Dff, a, 1+2+4+16+32,
0.0, 0.0, 0,
0.0, -0.200, 0,
-0.020, -0.200, 0,
-0.020, 0.0, 0,
0.0, 0.0, 0
DEL 3
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
5 REPLIES 5
Jochen Suehlo
Moderator
If I understand you right, this could solve the problem.
ADDy -0.02 ! new line
rotx -roll ! old line
ADDy 0.02 ! new line
But can it be so easy?
Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
Aussie John
Newcomer
I havent studied your script but try putting the roll command before the command to angle it
Cheers John
John Hyland : ARINA : www.arina.biz
User ver 4 to 12 - Jumped to v22 - so many options and settings!!!
OSX 10.15.6 [Catalina] : Archicad 22 : 15" MacBook Pro 2019
[/size]
Barry Kelly
Moderator
Joachim wrote:
If I understand you right, this could solve the problem.
ADDy -0.02 ! new line
rotx -roll ! old line
ADDy 0.02 ! new line
But can it be so easy?
Unfortunately not.
Thanks for trying.

Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Barry Kelly
Moderator
Aussie wrote:
I havent studied your script but try putting the roll command before the command to angle it
Tried that but no luck.

I thought this would be a fairly obviuos and easy thing to do so i thought about it again.
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.

I'll give it a go in a minute and will get back to you with the results.

Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Barry Kelly
Moderator
Barry wrote:
..... I forgot about the ROT x, y, z, alpha ......
Oh so simple.
This is what it should be.
Barry.


pitch = 30
roll = 45
Hgt_Dff=tan(pitch)*a

!This is the default object *********************************
ROTZ 90
ROTX 90
EXTRUDE 5, 0, Hgt_Dff, a, 1+2+4+16+32,
0.0, 0.0, 0,
0.0, -0.200, 0,
-0.020, -0.200, 0,
-0.020, 0.0, 0,
0.0, 0.0, 0
DEL 2


!The samet object but now rotated (rolled) *********************************
!The top edge should follow the first object

material 24

ROT A, 0, Hgt_Dff, roll


ROTZ 90
ROTX 90
EXTRUDE 5, 0, Hgt_Dff, a, 1+2+4+16+32,
0.0, 0.0, 0,
0.0, -0.200, 0,
-0.020, -0.200, 0,
-0.020, 0.0, 0,
0.0, 0.0, 0
DEL 3
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11