Search in sources :

Example 1 with InverseDistanceWeights

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;
}
Also used : Vector3d(maspack.matrix.Vector3d) ArrayList(java.util.ArrayList) VectorNd(maspack.matrix.VectorNd) InverseDistanceWeights(maspack.geometry.InverseDistanceWeights) Point(artisynth.core.mechmodels.Point)

Example 2 with InverseDistanceWeights

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;
}
Also used : InverseDistanceWeights(maspack.geometry.InverseDistanceWeights)

Aggregations

InverseDistanceWeights (maspack.geometry.InverseDistanceWeights)2 Point (artisynth.core.mechmodels.Point)1 ArrayList (java.util.ArrayList)1 Vector3d (maspack.matrix.Vector3d)1 VectorNd (maspack.matrix.VectorNd)1