Masking

Cut a rounded, chamfered or grooved profile into an edge, a corner or a face of a solid (BOSL2 masks2d.scad / masks3d.scad).

Two shapes of tool:

  • Mask2D builds the 2-D cutter cross-section you sweep along an edge – pass one as the children of edge_profile() or corner_profile().

  • Mask3D builds a finished 3-D cutter solid: subtract it to treat every selected edge or corner in one go.

The BOSL2 spellings (mask2d_roundover, mask3d_chamfer, …) remain as aliases of the factories, so existing code keeps working.

from pybosl2 import Anchor, Mask2D, cuboid

cuboid([30, 30, 20]).edge_profile(edges=[Anchor.TOP], children=Mask2D.roundover(4)).show()
Loading 3-D preview…

⬇ Download STL mesh

from pybosl2 import Mask3D, cuboid

(cuboid([30, 30, 30]) - Mask3D.roundover(4, size=(30, 30, 30))).show()
Loading 3-D preview…

⬇ Download STL mesh

API reference

Cut rounded edge/corner/face profiles into a cuboid (BOSL2 masks2d/masks3d).

class pybosl2.masking.Mask2D[source]

Bases: object

The 2-D cutter cross-sections (BOSL2’s mask2d_* family), as factories returning a Path2D.

Each returns the profile you sweep along an edge to cut it – pass one as the mask of edge_profile() / corner_profile(), or extrude it yourself. The BOSL2 spellings (mask2d_roundover and friends) remain as aliases of these.

Examples

from pybosl2 import Anchor, Mask2D, cuboid

cuboid([30, 30, 20]).edge_profile(edges=[Anchor.TOP], mask=Mask2D.roundover(4)).show()
Loading 3-D preview…

⬇ Download STL mesh

static roundover(radius=None, inset=0.0, excess=0.01, diameter=None, fn=None, fa=None, fs=None)[source]

Return the 2-D L-shaped cutter cross-section for rounding a 90-degree edge/corner to radius radius.

Parameters:
radius : float | None

Rounding radius.

inset : float | tuple[float, float]

Scalar or (x, y) inset of the rounding center from the corner (default 0).

excess : float

Amount the flat sides extend past the origin, for a clean boolean cut (default 0.01).

diameter : float | None

Rounding diameter (alternative to radius).

fn : int | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fn=...) value applies; fn=0 opts back out to fa/fs.

fa : float | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fa=...) value applies.

fs : float | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fs=...) value applies.

Returns:

A Path2D of the 2-D cutter cross-section.

Return type:

Path2D

static chamfer(width, height=None, excess=0.01)[source]

Return the 2-D L-shaped cutter cross-section for chamfering a 90-degree edge.

A symmetric chamfer needs one number; give height only for an asymmetric one. These were spelled x and y, which named the axes rather than the thing being described (SPEC S-26c).

Parameters:
width : float

Chamfer width, measured back along the first face.

height : float | None

Chamfer height, measured back along the second face (default: width, a symmetric 45-degree chamfer).

excess : float

Amount the flat sides extend past the origin, for a clean cut (default 0.01).

Returns:

A Path2D of the 2-D cutter cross-section.

Raises:

Bosl2ValueError – If width or a given height is not positive.

Return type:

Path2D

Examples

from pybosl2 import Anchor, Mask2D, cuboid

cuboid([30, 30, 20]).edge_profile(edges=[Anchor.TOP], mask=Mask2D.chamfer(4)).show()
Loading 3-D preview…

⬇ Download STL mesh

static cove(radius, excess=0.01, fn=None, fa=None, fs=None)[source]

Return the 2-D L-shaped cutter cross-section for a concave corner fillet (cove).

Parameters:
radius : float

Cove radius.

excess : float

Amount the flat sides extend past the origin, for a clean cut (default 0.01).

fn : int | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fn=...) value applies; fn=0 opts back out to fa/fs.

fa : float | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fa=...) value applies.

fs : float | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fs=...) value applies.

Return type:

Path2D

static tear(r, maxgap=None, fn=None, fa=None, fs=None)[source]

Return the 2-D L-shaped cutter cross-section with a teardrop-shaped profile.

Parameters:
r : float

Radius of the teardrop circle.

maxgap : float | None

Maximum gap height (unused, kept for compatibility).

fn : int | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fn=...) value applies; fn=0 opts back out to fa/fs.

fa : float | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fa=...) value applies.

