gdpc.geometry

Tools for placing geometrical shapes of blocks.

For nearly every function defined in this module, there is also an equivalent function in vector_tools that generates the points of the shape without placing any blocks.


placeCuboid(editor: Editor, first: Vec3iLike, last: Vec3iLike, block: Block | Sequence[Block], replace: str | list[str] | None = None) None

Places a box of block blocks from first to last (inclusive).

To get only the points of this shape, see loop3D(), cuboid3D() or Box.__iter__().

placeCuboidHollow(editor: Editor, first: Vec3iLike, last: Vec3iLike, block: Block | Sequence[Block], replace: str | list[str] | None = None) None

Places a hollow box of block blocks from first to last (inclusive).

To get only the points of this shape, see Box.shell.

placeCuboidWireframe(editor: Editor, first: Vec3iLike, last: Vec3iLike, block: Block | Sequence[Block], replace: str | list[str] | None = None) None

Places a wireframe of block blocks from first to last (inclusive).

To get only the points of this shape, see Box.wireframe.

placeBox(editor: Editor, box: Box, block: Block | Sequence[Block], replace: str | list[str] | None = None) None

Places a box of block blocks.

To get only the points of this shape, see loop3D(), cuboid3D() or Box.__iter__().

placeBoxHollow(editor: Editor, box: Box, block: Block | Sequence[Block], replace: str | list[str] | None = None) None

Places a hollow box of block blocks.

To get only the points of this shape, see Box.shell.

placeBoxWireframe(editor: Editor, box: Box, block: Block | Sequence[Block], replace: str | list[str] | None = None) None

Places a wireframe of block blocks.

To get only the points of this shape, see Box.wireframe.

placeRect(editor: Editor, rect: Rect, y: int, block: Block | Sequence[Block], replace: str | list[str] | None = None) None

Places a rectangle of blocks in the XY-plane, at height y.

To get only the points of this shape, see loop2D(), cuboid2D() or Rect.__iter__() (each with addY()).

placeRectOutline(editor: Editor, rect: Rect, y: int, block: Block | Sequence[Block], replace: str | list[str] | None = None) None

Places the outline of a rectangle of blocks in the XZ-plane, at height y

To get only the points of this shape, see Rect.outline (with addY()) or Rect.toBox() with Box.wireframe.

placeCheckeredCuboid(editor: Editor, first: Vec3iLike, last: Vec3iLike, block1: Block, block2: Block = Block(None), replace: str | list[str] | None = None) None

Places a checker pattern of block1 and block2 in the box between first and last (inclusive).

placeCheckeredBox(editor: Editor, box: Box, block1: Block, block2: Block = Block(None), replace: str | list[str] | None = None) None

Places a checker pattern of block1 and block2 in box.

placeStripedCuboid(editor: Editor, first: Vec3iLike, last: Vec3iLike, block1: Block, block2: Block = Block(None), axis: int = 0, replace: str | list[str] | None = None) None

Places a stripe pattern of block1 and block2 along axis (0, 1 or 2) in the box between first and last (inclusive).

placeStripedBox(editor: Editor, box: Box, block1: Block | Sequence[Block], block2: Block | Sequence[Block] = Block(None), axis: int = 0, replace: str | list[str] | None = None) None

Places a stripe pattern of block1 and block2 along axis (0, 1 or 2) in box.

placeLine(editor: Editor, first: Vec3iLike, last: Vec3iLike, block: Block | Sequence[Block], width: int = 1, replace: str | list[str] | None = None) None

Places a line of block blocks from first to last (inclusive).

To get only the points of this shape, see line3D().

When placing axis-aligned lines, placeCuboid and placeBox are more efficient.

placeLineSequence(editor: Editor, points: Iterable[Vec3iLike], block: Block | Sequence[Block], closed: bool = False, replace: str | list[str] | None = None) None

Place lines that run from point to point.

To get only the points of this shape, see lineSequence3D().

placeCylinder(editor: Editor, baseCenter: Vec3iLike, diameters: Vec2iLike | int, length: int, block: Block | Sequence[Block], axis: int = 1, tube: bool = False, hollow: bool = False, replace: str | list[str] | None = None) None

Place blocks in the shape of a cylinder with the specified properties.

To get only the points of this shape, see cylinder().

placeFittingCylinder(editor: Editor, corner1: Vec3iLike, corner2: Vec3iLike, block: Block | Sequence[Block], axis: int = 1, tube: bool = False, hollow: bool = False, replace: str | list[str] | None = None) None

Place blocks in the shape of the largest cylinder that fits between corner1 and corner2.

To get only the points of this shape, see fittingCylinder().

placeSphere(editor: Editor, center: Vec3iLike, diameter: int, block: Block | Sequence[Block], hollow: bool = False, replace: str | list[str] | None = None) None

Places blocks in the shape of a sphere with the specified properties.

To get only the points of this shape, see sphere().

placeFittingSphere(editor: Editor, corner1: Vec3iLike, corner2: Vec3iLike, block: Block | Sequence[Block], hollow: bool = False, replace: str | list[str] | None = None) None

Place blocks in the shape of the largest sphere that fits between corner1 and corner2.

To get only the points of this shape, see fittingSphere().

placeEllipsoid(editor: Editor, center: Vec3iLike, diameters: Vec3iLike, block: Block | Sequence[Block], hollow: bool = False, replace: str | list[str] | None = None) None

Place blocks in the shape of an ellipsoid with the specified properties.

To get only the points of this shape, see ellipsoid().

placeFittingEllipsoid(editor: Editor, corner1: Vec3iLike, corner2: Vec3iLike, block: Block | Sequence[Block], hollow: bool = False, replace: str | list[str] | None = None) None

Place blocks in the shape of the largest ellipsoid that fits between corner1 and corner2.

To get only the points of this shape, see fittingEllipsoid().