Transformations (Python)¶
Transformations¶
Generating Matrices¶
- FnGeolibServices.XFormUtil.CalcTransformMatrixAtTime(attr: object, time: float) Tuple[PyFnAttribute.DoubleAttribute, bool] ¶
Calculates the transform contained in the given GroupAttribute at the given time. Returns a 2-tuple, where the first member is a DoubleAttribute containing the 4x4 transform matrix, and the second member is a boolean indicating whether there is a fixed origin. If attr is None, the 4x4 identity matrix is returned.
- FnGeolibServices.XFormUtil.CalcTransformMatrixAtTimes(attr: PyFnAttribute.GroupAttribute, times: List[float]) Tuple[PyFnAttribute.DoubleAttribute, bool] ¶
Calculates the transform contained in the given GroupAttribute at the given time. Returns a 2-tuple, where the first member is a DoubleAttribute containing the 4x4 transform matrices with a time sample per requested time, and the second member is a boolean indicating whether there is a fixed origin.
- FnGeolibServices.XFormUtil.CalcTransformMatrixAtExistingTimes(attr: PyFnAttribute.GroupAttribute) Tuple[PyFnAttribute.DoubleAttribute, bool] ¶
Calculates the transform contained in the given GroupAttribute at all relevant time samples time. Returns a 2-tuple, where the first member is a DoubleAttribute containing the 4x4 transform matrices with a time sample per requested time, and the second member is a boolean indicating whether there is a fixed origin.
Handling Bounds¶
- FnGeolibServices.XFormUtil.MergeBounds(bounds1: PyFnAttribute.DoubleAttribute, bounds2: PyFnAttribute.DoubleAttribute) PyFnAttribute.DoubleAttribute ¶
Returns the union of the two given bounds, as a DoubleAttribute.
- FnGeolibServices.XFormUtil.CalcTransformedBoundsAtExistingTimes(xform: PyFnAttribute.Attribute, bounds: PyFnAttribute.DoubleAttribute) PyFnAttribute.DoubleAttribute ¶
Returns the DoubleAttribute given by transforming the given bounds object by the given transform. The set of sample times in the result is the union of the set of sample times in xform and bounds.
- FnGeolibServices.XFormUtil.CollapseBoundsTimeSamples(bounds: PyFnAttribute.DoubleAttribute) PyFnAttribute.DoubleAttribute ¶
Returns a DoubleAttribute with a single sample time, whose value is the union of the given bounds across all time values.