fs : float | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fs=...) value applies.

Return type:

Path2D

static step(width, height=None, excess=0.01)[source]

Return the 2-D cutter cross-section for cutting a step profile in a corner.

A square step needs one number; give height only for a rectangular one. It used to require both, which SPEC D-2 allows only with a written justification and there is none: a step as deep as it is wide is the ordinary case.

Parameters:
width : float

Step width. The one thing no default can invent.

height : float | None

Step height (default: width, a square step).

excess : float

Amount the flat sides extend past the origin, for a clean cut (default 0.01).

Returns:

A Path2D of the 2-D cutter cross-section.

Raises:

Bosl2ValueError – If width or a given height is not positive.

Return type:

Path2D

Examples

from pybosl2 import Anchor, Mask2D, cuboid

cuboid([30, 30, 20]).edge_profile(edges=[Anchor.TOP], mask=Mask2D.step(4)).show()
Loading 3-D preview…

⬇ Download STL mesh

static groove(width, depth=None, chamfer=0.0, round_radius=0.0, excess=0.01, fn=None, fa=None, fs=None)[source]

Return the 2-D cutter cross-section for cutting a slot or groove.

Only width is required (SPEC D-2, P-3): half the width is the depth that reads as a groove rather than a slot, so that is what it derives when you do not say.

Parameters:
width : float

Groove width. The one thing no default can invent.

depth : float | None

Groove depth (default: half the width).

chamfer : float

Groove chamfer offset (unused, kept for compatibility).

round_radius : float

Groove corner rounding radius (unused, kept for compatibility).

excess : float

Amount the flat sides extend past the origin, for a clean cut (default 0.01).

fn : int | None

Arc smoothness override – fixed fragment count. Omitted, the ambient use_defaults(fn=...) value applies; fn=0 opts back out to fa/fs.

fa : float | None

Arc smoothness override – minimum fragment angle. Omitted, the ambient use_defaults(fa=...) value applies.

fs : float | None

Arc smoothness override – minimum fragment size. Omitted, the ambient use_defaults(fs=...) value applies.

Returns:

A Path2D of the 2-D cutter cross-section.

Raises:

Bosl2ValueError – If width or a given depth is not positive.

Return type:

Path2D

Examples

from pybosl2 import Anchor, Mask2D, cuboid

cuboid([30, 30, 20]).edge_profile(edges=[Anchor.TOP], mask=Mask2D.groove(4)).show()
Loading 3-D preview…

⬇ Download STL mesh

class pybosl2.masking.Mask3D[source]

Bases: object

The ready-made 3-D cutter solids (BOSL2’s mask3d_* family), as factories.

Unlike Mask2D, these are whole solids: subtract one from your shape to cut every selected edge or corner at once. The BOSL2 spellings remain as aliases of these.

Examples

from pybosl2 import Mask3D, cuboid

(cuboid([30, 30, 30]) - Mask3D.roundover(4, size=(30, 30, 30))).show()
Loading 3-D preview…

⬇ Download STL mesh

static roundover(radius=None, *, size, diameter=None, corners=Anchor.ALL, fn=None, fa=None, fs=None)[source]

Return the 3-D cutter that rounds the corners and edges of a box of the given size.

size is the box being cut, so it is only ever needed when you build the cutter yourself. Reaching for round_edges() instead is both shorter and safer – the solid already knows its own box and fills this in (SPEC S-26a, S-26b):

solid.round_edges(Anchor.TOP, radius=3)
Parameters:
radius : float | None

Rounding radius.

size : tuple[float, float, float]

Size of the box being cut, (x, y, z). Keyword-only, because it describes the parent, not the treatment.

diameter : float | None

Rounding diameter (alternative to radius; giving both is an error).

corners : Anchor

Corners to select.

fn : int | None

Arc smoothness override – fixed fragment count. Omitted, the ambient use_defaults(fn=...) value applies; fn=0 opts back out to fa/fs.

fa : float | None

Arc smoothness override – minimum fragment angle. Omitted, the ambient use_defaults(fa=...) value applies.

fs : float | None

Arc smoothness override – minimum fragment size. Omitted, the ambient use_defaults(fs=...) value applies.

Returns:

The cutter solid; subtract it from the box to round it.

Raises:

Bosl2ValueError – If neither radius nor diameter is given, if both are, or if corners selects nothing.

Return type:

Solid

Examples

from pybosl2 import Mask3D, cuboid

