cut - Functions for cutting meshes at edges or points, like chamfer
This module provides the chamfer and bevel functions, and the associated tools.
multicut
, chamfer
, and bevel
are built in the same cutting algorithm. It cuts the mesh faces by propagation from the given edges. The cutting planes are determined by an offset vector from the original primitive (point or edge).
Most of the time you don’t need to set the offset yourself. It can be automatically calculated by several methods, depending on the shape you want to get. Those methods are called cutters
and are executed using planeoffsets.
End-user functions
chamfer
(mesh, indices, cutter)[source]chamfer
(mesh: Mesh, edges, cutter)chamfer
(web: Web, points, cutter)chamfer
(wire: Wire, points, cutter)Chamfer a Mesh/Web/Wire around the given edges/points, using the given cutter
This is a chamfer on edges around a cube corner
bevel
(mesh, indices, cutter)[source]bevel
(mesh: Mesh, edges, cutter, resolution=None)bevel
(obj: Web, points, cutter, resolution=None)bevel
(wire: Wire, points, cutter, resolution=None)Bevel a Mesh/Web/Wire around the given edges/points, using the given cutter
This is a bevel on edges around a cube corner
multicut
(mesh, indices, cutter)[source]multicut
(mesh: Mesh, edges, cutter, conn=None, prec=None, removal=None)multicut
(web: Web, points, cutter, conn=None, prec=None, removal=None)multicut
(wire: Wire, points, cutter)Cut a Mesh/Web/Wire around the given edges/points, using the given cutter
This is the result on edges around a cube corner
Cutters (cut methods)
Helpers
mesh_cut
(mesh, start, cutplane, stops, conn, prec, removal, cutghost=True)[source]Propagation cut for an edge
Start: the edge or point to start propagation from Cutplane: the plane cutting the faces. Its normal must be oriented toward the propagation area. Stops: the planes stopping the propagation. Their normal must be oriented toward the propagation area. Removal: the set in wich the function will put the indices of faces inside Cutghost: whether the function should propagate on faces already marked for removal (previously or during the propagation)
web_cut
(web, start, cutplane, conn, prec, removal)[source]Propagation cut for a point
Start: the edge or point to start propagation from Cutplane: the plane cutting the faces. Its normal must be oriented toward the propagation area.
planeoffsets
(mesh, edges, cutter)[source]Compute the offsets for cutting planes using the given method cutter is a tuple or a function
- function(fn1,fn2) -> offset
- fn1, fn2 are the adjacents face normals offset is the distance from segment to plane times the normal to the plane
- (‘method’, distance)
- the method is the string name of the method (a function named ‘cutter’+method existing in this module) distance depends on the method and is the numeric parameter of the method
tangentjunction
(points, match, normals, div)[source]Create a surface joining the given couples of points, tangent to the two sides
normals
is a dict {point: normal}