Skip to content

Manufacturing features

import cadkit as ck

These objects belong in ck.Part(features={...}). Features run in dictionary insertion order. Dimensions and allowances use millimetres; angles use degrees. apply(body) returns a valid native Shape and describe() returns metadata; Part calls both at the appropriate boundary.

For entry-based cuts, at.origin is the entry face and +Z points into the material. A downward cut from the top of a 10 mm block uses ck.Frame(origin=(0, 0, 10), z=(0, 0, -1)). This differs from the mating-datum convention used by mounts.

A pattern repeats the feature at local XY sites. None means one site at (0, 0). Every cutting site must actually remove material; missed bodies and invalid results raise a feature-named error. A through cut needs an explicit depth that spans the material.

Round holes

Hole dataclass

Hole(
    diameter: float,
    depth: float,
    at: Frame = Frame(),
    pattern: object = None,
    through: bool = False,
)

A circular blind or through hole at one or more local sites.

Parameters:

Name Type Description Default
diameter float

Finished hole diameter in millimetres.

required
depth float

Positive cutting depth in millimetres from the entry datum.

required
at Frame

Entry-face frame whose +Z points into material.

Frame()
pattern object

PointPattern or PolarPattern; None means one hole at the origin.

None
through bool

Extend the exit by 0.1 mm to clear a face at the declared depth. A through hole still needs an explicit depth covering the material.

False

The entry extends 0.1 mm outside the part. A blind hole stops exactly at its declared floor. Every declared site must intersect the body.

CounterboredHole dataclass

CounterboredHole(
    diameter: float,
    depth: float,
    at: Frame = Frame(),
    pattern: object = None,
    through: bool = False,
    recess: object = None,
)

Bases: Hole

A Hole with a cylindrical recess measured from the entry face.

Parameters:

Name Type Description Default
diameter float

Finished through/pilot diameter in millimetres.

required
depth float

Total hole depth in millimetres.

required
at Frame

Entry frame, +Z into material.

Frame()
pattern object

Local hole sites or None for one site.

None
through bool

Extend the exit to clear a face at the declared depth.

False
recess object

Counterbore specification. Its diameter must exceed the hole diameter and its depth must leave a positive screw seat.

None

CountersunkHole dataclass

CountersunkHole(
    diameter: float,
    depth: float,
    at: Frame = Frame(),
    pattern: object = None,
    through: bool = False,
    head_diameter: float = 0,
    included_angle: float = 90,
)

Bases: Hole

A Hole with an explicit conical screw-head recess.

Parameters:

Name Type Description Default
diameter float

Finished throat diameter in millimetres.

required
depth float

Total cutting depth in millimetres.

required
at Frame

Entry frame, +Z into material.

Frame()
pattern object

Local hole sites or None.

None
through bool

Extend the exit to clear a face at the declared depth.

False
head_diameter float

Recess mouth diameter, larger than diameter.

0
included_angle float

Full cone angle in degrees, strictly between 0 and 180.

90

The derived recess depth must be less than the total hole depth. This feature is supported independently of countersunk hardware rendering.

recess_depth property

recess_depth

CounterboredHole uses ck.Counterbore. CountersunkHole produces a recess without requiring a rendered countersunk fastener; that hardware kind is currently unsupported.

Threaded pilots and bearing seats

TappedHole dataclass

TappedHole(
    thread: str,
    pilot_diameter: float,
    depth: float,
    at: Frame = Frame(),
    pattern: object = None,
    method: str = "tap-after-printing",
    thread_depth: float | None = None,
)

A pilot hole plus a recorded thread-manufacturing operation.

Parameters:

Name Type Description Default
thread str

Thread designation such as M3-0.5.

required
pilot_diameter float

Explicit drill/print pilot diameter in millimetres.

required
depth float

Pilot depth in millimetres.

required
at Frame

Entry frame, +Z into material.

Frame()
pattern object

Local sites or None.

None
method str

tap-after-printing, tap-after-machining, or self-tapping.

'tap-after-printing'
thread_depth float | None

Intended thread depth in millimetres; defaults to pilot depth. It cannot exceed the pilot depth.

None

Geometry is the pilot hole. This class records thread intent; it does not generate helical threads or choose the pilot diameter for a material.