(cuboid([30, 30, 30]) - Mask3D.roundover(4, size=(30, 30, 30))).show()
Loading 3-D preview…

⬇ Download STL mesh

static chamfer(chamfer, *, size, corners=Anchor.ALL)[source]

Return the 3-D cutter that chamfers the corners and edges of a box of the given size.

As with roundover(), size describes the box being cut; chamfer_edges() fills it in for you (SPEC S-26a).

Parameters:
chamfer : float

Chamfer distance.

size : tuple[float, float, float]

Size of the box being cut, (x, y, z). Keyword-only – it describes the parent, not the treatment.

corners : Anchor

Corners to select.

Returns:

The cutter solid; subtract it from the box to chamfer it.

Raises:

Bosl2ValueError – If corners selects nothing.

Return type:

Solid

Examples

from pybosl2 import Mask3D, cuboid

(cuboid([30, 30, 30]) - Mask3D.chamfer(4, size=(30, 30, 30))).show()
Loading 3-D preview…

⬇ Download STL mesh

static groove(width, *, depth=None, length=None, chamfer=0.0, size=None)[source]

Return the 3-D cutter for a slot or groove of the given width.

Only width is required (SPEC D-2): a groove’s depth follows from its width unless you say otherwise – half the width is the proportion that reads as a groove rather than a slot – and its length is however long the thing being grooved is, which size supplies when you pass it and groove_edges() supplies for you (SPEC P-3, S-26a). This took three required positionals, which SPEC D-2 says is never acceptable.

Parameters:
width : float

Groove width. The one thing no default can invent.

depth : float | None

Groove depth (default: half the width).

length : float | None

Groove length (default: the longest side of size, or ten times the width if no size is given either).

chamfer : float

Groove chamfer offset.

size : tuple[float, float, float] | None

Size of the thing being grooved, (x, y, z), used to derive length.

Returns:

The cutter solid, extruded along Z and centred.

Raises:

Bosl2ValueError – If width is not positive, or a given depth is not positive.

Return type:

Solid

Examples

from pybosl2 import Mask3D, cuboid

(cuboid([40, 40, 12]) - Mask3D.groove(6, length=60)).show()
Loading 3-D preview…

⬇ Download STL mesh

pybosl2.masking.chamfer_edge_mask(length=1.0, chamfer=1.0, excess=0.1)[source]

Return a standalone 3-D edge-chamfer cutter of length length, on the active backend.

A diamond bar centred on its own Z axis: a square prism of side chamfer * sqrt(2), turned 45 degrees, so it reaches chamfer along each axis.

It is built as a turned prism rather than an extruded diamond polygon so that it works on either backend – polygon().linear_extrude() is a CSG-only construction, and this cutter is what cubetruss and tripod_mounts chamfer with, so it was the thing keeping them CSG-only (TASKS T14). The two forms were checked to give the same solid and the same cut.

Parameters:
length : float

Length of the cutter along its axis (default 1).

chamfer : float

Chamfer size (the diamond’s half-diagonal along each axis, default 1).

excess : float

Extra length past length so the cut clears the surface (default 0.1).

Returns:

The cutter, built by whichever backend is active.

Return type:

Solid

pybosl2.masking.corner_profile(body, corners=Anchor.ALL, except_corners=None, radius=None, diameter=None, size=None, mask=None, convexity=10, anchor=Anchor.CENTER, center=None, fn=None, fa=None, fs=None, return_cutter=False)[source]

Round each selected corner of the box-shaped body to radius radius.

Parameters:
body : Bosl2Solid

The box solid to cut.

corners : Anchor

Corners to mask — "ALL"/"NONE", a face vector, or a corner vector.

except_corners : list[Anchor] | None

Corners to explicitly not mask.

radius : float | None

Rounding radius.

diameter : float | None

Rounding diameter (alternative to radius).

size : tuple[float, float, float] | None

The box’s (x, y, z) size.

mask : Path2D | None

Accepted for call-site compatibility; unused – corner_profile always rounds.

convexity : int

Accepted for signature compatibility; unused.

anchor : Anchor | Point

The anchor body was built with (default CENTER).

center : Point | None

The box center in body’s current frame.

fn : int | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fn=...) value applies; fn=0 opts back out to fa/fs.

fa : float | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fa=...) value applies.

fs : float | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fs=...) value applies.

return_cutter : bool

If True, returns the generated cutter shape instead of cutting it.

Return type:

Solid | None

