Skip to content

Geometry

Runtime geometry collection utilities.

show

show(
    *geometry: Compound
    | Shape
    | Sequence[Compound | Shape]
    | Mapping[str, Compound | Shape],
) -> None

Provide built model geometry for display or use.

Info

With a Params subclass, call show with your built model geometry. Multiple show calls accumulate geometry in order.

With a Model subclass, return geometry from the build method instead of calling show.

Note

If show() is never called, bdbox falls back to scanning the script's globals for build123d.Shape instances, but calling show() manually is recommended.

Source code in bdbox/geometry.py
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
def show(
    *geometry: Compound
    | Shape
    | Sequence[Compound | Shape]
    | Mapping[str, Compound | Shape],
) -> None:
    """Provide built model geometry for display or use.

    Info:
        With a [``Params``][bdbox.parameters.parameters.Params] subclass,
        call `show` with your built model geometry. Multiple `show` calls
        accumulate geometry in order.

        With a [``Model``][bdbox.model.Model] subclass, return geometry
        from the [``build``][bdbox.model.Model.build] method instead of calling
        `show`.

    Note:
        If ``show()`` is never called, bdbox falls back to scanning the
        script's globals for [``build123d.Shape``][topology.Shape] instances,
        but calling ``show()`` manually is recommended.
    """
    Geometry.accumulate_geometry(*geometry)