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 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 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 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 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 property

Radius of the cylinder.

height property

Radius of the cylinder.

Sphere

Bases: GenericGeometry

Sphere defined by its radius.

Parameters:
  • radius (float) –

    Radius of the sphere.

radius property

Radius of the sphere.

Box

Bases: GenericGeometry

Box defined by its 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 property

Side length along the x-axis.

b property

Side length along the y-axis.

c property

Side length along the z-axis.

Plane

Bases: GenericGeometry

Plane defined by its normal vector.

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

    Normal vector of the plane.

  • thickness (float | int) –

    Thickness of the plane.

normal property

Normal vector of the plane.

thickness property

Thickness of the plane.

OrientedPlane

Bases: GenericGeometry

Plane defined by its 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 property

Normal vector of the plane.

offset property

Offset of the origin along the normal vector.

Line

Bases: GenericGeometry

Line defined by its starting and ending points.

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

    Vector defining the starting point.

  • b (ndarray | list | tuple) –

    Vector defining the ending point.

point_a property

Vector defining the starting point.

point_b property

Vector defining the ending point.

Triangle3D

Bases: GenericGeometry

Triangle defined by its 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 property

Vector defining the position of the first vertex.

b property

Vector defining the position of the second vertex.

c property

Vector defining the position of the third vertex.

Quad

Bases: GenericGeometry

Quadrilateral defined by its 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 property

Vector defining the position of the first vertex.

b property

Vector defining the position of the second vertex.

c property

Vector defining the position of the third vertex.

d property

Vector defining the position of the fourth vertex.

Torus

Bases: GenericGeometry

Torus defined by its primary and the secondary radius.

Parameters:
  • primary_radius (float) –

    Primary radius of the torus.

  • secondary_radius (float) –

    Secondary radius of the torus.

primary_radius property

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

secondary_radius 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 property

Width of the chain link.

secondary_radius property

Thickness of the wire.

length 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 property

Width of the braid.

secondary_radius property

Thickness of the braid.

length property

Length of the braid.

pitch 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 property

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

end_angle property

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

primary_radius property

Radius of the arc.

secondary_radius property

Thickness of the arc.

Cone

Bases: GenericGeometry

height property

Height of the cone.

height_offset property

Center of mass height.

angle property

Angle of the slope.

base_radius 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 at the origin.

Parameters:
  • angle (float | int) –

    Angle of the slope.

angle 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 at the origin. Values of the SDF below the cone are negative.

Parameters:
  • angle (float | int) –

    Angle of the slope.

angle 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 property

Radius of the globe.

angle_1 property

First angle defining the sector.

angle_2 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 property

Number of points at which the curve is evaluated.

t_start property

Start value of parameter t.

t_end property

End value of parameter t.

ts property

Values of parameter t.

closed 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 property

Number of points at which the curve is evaluated.

t_start property

Start value of parameter t.

t_end property

End value of parameter t.

ts property

Values of parameter t.

closed 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 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 property

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