Go to: Attributes.

The 'leastSquaresModifier' node modifies the control vertices of an input NURBS object such that the object passes through the XYZ position or gets as close as possible to the XYZ position of one or more specified point constraints. Only NURBS curves can be modified.

For a NURBS curve, the i-th point constraint 'pc[i]' is specified by a 3D point in space ('pc[i].ppx', 'pc[i].ppy', 'pc[i].ppz'), a parameter space location 'pc[i].pcu' on the curve and a weight 'pc[i].wt'.

For any given point constraint, only the control vertices on the curve which have a influence at the parameter space location are modified. The weight of the constraint determines how strong an influence the point constraint is. So, for two point constraints defined at the same parameter space location, the one with a greater weight will have more of an influence on the curve.

The user may chooses to apply a transformation on the computed result using the attribute 'wto'.

caution: In general, the curve cannot be modified always to passes through all the positions.

Node nameParentsClassificationMFn typeCompatible function sets

Attributes (19)

attributeCollection, inputCache, inputNurbsObject, objectModifier, outputNurbsObject, pointConstraint, pointConstraintU, pointConstraintUVW, pointConstraintV, pointConstraintW, pointPositionX, pointPositionXYZ, pointPositionY, pointPositionZ, pointSymbolicIndex, pointWeight, resetModifier, updatePointModifier, worldSpaceToObjectSpace

Long name (short name)TypeDefaultFlags
attributeCollection (ac) compoundn/aoutputinputstorable
Place holder housing an input NURBS object, constraints on the object and the modified NURBS object.
inputNurbsObject (ino) Genericn/aoutputinputconnectable
The input NURBS object to be modified.
worldSpaceToObjectSpace (wto) matrixidentityoutputinputconnectablestorable
Transform the result with matrix.
pointConstraint (pc) compoundn/aarrayoutputinputstorable
Place holder holding point constraints. A point constraint comprises of XYZ, UV, Wt information.
pointPositionXYZ (xyz) double3outputinputconnectable
Point constraint 3D XYZ location. The NURBS curve is modified to pass through this location.
pointPositionX (ppx) distance (double)-100000.0cmoutputinputconnectable
Point constraint 3D X coordinate.
pointPositionY (ppy) distance (double)-100000.0cmoutputinputconnectable
Point constraint 3D space Y coordinate.
pointPositionZ (ppz) distance (double)-100000.0cmoutputinputconnectable
Point constraint 3D space Z coordinate.
pointConstraintUVW (puv) double3outputinputconnectablestorable
Point constraint parameter space location on input NURBS Object
pointConstraintU (pcu) double-100000.0outputinputconnectablestorablehidden
Point constraint u parameter space location. The control vertices around this location are modified.
pointConstraintV (pcv) double-100000.0outputinputconnectablestorablehidden
Point constraint v parameter space location. Applicable only if NURBS object is a surface.
pointConstraintW (pcw) double-100000.0outputinputconnectablestorablehidden
Point constraints w parameter space location. Not used.
pointWeight (pw) double1.0outputinputconnectablestorable
Point constraint weight. Determines how strong an influence the constraint has on the input NURBS object.
outputNurbsObject (ono) GenericNULLoutputconnectable
Output NURBS object which meets the given point constraints.
objectModifier (om) lsqModifierNULLoutputinput
Internal attribute for the least squares modifier to solve and update.
resetModifier (rm) booltrueoutputinput
Internal attribute to reset the internal cached least squares modifier.
updatePointModifier (upm) booltrueoutputinput
Internal attribute to update the least squares point modifier.
inputCache (ipc) Genericn/aoutputinput
Internal cached copy of the input NURBS object.
pointSymbolicIndex (psi) compoundNULLoutputinput
Internal attribute to track symbolic index corresponding to each valid constraint.