use of artisynth.core.mechmodels.PointParticleAttachment in project artisynth_core by artisynth.
the class MFreeMeshComp method writeVertexInfo.
private void writeVertexInfo(PrintWriter pw, Vertex3d vtx, NumberFormat fmt) {
PointAttachment pa = null;
if (vtx.getIndex() < myVertexAttachments.size()) {
pa = getAttachment(vtx.getIndex());
}
if (pa instanceof PointFem3dAttachment) {
PointFem3dAttachment pfa = (PointFem3dAttachment) pa;
FemNode[] masters = pfa.getNodes();
pw.print("v");
for (int j = 0; j < masters.length; j++) {
pw.print(" " + masters[j].getNumber() + " " + fmt.format(pfa.getCoordinate(j)));
}
pw.println("");
} else if (pa instanceof PointParticleAttachment) {
PointParticleAttachment ppa = (PointParticleAttachment) pa;
MFreeNode3d n = (MFreeNode3d) ppa.getParticle();
pw.println("v " + n.getNumber() + " 1.0");
} else {
pw.println("v -1 " + vtx.getPosition().toString(fmt));
}
}
Aggregations