fabex.utilities.curve_utils#

Functions#

curve_to_shapely(cob[, use_modifiers])

Convert a curve object to Shapely polygons.

mesh_from_curve(o[, use_modifiers])

Create a Mesh Object from a Curve Object

mesh_from_curve_to_chunk(object)

Convert a Curve Object to a Mesh and then to a CAM path chunk

curve_to_chunks(o[, use_modifiers])

Convert a Curve Object into CAM path chunks

Module Contents#

curve_to_shapely(cob, use_modifiers=False)[source]#

Convert a curve object to Shapely polygons.

This function takes a curve object and converts it into a list of Shapely polygons. It first breaks the curve into chunks and then transforms those chunks into Shapely-compatible polygon representations. The use_modifiers parameter allows for additional processing of the curve before conversion, depending on the specific requirements of the application.

Parameters:
  • cob – The curve object to be converted.

  • use_modifiers (bool) – A flag indicating whether to apply modifiers during the conversion process. Defaults to False.

Returns:

A list of Shapely polygons created from the curve object.

Return type:

list

mesh_from_curve(o, use_modifiers=False)[source]#

Create a Mesh Object from a Curve Object

This function converts a curve object into a mesh object, maintaining parent-child relationships, applying transforms, deleting the old curve object and returning the mesh as the active object.

mesh_from_curve_to_chunk(object)[source]#

Convert a Curve Object to a Mesh and then to a CAM path chunk

This function uses ‘mesh_from_curve’ and ‘CamPathChunkBuilder’ to convert a Curve object into a Mesh, then sample the points and edges of the mesh to create and return a list of CAM path chunks.

curve_to_chunks(o, use_modifiers=False)[source]#

Convert a Curve Object into CAM path chunks

This function uses ‘mesh_from_curve’ and ‘mesh_from_curve_to_chunk’ to convert a Curve object into CAM path chunks, deletes the Curve object and returns the CAM path chunks.