pybosl2.masking.edge_mask(body, edges=Anchor.ALL, except_edges=None, mask=None, size=None, anchor=Anchor.CENTER, center=None, return_cutter=False)[source]

Cut a 3-D edge cutter along each selected edge of the box-shaped body.

Parameters:
body : Bosl2Solid

The box solid to cut.

edges : EdgeAtom | list[EdgeAtom]

Edges to mask — an EdgePlane, a string, a vector, or a list thereof (default "ALL").

except_edges : list[EdgeAtom] | None

Edges to explicitly not mask.

mask : Solid | None

The 3-D edge cutter to apply.

size : tuple[float, float, float] | None

The box’s (x, y, z) size.

anchor : Anchor | Point

The anchor body was built with (default CENTER).

center : Point | None

The box center in body’s current frame.

return_cutter : bool

If True, returns the generated cutter shape instead of cutting it.

Return type:

Solid | None

pybosl2.masking.edge_profile(body, edges=Anchor.ALL, except_edges=None, mask=None, size=None, convexity=10, anchor=Anchor.CENTER, center=None, return_cutter=False)[source]

Cut a 2-D mask profile extruded along each selected edge of the box-shaped body.

Parameters:
body : Bosl2Solid

The box solid to cut.

edges : EdgeAtom | list[EdgeAtom]

Edges to mask (default "ALL").

except_edges : list[EdgeAtom] | None

Edges to explicitly not mask.

mask : Path2D | None

The 2-D mask cross-section, as a Path2D.

size : tuple[float, float, float] | None

The box’s (x, y, z) size.

convexity : int

Accepted for signature compatibility; unused.

anchor : Anchor | Point

The anchor body was built with (default CENTER).

center : Point | None

The box center in body’s current frame.

return_cutter : bool

If True, returns the generated cutter shape instead of cutting it.

Return type:

Solid | None

pybosl2.masking.face_profile(body, faces=Anchor.ALL, radius=None, diameter=None, size=None, mask=None, convexity=10, anchor=Anchor.CENTER, center=None, fn=None, fa=None, fs=None, return_cutter=False)[source]

Round all edges and corners bounding the given face(s) of the box-shaped body.

Parameters:
body : Bosl2Solid

The box solid to cut.

faces : Anchor | list[Anchor]

Face(s) to round, e.g. TOP, or "ALL" (default).

radius : float | None

Rounding radius.

diameter : float | None

Rounding diameter (alternative to radius).

size : tuple[float, float, float] | None

The box’s (x, y, z) size.

mask : Path2D | None

The 2-D mask cross-section, as a Path2D; defaults to Mask2D.roundover(radius).

convexity : int

Accepted for signature compatibility; unused.

anchor : Anchor | Point

The anchor body was built with (default CENTER).

center : Point | None

The box center in body’s current frame.

fn : int | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fn=...) value applies; fn=0 opts back out to fa/fs.

fa : float | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fa=...) value applies.

fs : float | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fs=...) value applies.

return_cutter : bool

If True, returns the generated cutter shape instead of cutting it.

Return type:

Solid | None

pybosl2.masking.mask2d_chamfer(width, height=None, excess=0.01)

Return the 2-D L-shaped cutter cross-section for chamfering a 90-degree edge.

A symmetric chamfer needs one number; give height only for an asymmetric one. These were spelled x and y, which named the axes rather than the thing being described (SPEC S-26c).

Parameters:
width : float

Chamfer width, measured back along the first face.

height : float | None

Chamfer height, measured back along the second face (default: width, a symmetric 45-degree chamfer).

excess : float

Amount the flat sides extend past the origin, for a clean cut (default 0.01).

Returns:

A Path2D of the 2-D cutter cross-section.

Raises:

Bosl2ValueError – If width or a given height is not positive.

Return type:

Path2D

Examples

from pybosl2 import Anchor, Mask2D, cuboid

cuboid([30, 30, 20]).edge_profile(edges=[Anchor.TOP], mask=Mask2D.chamfer(4)).show()
Loading 3-D preview…

⬇ Download STL mesh

pybosl2.masking.mask2d_cove(radius, excess=0.01, fn=None, fa=None, fs=None)

Return the 2-D L-shaped cutter cross-section for a concave corner fillet (cove).

Parameters:
radius : float

Cove radius.

excess : float

Amount the flat sides extend past the origin, for a clean cut (default 0.01).

