A combined linear and angular motion is defined:
m = new Motion("Combined Linear/Angular");
m1 = m.motionComponent("Linear");
m1.setDirection(0, 1, 0);
m1.initialPosition = 0;
p = m1.property("Distance");
v = p.variation("Reciprocating");
v.setValue("Half Period Time", 25, "second");
v.setValue("Distance", 500, "millimeter");
p.apply(v);
m2 = m.motionComponent("Angular");
m2.setAxisOfRotation(0, 1, 0);
m2.setCenterOfRotation(0, 0, -100);
m2.initialPosition = -40;
p = m2.property("Angle");
v = p.variation("Oscillating");
v.setValue("Half Period Time", 6, "second");
v.setValue("Angular Displacement", 80, "deg");
p.apply(v);
a.select("RADAR");
a.applyMotion(m);
A line-by-line description of creating a combined linear/angular motion follows:
A motion object called “m” is created, and set to type Combined Linear/Angular:
m = new Motion("Combined Linear/Angular");
A motion object called “m1” is created, and is used to define the Linear component of the motion. The direction of travel and the initial position are defined:
m1 = m.motionComponent("Linear");
m1.setDirection(0, 1, 0);
m1.initialPosition = 0;
A property object called “p” is created, and is used to define the Linear component of this motion. The distance of travel is defined as reciprocating using a variation object called “v”:
p = m1.property("Distance");
v = p.variation("Reciprocating");
v.setValue("Half Period Time", 25, "second");
v.setValue("Distance", 500, "millimeter");
p.apply(v);
The angular component of the motion is defined by first creating a motion object called “m2”, and setting to angular. The geometric parameters of angular motion are then set. The angular motion is defined by creating a property object called “p”, and defining the angular motion to be oscillating.
m2 = m.motionComponent("Angular");
m2.setAxisOfRotation(0, 1, 0);
m2.setCenterOfRotation(0, 0, -100);
m2.initialPosition = -40;
p = m2.property("Angle");
v = p.variation("Oscillating");
v.setValue("Half Period Time", 6, "second");
v.setValue("Angular Displacement", 80, "deg");
p.apply(v);
The command is finished by selecting the part called “Radar”, and assigning the motion defined in the motion object m:
a.select("RADAR");
a.applyMotion(m);