Skip to content

ShapeModel ¤

ShapeModel(name: str | None = None, verbose: bool = False)

Model for shape combinations.

Functions¤

add_box ¤

add_box(box: Box) -> tuple[int, int]

Add a box to the model.

add_cylinder ¤

add_cylinder(cylinder: Cylinder) -> tuple[int, int]

Add a cylinder to the model.

add_sphere ¤

add_sphere(sphere: Sphere) -> tuple[int, int]

Add a sphere to the model.

boolean_difference ¤

boolean_difference(
    A: list[tuple[int, int]],
    B: list[tuple[int, int]],
    remove_objects: bool = True,
    remove_tools: bool = True,
) -> list[tuple[int, int]]

Boolean difference of two sets of shapes.

Parameters:

  • A (list of tuple) –

    The dimtags of the object shapes.

  • B (tuple) –

    The dimtags of the tool shapes.

Returns:

Notes

The objects are the shapes to which the boolean operation should be applied. The tools are the shapes used to perform the operation.

boolean_fragment ¤

boolean_fragment(
    A: list[tuple[int, int]],
    B: list[tuple[int, int]],
    remove_objects: bool = True,
    remove_tools: bool = True,
) -> list[tuple[int, int]]

Boolean fragment of two sets of shapes.

Parameters:

  • A (list of tuple) –

    The dimtags of the object shapes.

  • B (tuple) –

    The dimtags of the tool shapes.

Returns:

Notes

The objects are the shapes to which the boolean operation should be applied. The tools are the shapes used to perform the operation.

boolean_intersection ¤

boolean_intersection(
    A: list[tuple[int, int]],
    B: list[tuple[int, int]],
    remove_objects: bool = True,
    remove_tools: bool = True,
) -> list[tuple[int, int]]

Boolean intersection of two sets of shapes.

Parameters:

Returns:

Notes

The objects are the shapes to which the boolean operation should be applied. The tools are the shapes used to perform the operation.

boolean_union ¤

boolean_union(
    A: list[tuple[int, int]],
    B: list[tuple[int, int]],
    remove_objects: bool = True,
    remove_tools: bool = True,
) -> list[tuple[int, int]]

Boolean union of two sets of shapes.

Parameters:

  • A (list of tuple) –

    The dimtags of the object shapes.

  • B (tuple) –

    The dimtags of the tool shapes.

Returns:

Notes

The objects are the shapes to which the boolean operation should be applied. The tools are the shapes used to perform the operation.