3D SDFs


X

Bases: GenericGeometry

Value of the X coordinate zeroed at some offset value.

Parameters:
  • offset (float | int) –

    Value at which the field is zero.

offset: float | int property

Value at which the field is zero.

Y

Bases: GenericGeometry

Value of the Y coordinate zeroed at some offset value.

Parameters:
  • offset (float | int) –

    Value at which the field is zero.

offset: float | int property

Value at which the field is zero.

Z

Bases: GenericGeometry

Value of the Z coordinate zeroed at some offset value.

Parameters:
  • offset (float | int) –

    Value at which the field is zero.

offset: float | int property

Value at which the field is zero.

InfiniteCylinder

Bases: GenericGeometry

Cylinder of a given radius and infinite height.

Parameters:
  • radius (float | int) –

    Radius of the cylinder.

radius: float | int property

Radius of the cylinder.

Cylinder

Bases: GenericGeometry

Cylinder defined by the radius and height.

Parameters:
  • radius (float | int) –

    Radius of the cylinder.

  • height (float | int) –

    Height of the cylinder.

radius: float | int property

Radius of the cylinder.

height: float | int property

Radius of the cylinder.

Sphere

Bases: GenericGeometry

Sphere defined by the radius.

Parameters:
  • radius (float) –

    Radius of the sphere.

radius: float | int property

Radius of the sphere.

Box

Bases: GenericGeometry

Box defined by the side lengths a, b, c.

Parameters:
  • a (float | int) –

    Side length along the x-axis.

  • b (float | int) –

    Side length along the y-axis.

  • c (float | int) –

    Side length along the z-axis.

a: float | int property

Side length along the x-axis.

b: float | int property

Side length along the y-axis.

c: float | int property

Side length along the z-axis.

Plane

Bases: GenericGeometry

Plane defined by the normal vector.

Parameters:
  • normal (tuple | list | ndarray) –

    Normal vector of the plane.

  • thickness (float | int) –

    Thickness of the plane.

normal: np.ndarray property

Normal vector of the plane.

thickness: float | int property

Thickness of the plane.

OrientedPlane

Bases: GenericGeometry

Plane defined by a normal vector. SDF has a negative value for points below the plane. Args: normal: Normal vector of the plane. offset: Offset of the origin along the normal vector.

normal: np.ndarray property

Normal vector of the plane.

offset: float | int property

Offset of the origin along the normal vector.

Line

Bases: GenericGeometry

Line defined by the starting and ending point.

Parameters:
  • a (ndarray | list | tuple) –

    Vector defining the starting point.

  • b (ndarray | list | tuple) –

    Vector defining the ending point.

point_a: np.ndarray property

Vector defining the starting point.

point_b: np.ndarray property

Vector defining the ending point.

Triangle3D

Bases: GenericGeometry

Triangle defined by the three vertices.

Parameters:
  • a (tuple | list | ndarray) –

    Vector defining the position of the first vertex.

  • b (tuple | list | ndarray) –

    Vector defining the position of the second vertex.

  • c (tuple | list | ndarray) –

    Vector defining the position of the third vertex.

a: np.ndarray property

Vector defining the position of the first vertex.

b: np.ndarray property

Vector defining the position of the second vertex.

c: np.ndarray property

Vector defining the position of the third vertex.

Quad

Bases: GenericGeometry

Quadrilateral defined by the four vertices.

Parameters:
  • a (tuple | list | ndarray) –

    Vector defining the position of the first vertex.

  • b (tuple | list | ndarray) –

    Vector defining the position of the second vertex.

  • c (tuple | list | ndarray) –

    Vector defining the position of the third vertex.

  • d (tuple | list | ndarray) –

    Vector defining the position of the fourth vertex.

a: np.ndarray property

Vector defining the position of the first vertex.

b: np.ndarray property

Vector defining the position of the second vertex.

c: np.ndarray property

Vector defining the position of the third vertex.

d: np.ndarray property

Vector defining the position of the fourth vertex.

Torus

Bases: GenericGeometry

Torus defined by the primary and the secondary radius.

Parameters:
  • primary_radius (float) –

    Primary radius of the torus.

  • secondary_radius (float) –

    Secondary radius of the torus.

primary_radius: float | int property

Primary radius of the torus - distance between the center of the tube and the center of the torus.

secondary_radius: float | int property

Secondary radius of the torus - radius of the tube.

ChainLink

Bases: GenericGeometry

Chain Link defined by the primary radius, secondary radius and the length.

Parameters:
  • primary_radius (float | int) –

    Width of the chain link.

  • secondary_radius (float | int) –

    Thickness of the wire.

  • length (float | int) –

    Length of the chain link.

primary_radius: float | int property

Width of the chain link.

secondary_radius: float | int property

Thickness of the wire.

length: float | int property

Length of the chain link.

Braid

Bases: GenericGeometry

Braid defined as a twisted chain link, where the total number of revolutions is defined via the pitch.