BearingSeat dataclass

BearingSeat(
    nominal_diameter: float,
    allowance: float,
    depth: float,
    at: Frame = Frame(),
    pattern: object = None,
    through: bool = False,
    fit: str = "clearance",
)

A nominal cylindrical seat with an explicit diametral allowance.

Parameters:

Name Type Description Default
nominal_diameter float

Bearing's nominal mating diameter in millimetres.

required
allowance float

Added to diameter, not radius, in millimetres.

required
depth float

Cutting depth in millimetres.

required
at Frame

Entry frame, +Z into material.

Frame()
pattern object

Local sites or None.

None
through bool

Extend the exit beyond the declared depth.

False
fit str

clearance requires a nonnegative allowance; press requires a nonpositive allowance; transition accepts either sign.

'clearance'

The fit label is declared intent. Process calibration and physical trials remain necessary to establish the actual manufactured fit.

diameter property

diameter

Slots and nut traps

Slot dataclass

Slot(
    length: float,
    width: float,
    depth: float,
    at: Frame = Frame(),
    pattern: object = None,
    through: bool = False,
)

A rounded slot whose overall length includes both semicircular ends.

Parameters:

Name Type Description Default
length float

Overall local-X length in millimetres, at least width.

required
width float

Slot width in millimetres.

required
depth float

Cutting depth in millimetres.

required
at Frame

Entry frame, +Z into material; X defines the slot's long direction.

Frame()
pattern object

Local site translations or None.

None
through bool

Extend the exit beyond the declared depth.

False

NutPocket dataclass

NutPocket(
    across_flats: float,
    depth: float,
    at: Frame = Frame(),
    pattern: object = None,
    thread: str = "",
)

A hexagonal nut trap with a recorded installation operation.

Parameters:

Name Type Description Default
across_flats float

Finished pocket width across flats in millimetres.

required
depth float

Pocket depth in millimetres.

required
at Frame

Entry frame, +Z into material.

Frame()
pattern object

Local sites or None.

None
thread str

Required nut thread designation such as M3-0.5.

''

Supply the measured or calibrated pocket dimensions explicitly; the thread label does not select a catalogue nut or infer its external dimensions.

Shaft bores and seals

DBore dataclass

DBore(
    diameter: float,
    depth: float,
    at: Frame = Frame(),
    pattern: object = None,
    through: bool = False,
    flat: float = 0,
)

Bases: Hole

A shaft bore truncated at local X=flat, retaining material on the +X side.

Parameters:

Name Type Description Default
diameter float

Full circular bore diameter in millimetres.

required
depth float

Cutting depth in millimetres.

required
at Frame

Entry frame, +Z into material; +X points toward the retained flat.

Frame()
pattern object

Local sites or None.

None
through bool

Extend the exit beyond the declared depth.

False
flat float

Signed centre-to-flat distance in millimetres, strictly inside the bore radius. Positive values retain more than half the circular hole.

0

flat is a position, not the removed segment depth.

SealGroove dataclass

SealGroove(
    mean_radius: float,
    section_radius: float,
    at: Frame = Frame(),
)

A toroidal groove with explicit nominal radii.

Parameters:

Name Type Description Default
mean_radius float

Radius from the datum axis to the section centre, in millimetres.

required
section_radius float

Circular section radius in millimetres, smaller than the mean.

required
at Frame

Torus centre frame; its axis is local Z.

Frame()

The torus straddles the datum XY plane. Groove compression, squeeze, and seal material selection are not inferred or validated.

Reinforcement

Boss dataclass

Boss(
    diameter: float,
    depth: float,
    at: Frame = Frame(),
    pattern: object = None,
    limit: object = None,
)

Add cylindrical local reinforcement, optionally clipped by a native boundary.

Parameters:

Name Type Description Default
diameter float

Outer diameter in millimetres.

required
depth float

Height along positive local Z in millimetres.

required
at Frame

Base frame of the reinforcement.

Frame()
pattern object

Local XY sites or None.

None
limit object

Optional native Shape or zero-argument native builder restricting the reinforcement's outer envelope.

None

Added material must join the existing body and increase its volume. Features run in declared order: a later boss can restore earlier removed material.

See InsertBoss for a boss that also owns its insert pocket and installation intent.