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

../_images/chamfer.png
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

../_images/bevel.png
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

../_images/multicut.png

Cutters (cut methods)

../_images/cutter.svg
cutter_width(width, fn1, fn2)[source]

Plane offset for a cut based on the width of the bevel

cutter_distance(depth, fn1, fn2)[source]

Plane offset for a cut based on the distance along the side faces

Warning

this cut method can be unstable at the moment

cutter_depth(dist, fn1, fn2)[source]

Plane offset for a cut based on the distance to the cutted edge

cutter_radius(depth, fn1, fn2)[source]

Plane offset for a cut based on the angle between faces

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}

tangentcorner(pts, lp, normals, div)[source]

Create a rounded surface tangent to the loop given normals is a dict {point: normal}

tangentend(points, edge, normals, div)[source]

Join a tangent surface resulting of tangentcorner or tangentjunction to a straight edge e normals is the same dict as for tangentcorner and tangentjunction