MCPcopy
hub / github.com/CadQuery/cadquery / _update_prism_history

Function _update_prism_history

cadquery/occ_impl/shapes.py:7652–7685  ·  view source on GitHub ↗

Helper for prism history handling.

(
    ctx: Shape,
    base: Shape | None,
    faces: Shape,
    t: Real | Shape | tuple[Shape, Shape] | None,
    s_tmp: TopoDS_Shape,
    history: History | None,
    name: str | None,
    builders: Sequence[BuilderType],
)

Source from the content-addressed store, hash-verified

7650
7651
7652def _update_prism_history(
7653 ctx: Shape,
7654 base: Shape | None,
7655 faces: Shape,
7656 t: Real | Shape | tuple[Shape, Shape] | None,
7657 s_tmp: TopoDS_Shape,
7658 history: History | None,
7659 name: str | None,
7660 builders: Sequence[BuilderType],
7661) -> Shape:
7662 """
7663 Helper for prism history handling.
7664 """
7665
7666 _tracked = [ctx, faces]
7667 if isinstance(t, Shape):
7668 _tracked.append(t)
7669 elif isinstance(t, tuple):
7670 _tracked.extend(t)
7671
7672 if base is not None:
7673 _tracked.append(base)
7674
7675 _update_history(history, name, _tracked, *builders)
7676
7677 rv = _compound_or_shape(s_tmp)
7678
7679 # add last if extruding upto
7680 if isinstance(t, Shape) and history is not None:
7681 op = history[-1]
7682 if op._last_shape.size() == 0:
7683 op._last_shape = op.modified(t)
7684
7685 return rv
7686
7687
7688@multidispatch

Callers 1

prismFunction · 0.85

Calls 6

_update_historyFunction · 0.85
_compound_or_shapeFunction · 0.85
appendMethod · 0.80
extendMethod · 0.80
modifiedMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected