Trimming

Tessellation

Please refer to tessellate.TrimTessellate for tessellating the surfaces with trims.

Function Reference

Warning

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.

geomdl.trimming.map_trim_to_geometry(obj, trim_idx=-1, **kwargs)

Generates 3-dimensional mapping of 2-dimensional trimming curves.

Description:

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.Freeform class. Using the fitting module, it is possible to generate the B-spline form of the freeform curve.

Remarks:

If trim_idx=-1, the function maps all 2-dimensional trims to their 3-dimensional correspondants.

Parameters:
  • obj (abstract.SplineGeometry) – spline geometry
  • trim_idx (int) – index of the trimming curve in the geometry object
Returns:

3-dimensional mapping of trimming curve(s)

Return type:

freeform.Freeform

geomdl.trimming.fix_multi_trim_curves(obj, **kwargs)

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
geomdl.trimming.fix_trim_curves(obj)

Fixes direction, connectivity and similar issues of the trim curves.

This function works for surface trim curves consisting of a single curve.

Parameters:obj (abstract.Surface) – input surface