fn : int | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fn=...) value applies; fn=0 opts back out to fa/fs.

fa : float | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fa=...) value applies.

fs : float | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fs=...) value applies.

Return type:

Path2D

pybosl2.masking.mask2d_groove(width, depth=None, chamfer=0.0, round_radius=0.0, excess=0.01, fn=None, fa=None, fs=None)

Return the 2-D cutter cross-section for cutting a slot or groove.

Only width is required (SPEC D-2, P-3): half the width is the depth that reads as a groove rather than a slot, so that is what it derives when you do not say.

Parameters:
width : float

Groove width. The one thing no default can invent.

depth : float | None

Groove depth (default: half the width).

chamfer : float

Groove chamfer offset (unused, kept for compatibility).

round_radius : float

Groove corner rounding radius (unused, kept for compatibility).

excess : float

Amount the flat sides extend past the origin, for a clean cut (default 0.01).

fn : int | None

Arc smoothness override – fixed fragment count. Omitted, the ambient use_defaults(fn=...) value applies; fn=0 opts back out to fa/fs.

fa : float | None

Arc smoothness override – minimum fragment angle. Omitted, the ambient use_defaults(fa=...) value applies.

fs : float | None

Arc smoothness override – minimum fragment size. Omitted, the ambient use_defaults(fs=...) value applies.

Returns:

A Path2D of the 2-D cutter cross-section.

Raises:

Bosl2ValueError – If width or a given depth is not positive.

Return type:

Path2D

Examples

from pybosl2 import Anchor, Mask2D, cuboid

cuboid([30, 30, 20]).edge_profile(edges=[Anchor.TOP], mask=Mask2D.groove(4)).show()
Loading 3-D preview…

⬇ Download STL mesh

pybosl2.masking.mask2d_roundover(radius=None, inset=0.0, excess=0.01, diameter=None, fn=None, fa=None, fs=None)

Return the 2-D L-shaped cutter cross-section for rounding a 90-degree edge/corner to radius radius.

Parameters:
radius : float | None

Rounding radius.

inset : float | tuple[float, float]

Scalar or (x, y) inset of the rounding center from the corner (default 0).

excess : float

Amount the flat sides extend past the origin, for a clean boolean cut (default 0.01).

diameter : float | None

Rounding diameter (alternative to radius).

fn : int | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fn=...) value applies; fn=0 opts back out to fa/fs.

fa : float | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fa=...) value applies.

fs : float | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fs=...) value applies.

Returns:

A Path2D of the 2-D cutter cross-section.

Return type:

Path2D

pybosl2.masking.mask2d_step(width, height=None, excess=0.01)

Return the 2-D cutter cross-section for cutting a step profile in a corner.

A square step needs one number; give height only for a rectangular one. It used to require both, which SPEC D-2 allows only with a written justification and there is none: a step as deep as it is wide is the ordinary case.

Parameters:
width : float

Step width. The one thing no default can invent.

height : float | None

Step height (default: width, a square step).

excess : float

Amount the flat sides extend past the origin, for a clean cut (default 0.01).

Returns:

A Path2D of the 2-D cutter cross-section.

Raises:

Bosl2ValueError – If width or a given height is not positive.

Return type:

Path2D

Examples

from pybosl2 import Anchor, Mask2D, cuboid

cuboid([30, 30, 20]).edge_profile(edges=[Anchor.TOP], mask=Mask2D.step(4)).show()
Loading 3-D preview…

⬇ Download STL mesh

pybosl2.masking.mask2d_tear(r, maxgap=None, fn=None, fa=None, fs=None)

Return the 2-D L-shaped cutter cross-section with a teardrop-shaped profile.

Parameters:
r : float

Radius of the teardrop circle.

maxgap : float | None

Maximum gap height (unused, kept for compatibility).

fn : int | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fn=...) value applies; fn=0 opts back out to fa/fs.

fa : float | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fa=...) value applies.

fs : float | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fs=...) value applies.

Return type:

Path2D

pybosl2.masking.mask3d_chamfer(chamfer, *, size, corners=Anchor.ALL)

Return the 3-D cutter that chamfers the corners and edges of a box of the given size.

As with roundover(), size describes the box being cut; chamfer_edges() fills it in for you (SPEC S-26a).

Parameters:
chamfer : float

Chamfer distance.

size : tuple[float, float, float]

Size of the box being cut, (x, y, z). Keyword-only – it describes the parent, not the treatment.

corners : Anchor

