CSPrimMultiBox

class CSXCAD.CSPrimitives.CSPrimMultiBox

Bases: CSPrimitives

Multi-Box (Multi-Cube) Primitive.

A collection of axis-aligned boxes defined by (start, stop) pairs. Mostly used for already-discretized objects.

Use AddBox() to add individual boxes, or pass them via the boxes keyword argument.

Parameters:

boxes – list of (start, stop) pairs, each a length-3 array

AddBox(start, stop)

Add a box defined by start and stop coordinates.

Parameters:
  • start – (3,) array – lower corner

  • stop – (3,) array – upper corner

Returns:

self (for chaining)

ClearOverlap()

Remove any overlapping boxes.

DeleteBox(idx)

Delete box at index idx.

Parameters:

idx – int – box index (0-based)

GetBox(idx)

Get the start and stop coordinates of box idx.

Parameters:

idx – int – box index (0-based)

Returns:

(start, stop) tuple of (3,) ndarrays

GetQtyBoxes()

Return the number of boxes.