The functions included in the
trimming module are still work-in-progress and their
functionality can change or they can be removed from the library in the next releases.
Please contact the author if you encounter any problems.
map_trim_to_geometry(obj, trim_idx=-1, **kwargs)¶
Generates 3-dimensional mapping of 2-dimensional trimming curves.
Trimming curves are defined on the parametric space of the surfaces. Therefore, all trimming curves are 2-dimensional. The coordinates of the trimming curves correspond to (u, v) parameters of the underlying surface geometry. When these (u, v) values are evaluated with respect to the underlying surface geometry, a 3-dimensional representation of the trimming curves is generated.
The resultant 3-dimensional curve is described using
freeform.Freeformclass. Using the
fittingmodule, it is possible to generate the B-spline form of the freeform curve.
If trim_idx=-1, the function maps all 2-dimensional trims to their 3-dimensional correspondants.
- obj (abstract.SplineGeometry) – spline geometry
- trim_idx (int) – index of the trimming curve in the geometry object
3-dimensional mapping of trimming curve(s)
Fixes direction, connectivity and similar issues of the trim curves.
This function works for surface trims in curve containers, i.e. trims consisting of multiple curves.
- Keyword Arguments:
tol: tolerance value for comparing floats. Default: 10e-8
delta: evaluation delta of the trim curves. Default: 0.05
Parameters: obj (abstract.BSplineGeometry, multi.AbstractContainer) – input surface Returns: updated surface