| Peter Lorenz | | Simulation und Animation |
|---|
P3D Classes might inlude objects of other Classes. Pathes for moving objects can be placed within a Class.
This is the Toolbar of the Class Mode:

New is here the PC-button
for defining a Path within the Class. The last three Buttons are new compared to Proof 2D, too: Obviously it is possible
to use
as well for constructing a Class. Defining a new Class begins by pressing the
button.
Then the Class Name box is opened:
After pressing the OK button the Class definition box appears. Here we show this box with the tabs General and Z-distortion. The General menu is well known from Proof 2D. The new Z-Distortion tab allows a different scaling of the object depending on the distance from the Camera.

Objects or instances of Classes can be included in a Class as inner objects.
That can be started by pressing the button
.
The New Inner Object Name box is opened and a name for the inner object has to be typed.
Of course the Class of the inner object has to be constructed in advance.
Continuing the Bike example a Class Fork has to be constructed.
Let us assume that the wheels of our bike have a diameter of 0.33m.
Then the fork needs a width of at least 0.35 m.
For constructing such a fork we select the XY-plane.
The class Fork has 2 PolyLines as Pipes.
Defining a radius > 0 is important for avoiding discontinuities on inner Vertexes. Proof 3D provides rotation around all three axes.
An object can undergo roll, pitch and yaw simultaneously.
In the next section the import of 3D object as meshs has to be explained. Instead of constructing a Bicycle frame using the drawing tools of P3D a complete import of a bicycle frame as 3D object would be an alternative solution. A first advantage of our self made construction is the very small size of the layout file Bike2.lay. It has a size of 1664 Bytes. We will compare it with the size of imported meshs in the next section. A second advantage is the readablility and the option to write or modify it. Here is a copy of this file:
*3D Define View "(Home)" CameraSphere -0.469958 0 0 1.879829 0 89.999998 0 Lighting -0.1924 -0.1924 -0.9622 Ambient 0.4 0.4 0.4 Grid Size 0.02 0.2 Menu ON Speed 6 Define View "Bike1" CameraSphere -0.0000011848 0 0 1.879829 39.999928 33.999929 0 Lighting -0.1924 -0.1924 -0.9622 Ambient 0.4 0.4 0.4 Grid Size 0.02 0.2 Define Mesh Wheel "WheelXGGalery.x" Scale 1.3 1.3 0.6 Rotation 0 0 90 Color F2 Color F2 Define Class Fork Camera 0 0.0000000204 0.466175 0.466175 1.570796 1.570796 0 Directional Line #1 0 0 0 0.06 0 0 Line #2 0.06 0 0 0.097476 0.037476 0 Arc #3 0.01 0.104547 0.030405 0 135.000092 95.710564 normal 0 -0 1 Line #4 0.103552 0.040355 0 0.4 0.07 0 Line #5 0.06 0 0 0.097475 -0.037475 0 Arc #6 0.01 0.104546 -0.030404 0 315.000122 275.710724 normal -0 -0 -1 Line #7 0.103551 -0.040354 0 0.4 -0.07 0 PolyLine Pipe 0.02 #1 #2 #3 #4 End PolyLine Pipe 0.02 #5 #6 #7 End End Define Class Bike Camera -0.0000037668 -3.399416 -0.0000005134 3.399415 0 1.570796 0 Directional Arc #8 0.01 -0.396666 0 0.79 28.072636 -90 normal 0 1 0 Arc #9 0.01 -0.699403 0 0.222369 154.983032 28.072332 normal 0 1 0 Line #10 -0.690579 0 0.217663 -0.387842 0 0.785294 Line #11 -0.97336 0 0.785771 -0.708465 0 0.21814 Line #12 -0.396666 0 0.8 -0.964298 0 0.8 Arc #13 0.01 -0.964298 0 0.79 270 154.982864 normal 0 1 0 CPO Fork F1 -0.417822 -0.0000009537 0.886989 Color F2 Pitch -64 Scale 1.54 1.54 1.54 CPO Fork F2 -0.964298 0 0.8 Color F2 Pitch -120 Scale 1.4 1.4 1.4 CPO Fork F3 -0.708465 0 0.21814 Color F2 Pitch 168 Scale 1.4 1.4 1.4 PolyLine Pipe 0.03 #13 #11 #9 #10 #8 #12 Close End CPO Bike B1 0 0 0 Color F2 End
In the former section the Define Mesh command has been introduced. Here we present some examples for importing Meshs. All 3D models habe been found in Google's 3D-galerie.
Searching for bicycle you'll find more than 850 entries (11/03).
The following steps are recommended:
The 7 steps have been executed for some other parts (Crank, Saddle, Handlebar)
of the bicycle. On the right hand you can see a bicycle with these parts saved as
Bike4.lay.
Now we can write an atf with the following content:
set viewing_speed 1 time 5 pitch B1:P speed -60 time 10 pitch B1:W1 speed -155 time 10 pitch B1:W2 speed -155 time 20 move B1 speed 1 20 0 0 relative time 30 set view PathView place B1 on BikePath time 200 end * Wheel radius: 0.37 * Wheel circumference: 0.37*2*3.1416 = 2.32 m * Speed = 1m/s * Rotation angle per second = 360*1/2.32= 155 degrees per second
As just demonstrated a P3D Class may contain Objects of other Classes. Subsequently it is desirable to move them
on Class owned Paths. A Path can be definid during a Class definition by Pressing the
button.
As usual Lines and Arcs for the Path have to be defined in advance.
Returning to the bicycle we can see a deficiency in the motion of the pedals of the bicycle.
They should be squeezed to stay in a horizontal orientation during the circular motion of the crank.
That can be done in the following steps:
set viewing_speed 1 time 2 pitch B1:C speed -60 place B1:PL on B1:L set B1:PL travel 6 place B1:PR on B1:R at 0.565 set B1:PR travel 3 time 10 pitch B1:W1 speed -155 pitch B1:W2 speed -155 time 20 move B1 speed 1 20 0 0 relative time 30 set view PathView place B1 on BikePath time 200 end * The Crank has the speed 60. * It needs 360/60 = 6 seconds for a complete rotation. * Therefore we have to specify time = 6 for moving on the Paths L and R * On the Path B1:L the Pedal should be placed on the starting Point * + 3.14* radius 0.18 = 0.565 and get the half travel time = 3