Draft
Draft(solid, angle_deg, neutral_plane_name="XY") tapers faces so a part
can be pulled out of a mould or a casting. The faces keep their size on the
neutral plane and lean inward by angle_deg going along the pull direction,
which is that plane’s normal: "XY" pulls along +Z, "YZ" along +X, "XZ"
along +Y.
To draft about any other plane, pass it as neutral_plane= (it overrides
neutral_plane_name). The pull direction is that plane’s normal and faces keep
their size where they cross it. The boss at the back stands on a sketch plane
tilted 30° about X and is drafted about that same plane:
Draft(boss, 6, neutral_plane=tilted).
By default every planar face parallel to the pull direction (all the side
walls) is drafted. Pass edge_finder=FaceFinder(rule=…) to draft only some
faces.
Draft composes like any other modifier. The tray on the right is
Shell(Draft(Extrusion), 1.5): draft first, then hollow.
Parting-line draft
A moulded part is usually split between two mould halves along a parting
line, and its walls are drafted away from that line on both sides.
PartingLineDraft(solid, angle_deg, parting_plane=…) does that: the walls
keep their outline on the parting line and lean inward by angle_deg going up
and going down from it.
parting = self.xy().get_parallel_plane(12)
self.add_operation(PartingLineDraft(body, 6, parting_plane=parting))parting_plane=any Plane cutting the solid. Its normal is the pull direction.parting_edges=EdgeFinder(…)instead: the parting line is the plane of the selected edge chain (e.g. the edges where a boss meets its flange,EdgeFinder(InPlaneFinderRule(self.xy(), 6))). The edges must lie in one plane. The pull direction is that plane’s normal, oriented towards +Z (or +Y, +X for vertical planes).both_sides=Falsedrafts only the side the pull direction points to; the other side stays straight.face_finder=FaceFinder(…)picks the walls to draft (default: every planar face parallel to the pull direction).
The left block is drafted about a plane at mid-height. The orange part is drafted about the edge chain where its boss meets the flange: the flange tapers down, the boss tapers up.
Not supported: non-planar or stepped parting lines (a parting line that
jumps between heights). OpenCascade’s parting-line draft builder
(BRepOffsetAPI_MakeDraft) is not in this build. A parting plane that misses
the solid, or parting edges that are not coplanar, give a processing error.