Skip to content

Mesh Operations

explode

Explode a solid outward by a vector, separating its components.

Syntax:

explode(obj, v)
obj.explode(v)

Parameters:

Parameter Type Description
obj solid The object to explode
v [x, y, z] or number Explosion vector or scalar

Examples:

from openscad import *

cube(5).explode([1, 1, 1]).show()

oversample

Subdivide mesh edges for finer geometric detail. This increases the number of triangles in the mesh.

Syntax:

oversample(obj, n, round=False)
obj.oversample(n, round=False)

Parameters:

Parameter Type Default Description
obj solid The object to oversample
n int Subdivision level
round bool False Round vertices toward a sphere

Examples:

from openscad import *

cube(5).oversample(2).show()

debug

Visualize mesh faces for debugging purposes. Colors faces to help identify geometry issues.

Syntax:

debug(obj, faces=False)
obj.debug(faces=False)

Parameters:

Parameter Type Default Description
obj solid The object to debug
faces bool False Show individual faces

Examples:

from openscad import *

cube(5).debug().show()

repair

Attempt to make a solid watertight (manifold). This is useful for fixing imported meshes that have holes, self-intersections, or other defects.

Syntax:

repair(obj, color=False)
obj.repair(color=False)

Parameters:

Parameter Type Default Description
obj solid The object to repair
color bool False Preserve color information

Examples:

from openscad import *

broken = osimport("broken_mesh.stl")
fixed = broken.repair()
fixed.show()

separate

Split a solid into its disconnected components. Returns a list of separate solid objects.

Syntax:

separate(obj)
obj.separate()

Parameters:

Parameter Type Description
obj solid The object to split

Returns: A list of separate solid objects.

Examples:

from openscad import *

combined = concat(cube(5), cube(5).right(20))
parts = separate(combined)
for p in parts:
    p.show()