Search in sources :

Example 56 with MechModel

use of artisynth.core.mechmodels.MechModel in project artisynth_core by artisynth.

the class ArticulatedDemo method build.

public void build(String[] args) {
    MechModel mechMod = new MechModel("mechMod");
    mechMod.setGravity(0, 0, -9.8);
    mechMod.setFrameDamping(1.0);
    mechMod.setRotaryDamping(4.0);
    // mechMod.setIntegrator (MechSystemSolver.Integrator.BackwardEuler);
    // create9LinkLoop (mechMod);
    // create3LinkPlaneCollider (mechMod);
    // createLadderPlaneCollider (mechMod);
    // createCollidingLinkage (mechMod);
    // createLongLinkage (mechMod, 6);
    usePlanarContacts = true;
    createLongLinkage(mechMod, new Point3d(-5, 2, 10), new Point3d(15, 2, 5), 20, 0.5, 10);
    createLongLinkage(mechMod, new Point3d(5, -2, 10), new Point3d(-15, -2, 5), 20, 0.5, 10);
    mechMod.setBounds(new Point3d(0, 0, -10), new Point3d(0, 0, 10));
    mechMod.setProfiling(true);
    addModel(mechMod);
    addControlPanel(mechMod);
}
Also used : MechModel(artisynth.core.mechmodels.MechModel)

Example 57 with MechModel

use of artisynth.core.mechmodels.MechModel in project artisynth_core by artisynth.

the class QuadraticLockingDemo method build.

public void build(String[] args) {
    myTetMod = new FemModel3d("tet");
    FemFactory.createTetGrid(myTetMod, WIDTH, WIDTH, LENGTH, NX, NY, NZ);
    myTetMod.transformGeometry(new RigidTransform3d(-3 * WIDTH / 4, 0, 0));
    setModelProperties(myTetMod);
    myQuadtetMod = new FemModel3d("quadtet");
    FemFactory.createQuadtetGrid(myQuadtetMod, WIDTH, WIDTH, LENGTH, NX, NY, NZ);
    setModelProperties(myQuadtetMod);
    myQuadtetMod.transformGeometry(new RigidTransform3d(3 * WIDTH / 4, 0, 0));
    myHexMod = new FemModel3d("hex");
    FemFactory.createHexGrid(myHexMod, WIDTH, WIDTH, LENGTH, NX, NY, NZ);
    setModelProperties(myHexMod);
    myHexMod.transformGeometry(new RigidTransform3d(9 * WIDTH / 4, 0, 0));
    myMechMod = new MechModel("mech");
    myMechMod.addModel(myTetMod);
    myMechMod.addModel(myQuadtetMod);
    myMechMod.addModel(myHexMod);
    addModel(myMechMod);
    addControlPanel();
}
Also used : RigidTransform3d(maspack.matrix.RigidTransform3d) MechModel(artisynth.core.mechmodels.MechModel) FemModel3d(artisynth.core.femmodels.FemModel3d)

Example 58 with MechModel

use of artisynth.core.mechmodels.MechModel in project artisynth_core by artisynth.

the class SimpleCollide method attach.

public void attach(DriverInterface driver) {
    super.attach(driver);
    MechModel mechMod = (MechModel) models().get(0);
// mechMod.rigidBodies().get(0).setDynamic(false);
// NumericInputProbe inprobe =
// new NumericInputProbe(
// mechMod, "rigidBodies/0:position", 0, 5);
// inprobe.addData (2.5, new Point3d(0,0,0.8));
// addInputProbe (inprobe);
}
Also used : MechModel(artisynth.core.mechmodels.MechModel)

Example 59 with MechModel

use of artisynth.core.mechmodels.MechModel in project artisynth_core by artisynth.

the class DoubleArmDemo method build.

public void build(String[] args) {
    model = new MechModel("Arm");
    addModel(model);
    model.setIntegrator(MechSystemSolver.Integrator.RungeKutta4);
    model.setMaxStepSize(0.01);
    setupRenderProps();
    addRigidBodies();
    addJoint();
    addMuscles();
    addEndPoint();
    addPanel();
}
Also used : MechModel(artisynth.core.mechmodels.MechModel)

Aggregations

MechModel (artisynth.core.mechmodels.MechModel)59 RigidBody (artisynth.core.mechmodels.RigidBody)25 RigidTransform3d (maspack.matrix.RigidTransform3d)19 FemModel3d (artisynth.core.femmodels.FemModel3d)14 FemNode3d (artisynth.core.femmodels.FemNode3d)8 Particle (artisynth.core.mechmodels.Particle)8 PolygonalMesh (maspack.geometry.PolygonalMesh)8 Vector3d (maspack.matrix.Vector3d)8 RevoluteJoint (artisynth.core.mechmodels.RevoluteJoint)7 LinearMaterial (artisynth.core.materials.LinearMaterial)6 FrameMarker (artisynth.core.mechmodels.FrameMarker)6 CollisionManager (artisynth.core.mechmodels.CollisionManager)5 Color (java.awt.Color)5 AxialSpring (artisynth.core.mechmodels.AxialSpring)4 BodyConnector (artisynth.core.mechmodels.BodyConnector)4 WayPoint (artisynth.core.probes.WayPoint)4 Point3d (maspack.matrix.Point3d)4 MultiPointSpring (artisynth.core.mechmodels.MultiPointSpring)3 PlanarConnector (artisynth.core.mechmodels.PlanarConnector)3 FemElement3d (artisynth.core.femmodels.FemElement3d)2