unitelabs.labware.math.shapes
Attributes
- Name
Number
- Type
- Value
= typing.Union[str, int, float, tuple[int, collections.abc.Sequence[int], int], decimal.Decimal]
- Description
- Name
PI
- Type
- Value
= parse_number(math.pi)
- Description
- Name
ROUNDING_ERROR
- Type
- Value
= decimal.Decimal('1e-12')
- Description
Functions
Classes
Shape
A 3D solid shape with a certain height that can be filled with liquid.
- Decorators
- dataclasses.dataclass
Methods
__post_init__(self) -> None
volume_for_height(self, height : Number) -> decimal.Decimal
Calculates the volume within this shape for a particular height.
Parameters
- Name
self
- Type
- Default
- Description
- Name
height
- Type
- Number
- Default
- Description
The height within this shape.
Response
- Type
- decimal.Decimal
- Description
The inner shape's volume in µl with the given height.
height_for_volume(self, volume : Number) -> decimal.Decimal
Calculates the height within this shape for a particular volume.
Parameters
- Name
self
- Type
- Default
- Description
- Name
volume
- Type
- Number
- Default
- Description
The volume in this shape.
Response
- Type
- decimal.Decimal
- Description
The inner shape's height in mm with the given volume.
Attributes
- Name
height
- Type
- Decimal
- Value
= Decimal()
- Description
- Name
max_fitting_volume
- Type
- decimal.Decimal
- Value
= None
- Description
The maximum volume that fits into this shape.
Stack
Composition of multiple solid shapes ordered from top to bottom.
Methods
__post_init__(self) -> None
volume_for_height(self, height) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
height
- Type
- Default
- Description
height_for_volume(self, volume) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
volume
- Type
- Default
- Description
Attributes
ComplexShape
A shape with with complex dimensions that can be filled with liquid.
- MRO
- Decorators
- dataclasses.dataclass
Methods
__post_init__(self) -> None
Attributes
Cuboid
A six-faced solid shape with a rectangular base shape and a certain height.
Methods
__post_init__(self) -> None
volume_for_height(self, height) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
height
- Type
- Default
- Description
height_for_volume(self, volume) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
volume
- Type
- Default
- Description
Attributes
Pyramid
A five-faced solid shape with a rectangular base shape and the lateral surfaces as triangles that meet at a common vertex at a certain height.
Methods
__post_init__(self) -> None
volume_for_height(self, height) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
height
- Type
- Default
- Description
height_for_volume(self, volume) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
volume
- Type
- Default
- Description
Attributes
PyramidalFrustum
A solid shape with 6 faces. A pyramidal frustum is the lower portion or base of a pyramid that is a result of cutting off the upper portion by a plane parallel to the base of the shape. If the width and length of the lower and the upper plane are equal respectively, the pyramidal frustum is called a square frustum.
- Decorators
- dataclasses.dataclass
Methods
__post_init__(self) -> None
volume_for_height(self, height) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
height
- Type
- Default
- Description
height_for_volume(self, volume) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
volume
- Type
- Default
- Description
Attributes
- Name
width_lower
- Type
- Decimal
- Value
= Decimal()
- Description
- Name
depth_lower
- Type
- Decimal
- Value
= Decimal()
- Description
- Name
width_upper
- Type
- Decimal
- Value
= Decimal()
- Description
- Name
depth_upper
- Type
- Decimal
- Value
= Decimal()
- Description
- Name
height
- Type
- Decimal
- Value
= Decimal()
- Description
- Name
max_fitting_volume
- Type
- decimal.Decimal
- Value
= None
- Description
The maximum volume that fits into this shape.
Cylinder
A solid shape with two parallel circular base shapes joined by a curved surface with a certain height.
Methods
__post_init__(self) -> None
volume_for_height(self, height) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
height
- Type
- Default
- Description
height_for_volume(self, volume) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
volume
- Type
- Default
- Description
Attributes
Cone
A solid shape with a circular base shape, that narrows smoothly from the base to a point at a certain height.
Methods
__post_init__(self) -> None
volume_for_height(self, height) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
height
- Type
- Default
- Description
height_for_volume(self, volume) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
volume
- Type
- Default
- Description
Attributes
ConicalFrustum
A solid shape with 3 faces. A conical frustum is the lower portion or base of a cone that is a result of cutting off the upper portion by a plane parallel to the base of the shape. See: https://math.stackexchange.com/questions/234upper534/relation-between-height-and-volume-of-frustum
- MRO
- Decorators
- dataclasses.dataclass
Methods
__post_init__(self) -> None
volume_for_height(self, height) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
height
- Type
- Default
- Description
height_for_volume(self, volume) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
volume
- Type
- Default
- Description
Attributes
SphericalCap
A solid shape in form of the cap of a sphere. If the height is equal to the radius of the sphere, the spherical cap turn into a half sphere.
- MRO
- Decorators
- dataclasses.dataclass
Methods
__post_init__(self) -> None
volume_for_height(self, height) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
height
- Type
- Default
- Description
height_for_volume(self, volume) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
volume
- Type
- Default
- Description
Attributes
HalfSphere
A solid shape with a circular base shape, that arcs smoothly down from the base to the lowest point at a certain height (equivalent to the radius of the base shape).
- MRO
- ⎿⎽⎽HalfSphere
- Decorators
- dataclasses.dataclass
Methods
__post_init__(self) -> None
volume_for_height(self, height) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
height
- Type
- Default
- Description
height_for_volume(self, volume) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
volume
- Type
- Default
- Description
Attributes
SphericalSegment
a spherical segment is the solid defined by cutting a sphere or a ball with a pair of parallel planes. It can be thought of as a spherical cap with the top truncated, and so it corresponds to a spherical frustum.
- Decorators
- dataclasses.dataclass
Methods
__post_init__(self) -> None
volume_for_height(self, height) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
height
- Type
- Default
- Description
height_for_volume(self, volume) -> None
Parameters
- Name
self
- Type
- Default
- Description
- Name
volume
- Type
- Default
- Description
Attributes