Search in sources :

Example 1 with LinearAxialMuscle

use of artisynth.core.materials.LinearAxialMuscle in project artisynth_core by artisynth.

the class MultiPointMuscle method createLinear.

public static MultiPointMuscle createLinear(double maxForce, double maxLen) {
    MultiPointMuscle m = new MultiPointMuscle();
    LinearAxialMuscle mat = new LinearAxialMuscle();
    mat.setMaxForce(maxForce);
    mat.setMaxLength(maxLen);
    m.setMaterial(mat);
    return m;
}
Also used : LinearAxialMuscle(artisynth.core.materials.LinearAxialMuscle)

Example 2 with LinearAxialMuscle

use of artisynth.core.materials.LinearAxialMuscle in project artisynth_core by artisynth.

the class Muscle method setLinearMuscleMaterial.

public void setLinearMuscleMaterial(double maxF, double optL, double maxL, double pf) {
    LinearAxialMuscle mat = new LinearAxialMuscle();
    mat.setMaxForce(maxF);
    mat.setOptLength(optL);
    mat.setMaxLength(maxL);
    mat.setPassiveFraction(pf);
    setMaterial(mat);
}
Also used : LinearAxialMuscle(artisynth.core.materials.LinearAxialMuscle)

Example 3 with LinearAxialMuscle

use of artisynth.core.materials.LinearAxialMuscle in project artisynth_core by artisynth.

the class MultiPointMuscle method createLinear.

public static MultiPointMuscle createLinear() {
    MultiPointMuscle m = new MultiPointMuscle();
    m.setMaterial(new LinearAxialMuscle());
    return m;
}
Also used : LinearAxialMuscle(artisynth.core.materials.LinearAxialMuscle)

Example 4 with LinearAxialMuscle

use of artisynth.core.materials.LinearAxialMuscle in project artisynth_core by artisynth.

the class MultiMuscleDemo method build.

public void build(String[] args) {
    super.build(args);
    MechModel mechMod = (MechModel) models().get("mechMod");
    RigidBody block = mechMod.rigidBodies().get("block");
    Particle p0 = new Particle(0.1, 0, -size * 3, size / 2);
    p0.setDynamic(false);
    mechMod.addParticle(p0);
    Particle p1 = new Particle(0.1, 0, size * 3, size / 2);
    p1.setDynamic(false);
    mechMod.addParticle(p1);
    FrameMarker mkr0 = new FrameMarker();
    mechMod.addFrameMarker(mkr0, block, new Point3d(0, -size / 2, size / 2));
    FrameMarker mkr1 = new FrameMarker();
    mechMod.addFrameMarker(mkr1, block, new Point3d(0, size / 2, size / 2));
    MultiPointMuscle muscle = new MultiPointMuscle();
    LinearAxialMuscle mat = new LinearAxialMuscle();
    mat.setForceScaling(1);
    mat.setMaxForce(10);
    mat.setMaxLength(size);
    mat.setPassiveFraction(0.1);
    muscle.setMaterial(mat);
    muscle.addPoint(p0);
    muscle.addPoint(mkr0);
    muscle.addPoint(mkr1);
    muscle.addPoint(p1);
    mechMod.addMultiPointSpring(muscle);
    RenderProps.setLineColor(mechMod, Color.BLUE);
    RenderProps.setLineStyle(muscle, LineStyle.SPINDLE);
    RenderProps.setLineRadius(muscle, 0.1);
    RenderProps.setLineColor(muscle, Color.RED);
}
Also used : Particle(artisynth.core.mechmodels.Particle) LinearAxialMuscle(artisynth.core.materials.LinearAxialMuscle) MechModel(artisynth.core.mechmodels.MechModel) FrameMarker(artisynth.core.mechmodels.FrameMarker) Point3d(maspack.matrix.Point3d) RigidBody(artisynth.core.mechmodels.RigidBody) MultiPointMuscle(artisynth.core.mechmodels.MultiPointMuscle)

Example 5 with LinearAxialMuscle

use of artisynth.core.materials.LinearAxialMuscle in project artisynth_core by artisynth.

the class PointModel method addMuscle.

private Muscle addMuscle(Point p0, Point p1) {
    // Muscle m = Muscle.createLinear(muscleF, muscleMaxLen);
    Muscle m = new Muscle();
    // ConstantAxialMuscleMaterial mat = new ConstantAxialMuscleMaterial();
    LinearAxialMuscle mat = new LinearAxialMuscle();
    // PeckAxialMuscleMaterial mat = new PeckAxialMuscleMaterial();
    mat.setMaxForce(muscleF);
    mat.setMaxLength(muscleMaxLen);
    mat.setDamping(muscleD);
    mat.setOptLength(muscleOptLen);
    mat.setPassiveFraction(passiveFraction);
    mat.setForceScaling(muscleScaleFactor);
    m.setMaterial(mat);
    m.setRestLength(len);
    m.setFirstPoint(p0);
    m.setSecondPoint(p1);
    model.addAxialSpring(m);
    RenderProps.setLineColor(m, Color.RED);
    return m;
}
Also used : LinearAxialMuscle(artisynth.core.materials.LinearAxialMuscle) LinearAxialMuscle(artisynth.core.materials.LinearAxialMuscle) Muscle(artisynth.core.mechmodels.Muscle)

Aggregations

LinearAxialMuscle (artisynth.core.materials.LinearAxialMuscle)5 FrameMarker (artisynth.core.mechmodels.FrameMarker)1 MechModel (artisynth.core.mechmodels.MechModel)1 MultiPointMuscle (artisynth.core.mechmodels.MultiPointMuscle)1 Muscle (artisynth.core.mechmodels.Muscle)1 Particle (artisynth.core.mechmodels.Particle)1 RigidBody (artisynth.core.mechmodels.RigidBody)1 Point3d (maspack.matrix.Point3d)1