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
blockblocks fromfirsttolast(inclusive).To get only the points of this shape, see
loop3D(),cuboid3D()orBox.__iter__().
-
placeCuboidHollow(editor: Editor, first: Vec3iLike, last: Vec3iLike, block: Block | Sequence[Block], replace: str | list[str] | None =
None) None¶ Places a hollow box of
blockblocks fromfirsttolast(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
blockblocks fromfirsttolast(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
blockblocks.To get only the points of this shape, see
loop3D(),cuboid3D()orBox.__iter__().
-
placeBoxHollow(editor: Editor, box: Box, block: Block | Sequence[Block], replace: str | list[str] | None =
None) None¶ Places a hollow box of
blockblocks.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
blockblocks.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()orRect.__iter__()(each withaddY()).
-
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
yTo get only the points of this shape, see
Rect.outline(withaddY()) orRect.toBox()withBox.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
block1andblock2in the box betweenfirstandlast(inclusive).
-
placeCheckeredBox(editor: Editor, box: Box, block1: Block, block2: Block =
Block(None), replace: str | list[str] | None =None) None¶ Places a checker pattern of
block1andblock2inbox.
-
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
block1andblock2alongaxis(0, 1 or 2) in the box betweenfirstandlast(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
block1andblock2alongaxis(0, 1 or 2) inbox.
-
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
blockblocks fromfirsttolast(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
corner1andcorner2.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
corner1andcorner2.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
corner1andcorner2.To get only the points of this shape, see
fittingEllipsoid().