Corners to select.

Returns:

The cutter solid; subtract it from the box to chamfer it.

Raises:

Bosl2ValueError – If corners selects nothing.

Return type:

Solid

Examples

from pybosl2 import Mask3D, cuboid

(cuboid([30, 30, 30]) - Mask3D.chamfer(4, size=(30, 30, 30))).show()
Loading 3-D preview…

⬇ Download STL mesh

pybosl2.masking.mask3d_groove(width, *, depth=None, length=None, chamfer=0.0, size=None)

Return the 3-D cutter for a slot or groove of the given width.

Only width is required (SPEC D-2): a groove’s depth follows from its width unless you say otherwise – half the width is the proportion that reads as a groove rather than a slot – and its length is however long the thing being grooved is, which size supplies when you pass it and groove_edges() supplies for you (SPEC P-3, S-26a). This took three required positionals, which SPEC D-2 says is never acceptable.

Parameters:
width : float

Groove width. The one thing no default can invent.

depth : float | None

Groove depth (default: half the width).

length : float | None

Groove length (default: the longest side of size, or ten times the width if no size is given either).

chamfer : float

Groove chamfer offset.

size : tuple[float, float, float] | None

Size of the thing being grooved, (x, y, z), used to derive length.

Returns:

The cutter solid, extruded along Z and centred.

Raises:

Bosl2ValueError – If width is not positive, or a given depth is not positive.

Return type:

Solid

Examples

from pybosl2 import Mask3D, cuboid

(cuboid([40, 40, 12]) - Mask3D.groove(6, length=60)).show()
Loading 3-D preview…

⬇ Download STL mesh

pybosl2.masking.mask3d_roundover(radius=None, *, size, diameter=None, corners=Anchor.ALL, fn=None, fa=None, fs=None)

Return the 3-D cutter that rounds the corners and edges of a box of the given size.

size is the box being cut, so it is only ever needed when you build the cutter yourself. Reaching for round_edges() instead is both shorter and safer – the solid already knows its own box and fills this in (SPEC S-26a, S-26b):

solid.round_edges(Anchor.TOP, radius=3)
Parameters:
radius : float | None

Rounding radius.

size : tuple[float, float, float]

Size of the box being cut, (x, y, z). Keyword-only, because it describes the parent, not the treatment.

diameter : float | None

Rounding diameter (alternative to radius; giving both is an error).

corners : Anchor

Corners to select.

fn : int | None

Arc smoothness override – fixed fragment count. Omitted, the ambient use_defaults(fn=...) value applies; fn=0 opts back out to fa/fs.

fa : float | None

Arc smoothness override – minimum fragment angle. Omitted, the ambient use_defaults(fa=...) value applies.

fs : float | None

Arc smoothness override – minimum fragment size. Omitted, the ambient use_defaults(fs=...) value applies.

Returns:

The cutter solid; subtract it from the box to round it.

Raises:

Bosl2ValueError – If neither radius nor diameter is given, if both are, or if corners selects nothing.

Return type:

Solid

Examples

from pybosl2 import Mask3D, cuboid

(cuboid([30, 30, 30]) - Mask3D.roundover(4, size=(30, 30, 30))).show()
Loading 3-D preview…

⬇ Download STL mesh

pybosl2.masking.rounding_edge_mask(length=None, radius=None, radius1=None, radius2=None, diameter=None, diameter1=None, diameter2=None, height=None, excess=0.1, fn=None, fa=None, fs=None)[source]

Return a standalone 3-D edge-rounding cutter of length length, for manual positioning.

Parameters:
length : float | None

Length of the cutter along its axis (default 1).

height : float | None

Length of the cutter along its axis (default 1).

radius : float | None

Rounding radius (both ends).

radius1 : float | None

Rounding radius at the first end, for a tapered cutter.

radius2 : float | None

Rounding radius at the second end, for a tapered cutter.

diameter : float | None

Rounding diameter (both ends).

diameter1 : float | None

Rounding diameter at the first end.

diameter2 : float | None

Rounding diameter at the second end.

excess : float

Amount the flat sides extend past the origin (default 0.1).

fn : int | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fn=...) value applies; fn=0 opts back out to fa/fs.

fa : float | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fa=...) value applies.

fs : float | None

Arc smoothness overrides. Omitted, the ambient use_defaults(fs=...) value applies.

Returns:

A Bosl2Solid cutter.

Return type:

Bosl2Solid