add_rib
Adds a reinforcing rib inside a PartDesign Body by converting an open sketch spine into a wall that fuses with surrounding material.
Instructions
Add a reinforcing rib/web inside a PartDesign Body by thickening an OPEN sketch profile into a wall that fuses with the body's surrounding material.
Args: body: handle of the PartDesign Body (from make_body) to add the rib to. sketch: handle of a sketch holding an OPEN spine (a single line, arc, or connected polyline) that defines where the rib runs. Must NOT be a closed loop. The sketch's attachment plane sets the rib's orientation. thickness: rib wall thickness in mm (> 0). midplane: if True (default) the wall is centered on the spine, growing thickness/2 to each side; if False it grows from one side. reversed: flip the extrusion sense (use if the rib lands on the wrong side of its sketch plane). name: object label.
Returns a dict: {handle (starts 'rib_'), name, volume (the whole Body's Shape.Volume in mm^3 after the rib — strictly greater than before the rib, since a rib only adds material), thickness}.
Fallback behaviour the caller should know: FreeCAD's native PartDesign::Rib type is unavailable in AnkusDrive's headless runtime, so the rib is built as an equivalent midplane PartDesign::Pad — the open spine is offset by +/-thickness/2 into a closed footprint and padded across the body so it reaches the surrounding walls. For the usual straight or smoothly-curved spine this matches a Rib; very intricate spines may differ from the native tool. Raises ValueError if the profile is closed/empty/degenerate or thickness <= 0, and RuntimeError if the rib adds no material (spine does not span between walls).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | ||
| name | No | Rib | |
| sketch | Yes | ||
| midplane | No | ||
| reversed | No | ||
| thickness | Yes |