CompositeShape

class CompositeShape(shape1: Shape, shape2: Shape, op: Callable)

A composition of 2 shapes using some operator (and, or, xor…)

This shape is usually not created directly but present the result of applying logical or arithmetic operators on other shapes.

Parameters:
shape1, shape2_cpp.Shape

The shapes which shall be composed.

opCallable

A logical operator (and, or, xor…) to use for the composition.

Attributes

lattice_offset

vertices

Methods

contains(x, y, z)

Return True if the given position is located within the shape

plot([resolution])

Plot a lightly shaded silhouette of the composite shape

with_offset(vector)

Return a copy that's offset by the given vector

contains(x: numpy.ndarray[numpy.float64[m, 1]], y: numpy.ndarray[numpy.float64[m, 1]], z: numpy.ndarray[numpy.float64[m, 1]])

Return True if the given position is located within the shape

Given arrays as input the return type is a boolean array.

Parameters:
x, y, zarray_like

Positions to test against the shape.

plot(resolution: Tuple[int, int] = (1000, 1000), **kwargs) AxesImage

Plot a lightly shaded silhouette of the composite shape

Parameters:
resolutionTuple[int, int]

The (x, y) pixel resolution of the generated image.

**kwargs

Forwarded to matplotlib.pyplot.imshow().

with_offset(vector: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) CompositeShape

Return a copy that’s offset by the given vector