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;
}
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);
}
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;
}
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);
}
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;
}
Aggregations