Parameters:
  • length (float | int) –

    Length of the braid.

  • primary_radius (float | int) –

    Width of the braid.

  • secondary_radius (float | int) –

    Thickness of the braid.

  • pitch (float | int) –

    Pitch of the twist in units rad/unit length.

primary_radius: float | int property

Width of the braid.

secondary_radius: float | int property

Thickness of the braid.

length: float | int property

Length of the braid.

pitch: float | int property

Pitch of the twist in units rad/unit length.

Arc3D

Bases: GenericGeometry

Arc defined by the radius, thickness, and the angles of both ends.

Parameters:
  • radius (float | int) –

    Radius of the arc.

  • thickness (float | int) –

    Thickness of the arc.

  • start_angle (float | int) –

    Angle of one end with respect to the x-axis.

  • end_angle (float | int) –

    Angle of the other end with respect to the x-axis.

start_angle: float | int property

Angle of one end with respect to the x-axis.

end_angle: float | int property

Angle of the other end with respect to the x-axis.

primary_radius: float | int property

Radius of the arc.

secondary_radius: float | int property

Thickness of the arc.

Cone

Bases: GenericGeometry

height: float | int property

Height of the cone.

height_offset: float | int property

Center of mass height.

angle: float | int property

Angle of the slope.

base_radius: float | int property

Radius of the base.

__init__(height, angle)

Cone defined by its height and the angle of the slope. The base of the cone is moved down by: height - height_offset.

Parameters:
  • height (float | int) –

    Height of the cone.

  • angle (float | int) –

    Angle of the slope.

InfiniteCone

Bases: GenericGeometry

Cone with infinite height defined by the angle of its slope. The tip of the cone is in the origin.

Parameters:
  • angle (float | int) –

    Angle of the slope.

angle: float | int property

Angle of the slope.

OrientedInfiniteCone

Bases: GenericGeometry

Cone with infinite height defined by the angle of its slope. The tip of the cone is in the origin. Values of the SDF below the cone are negative.

Parameters:
  • angle (float | int) –

    Angle of the slope.

angle: float | int property

Angle of the slope.

SolidAngle

Bases: GenericGeometry

Solid angle defined by the radius of the globe and two angles.

Parameters:
  • radius (float | int) –

    Radius of the globe.

  • angle_1 (float | int) –

    First angle defining the sector.

  • angle_2 (float | int) –

    Second angle defining the sector.

radius: float | int property

Radius of the globe.

angle_1: float | int property

First angle defining the sector.

angle_2: float | int property

Second angle defining the sector.

ParametricCurve3D

Bases: GenericGeometry

Curve connecting the points on the user provided parametric curve.

Parameters:
  • parametric_curve (Callable[[ndarray, tuple], ndarray]) –

    Function defining the parametric curve with a single variable (t) and other parameters.

  • parametric_curve_parameters (tuple) –

    Parameters of the function defining the parametric curve.

  • t_range (tuple) –

    Range of the t parameter/variable. t_range[0] - start, t_range[1] - end, t_range[2] - number of steps in between.

  • closed (bool, default: False ) –

    Is the curve closed on itself. False by default.

steps: float | int property

Number of points at which the curve is evaluated.

t_start: float | int property

Start value of parameter t.

t_end: float | int property

End value of parameter t.

ts: np.ndarray property

Values of parameter t.

closed: bool property

Is the segmented line closed on itself. False by default.

sdf_closed_curve()

Returns the SDF of the closed curve if parameter close==True.

Returns:
  • Callable[[ndarray, tuple], ndarray]

    Modified SDF

SegmentedParametricCurve3D

Bases: GenericGeometry

Segmented line connecting the user provided points. points: Points to connect. t_range: Range of the t parameter. t_range[0] - start, t_range[1] - end, t_range[2] - number of steps in between. t_range[1]-t_range[0] >= number of points. closed: Is the segmented line closed on itself. False by default.

steps: int property

Number of points at which the curve is evaluated.

t_start: float | int property

Start value of parameter t.

t_end: float | int property

End value of parameter t.

ts: np.ndarray property

Values of parameter t.

closed: bool property

Is the segmented line closed on itself. False by default.

sdf_closed_curve()

Returns the SDF of the closed curve if parameter close==True.

Returns:
  • Callable[[ndarray, tuple], ndarray]

    Modified SDF

SegmentedLine3D

Bases: GenericGeometry

Segmented line connecting the user provided points.

Parameters:
  • points (list | tuple | ndarray) –

    Points to connect.

  • closed (bool, default: False ) –

    Is the segmented line closed on itself. False by default.

closed: bool property

Is the segmented line closed on itself. False by default.

sdf_closed_curve()

Returns the SDF of the closed curve if parameter close==True.

Returns:
  • Callable[[ndarray, tuple], ndarray]

    Modified SDF

PointCloud3D

Bases: GenericGeometry

SDF of the point cloud.

Parameters:
  • points (list | tuple | ndarray) –

    Positions of the points in an array of shape (3, N-points).

points: np.ndarray property

Positions of the points in an array of shape (2, N-points).