Adding pitch yaw and roll to xyz of a location
-
I have the cloud v6 ruby which allows for the x,y,z text input. Is there a script that can import all 6 values at one time?
I need to be able to import the x,y,z,pitch,yaw,roll in one file for a flight path.
example of what i need to do is like this:
0,0,0,10,0,0
10,5,5,0,45,0I know it can be done some how but I can't figure it out.
-
@ladyquestio said:
I have the cloud v6 ruby which allows for the x,y,z text input. Is there a script that can import all 6 values at one time?
I need to be able to import the x,y,z,pitch,yaw,roll in one file for a flight path.
example of what i need to do is like this:
0,0,0,10,0,0
10,5,5,0,45,0I know it can be done some how but I can't figure it out.
I have a basic CSV_Import plugin on my blog that can be easily modified to suit or at least demonstrate how it is done.
-
@unknownuser said:
I have a basic CSV_Import plugin on my blog that can be easily modified to suit or at least demonstrate how it is done.
Thanks for that information
I can at least import the data
Now what I need to do is integrate the rotations to a selection of a component I place in my model.I have an understanding of the code needed for rotations.
I import x,y,z,rotx,roty,rotz
With your routine to draw the lines needed.
So if I use the rp point as my location to put the item.
Where rp=pt(x,y,z) point at end of line from your script.rxv=Geom::Vector3d.new(1,0,0) *** the x axis ryv=Geom::Vector3d.new(0,1,0)*** the y axis rzv=Geom::Vector3d.new(0,0,1)*** the z axis ss.each do |ent| ent.transform!(Geom::Transformation.rotation(rp, rxv, rotx.degrees)) ent.transform!(Geom::Transformation.rotation(rp, ryv, roty.degrees)) ent.transform!(Geom::Transformation.rotation(rp, rzv, rotz.degrees))
How would I do this?
Thanks,
-
In addition to the rotation, you will need to do a translation to move the selected component to the new location.
Geom::Transformation.translation(old_point.vector_to(new_point))
Is this suppose to produce an animation? If so you will need to include pauses using sleep(length_of_pause).
In the rotation, you can use the Sketchup constants X_AXIS,Y_AXIS,Z_AXIS instead of defining your own.
-
@sdmitch said:
In addition to the rotation, you will need to do a translation to move the selected component to the new location.
Geom::Transformation.translation(old_point.vector_to(new_point))
Is this suppose to produce an animation? If so you will need to include pauses using sleep(length_of_pause).
In the rotation, you can use the Sketchup constants X_AXIS,Y_AXIS,Z_AXIS instead of defining your own.
This is for a flight path key frames. The components location, as well as its pitch, yaw and roll (rotations on it's x,y,z axis) are for basically changes in an items orientation and direction of travel.
I can do it if need be by using several different ruby scripts, like pathcopy to put the component at the line end points. Then manually selecting each one and making the rotations one at a time(which takes hours to do) but I am trying to do it with a script to save time.
So any help is really appreciated.
-
So you want to place a copy of the component at each xyz and rotate it by the given roll, pitch and yaw. But shouldn't the x, y, and z axes be determined by the heading at each point and not axes of the model?
-
I thot Martin Rinehart did this with a biplane model ??
-
@sdmitch said:
So you want to place a copy of the component at each xyz and rotate it by the given roll, pitch and yaw. But shouldn't the x, y, and z axes be determined by the heading at each point and not axes of the model?
Yes, it goes from then end of one line made to the other end and that is the general line of travel on the x,y,z position. Which locate the position of the action. However, the pitch, yaw, and roll (rotations) are the orientation of the model at that location. And along the line of travel. as to the question of timing that is done by delaying the action at a particular point like at the line end through duplication of that particular key component placed there.
This is an example of what i am trying to do:
Numbers are in feet, x,y,z where x is direction of travel, y is left/right, z is up/down.
START: 0,0,0,1
LIFTOFF: 0,0,8 over the course of 4 seconds.
PAUSE: for 5 seconds.
fly : 150,0,0 over the course of 10 seconds
:turning to look back at primary model as it travels to next point.
PAUSE: for 5 seconds action
ROTATE LEFT: 90 degrees over the course of 5 seconds.
go to: 400,0,0 over the course of 20 seconds.
PAUSE: for 5 seconds
ROTATE LEFT 90 degrees over the course of 5 seconds.
Gos to 150,0,0 over the course of 10 seconds
action :Barrel roll along travel path then rights it self at end of travel line.
PAUSE: for 5 seconds.
ROTATE LEFT: 90 degrees over the course of 5 seconds.
HEAD TOWARD PORT DOORS: 400,0,0 over the course of 40 seconds.
PAUSE: for 5 seconds.
ROTATE LEFT: 90 degrees over the course of 5 seconds.
LAND: 0,0,-8,
and rotates on x axis to original position -
Sorry for my denseness but are the x,y,z values absolute or delta values.
-
@dan rathbun said:
I thot Martin Rinehart did this with a biplane model ??
You can see how Martin did things through this search of his posts:
http://forums.sketchucation.com/search.php?st=0&sk=t&sd=d&sr=posts&author_id=25586then search within those results for "biplane"
Advertisement