use of artisynth.core.materials.NullMaterial in project artisynth_core by artisynth.
the class LinearAuxiliaryTest method build.
@Override
public void build(String[] args) throws IOException {
super.build(args);
MechModel mech = new MechModel("mech");
addModel(mech);
double h = 0.1;
double r = 0.005;
LinearMaterial lmat = new LinearMaterial(50000, 0.45, true);
FemModel3d fem1 = createCylinder(h, r);
fem1.setName("auxiliary");
mech.addModel(fem1);
fem1.setMaterial(new NullMaterial());
AuxMaterialBundle bundle = new AuxMaterialBundle("mat");
for (FemElement3d elem : fem1.getElements()) {
bundle.addElement(new AuxMaterialElementDesc(elem));
}
fem1.addMaterialBundle(bundle);
bundle.setMaterial(lmat);
FemModel3d fem2 = createCylinder(h, r);
fem2.setName("linear");
fem2.setMaterial(lmat);
mech.addModel(fem2);
RigidTransform3d rot = new RigidTransform3d(Vector3d.ZERO, AxisAngle.ROT_Y_90);
fem1.transformGeometry(rot);
fem2.transformGeometry(rot);
fem2.transformGeometry(new RigidTransform3d(new Vector3d(0, 2 * r, 0), AxisAngle.IDENTITY));
RenderProps.setFaceColor(fem2, Color.MAGENTA);
addMonitor(new StiffnessErrorMonitor(fem1, fem2));
}
Aggregations