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