use of maspack.geometry.InverseDistanceWeights in project artisynth_core by artisynth.
the class PointFem3dAttachment method setFromNodes.
public boolean setFromNodes(Point3d pos, FemNode[] nodes) {
ArrayList<Vector3d> support = new ArrayList<Vector3d>(nodes.length);
for (int i = 0; i < nodes.length; i++) {
support.add(nodes[i].getPosition());
}
InverseDistanceWeights idweights = new InverseDistanceWeights(1, 1, /*normalize=*/
true);
VectorNd weights = new VectorNd();
boolean status = idweights.compute(weights, pos, support);
dosetNodes(nodes, weights.getBuffer());
myElement = null;
return status;
}
use of maspack.geometry.InverseDistanceWeights in project artisynth_core by artisynth.
the class FrameFem3dAttachment method setFromNodes.
public boolean setFromNodes(RigidTransform3d TFW, FemNode3d[] nodes) {
ArrayList<Vector3d> support = new ArrayList<Vector3d>(nodes.length);
for (int i = 0; i < nodes.length; i++) {
support.add(nodes[i].getPosition());
}
InverseDistanceWeights idweights = new InverseDistanceWeights(1, 1, /*normalize=*/
true);
VectorNd weights = new VectorNd();
boolean status = idweights.compute(weights, TFW.p, support);
doSetFromNodes(nodes, weights.getBuffer());
updateDeformationGradient();
myRFD.mulInverseLeft(myPolard.getR(), TFW.R);
return status;
}
Aggregations