redeclipse.prefabs.construction_kit module

class redeclipse.prefabs.construction_kit.ConstructionKitMixin[source]

Bases: object

A mixin for constructing things in the VoxelWorld. The code is still a bit messy…

x(construction, world, *args, **kwargs)[source]
x_ceiling(offset, size=8)[source]
x_column(offset, direction, length)[source]
x_cube(offset)[source]
x_dotted_column(offset, direction, length, on=2, off=2)[source]
x_floor(offset, size=8)[source]
x_interpolate(offset, start, end)[source]
x_low_wall(offset, face)[source]
x_rectangular_prism(offset, xyz)[source]
x_ring(offset, size)[source]
x_wall(offset, face, limit_j=8)[source]
redeclipse.prefabs.construction_kit.column_points(size, direction)[source]

Yield points needed to draw a column

Parameters:
  • size (int) – Length of column
  • direction (str) – direction the column should go in. One of (±x/y/z)
Returns:

An iterable of FineVectors

Return type:

list(redeclipse.vector.FineVector)

redeclipse.prefabs.construction_kit.cube_points(x, y, z)[source]

Yield points needed to draw a rectangular prism or cube.

Parameters:
  • x (int) – size of the rectangular_prism in the x direction
  • y (int) – size of the rectangular_prism in the y direction
  • z (int) – size of the rectangular_prism in the z direction

If, e.g., x is less than zero, it will go from (-x to 0) rather than (0, x)

Returns:An iterable of FineVectors
Return type:list(redeclipse.vector.FineVector)
redeclipse.prefabs.construction_kit.line_points(start, end)[source]

TODO: this is broken af currently.

redeclipse.prefabs.construction_kit.subtract_or_skip(subtract, prob)[source]

determine if we should subtract or skip based on the parameters.

Parameters:
  • subtract (boolean) – Should subtract the point
  • prob (float) – If random.random() > prob, will return that we should “skip” the point.
Returns:

should we subtract (true) or skip the point (false)

Return type:

boolean

redeclipse.prefabs.construction_kit.wall_points(size, direction, limit_j=100, limit_i=100)[source]

Yield points needed to draw a wall. The semantics of direction are a bit odd.

Parameters:
  • size (int) – size of the (square) wall
  • direction (str) – Face the wall is on, e.g. -z is floor, +z is ceiling (size - 1)
  • limit_i (int) – A clamp applied to the x component
  • limit_j (int) – A clamp applied to the y component
Returns:

An iterable of FineVectors

Return type:

list(redeclipse.vector.FineVector)