Sdf¶
The Sdf.Sdf
object represent signed distance function fields.
It allows to create various shapes.
Summary¶
|
Box aligned with axes |
|
Capsule defined by a segment and a radius. |
Reverse interior and exterior. |
|
Difference between two SDF objects. |
|
|
Closed polygon defined from edges in the xy plane. |
Intersection between two SDF objects. |
|
The union of many connected capsules, forming a piecewise linear pipe with a constant radius. |
|
|
Plate defined by one point on the surface and the normal vector, pointing inside. |
|
Base sdf class. |
|
Sphere defined by its center and radius. |
|
Union between two SDF objects. |
Details¶
- class _sdf_tools.Sdf.Box¶
Box aligned with axes
- __init__(self: sdf_tools.Sdf.Box, low: sdf_tools.real3, high: sdf_tools.real3, inside: bool) None ¶
- Parameters
low – Lower corner of the box.
high – Upper corner of the box.
inside –
True
if the interior is inside the given shape.
- at(self: sdf_tools.Sdf.Sdf, r: sdf_tools.real3) float ¶
Evaluate the SDF field at the given position.
- Parameters
r – The position where to evaluate the SDF.
- class _sdf_tools.Sdf.Capsule¶
Capsule defined by a segment and a radius.
- __init__(self: sdf_tools.Sdf.Capsule, start: sdf_tools.real3, end: sdf_tools.real3, radius: float, inside: bool) None ¶
- Parameters
start – First end of the segment.
end – Second end of the segment.
radius – Radius of the capsule.
inside – Whether the domain is inside the capsule or outside of it.
- at(self: sdf_tools.Sdf.Sdf, r: sdf_tools.real3) float ¶
Evaluate the SDF field at the given position.
- Parameters
r – The position where to evaluate the SDF.
- class _sdf_tools.Sdf.Complement¶
Reverse interior and exterior.
- __init__(self: sdf_tools.Sdf.Complement, sdf: sdf_tools.Sdf.Sdf) None ¶
- Parameters
sdf – The original sdf.
- at(self: sdf_tools.Sdf.Sdf, r: sdf_tools.real3) float ¶
Evaluate the SDF field at the given position.
- Parameters
r – The position where to evaluate the SDF.
- class _sdf_tools.Sdf.Difference¶
Difference between two SDF objects.
- __init__(self: sdf_tools.Sdf.Difference, a: sdf_tools.Sdf.Sdf, b: sdf_tools.Sdf.Sdf) None ¶
- Parameters
a – The original sdf.
b – The sdf of the object that should be removed from the original.
- at(self: sdf_tools.Sdf.Sdf, r: sdf_tools.real3) float ¶
Evaluate the SDF field at the given position.
- Parameters
r – The position where to evaluate the SDF.
- class _sdf_tools.Sdf.Edges¶
Closed polygon defined from edges in the xy plane.
- __init__(self: sdf_tools.Sdf.Edges, edges: List[sdf_tools.real2], inside: bool, nsamples: int = 20) None ¶
- Parameters
edges – List of vertices positions (2D).
inside –
True
if the interior is inside the given shape.nsamples – Number of samples to find the sign of the SDF (more is more accurate).
- at(self: sdf_tools.Sdf.Sdf, r: sdf_tools.real3) float ¶
Evaluate the SDF field at the given position.
- Parameters
r – The position where to evaluate the SDF.
- class _sdf_tools.Sdf.Intersection¶
Intersection between two SDF objects.
- __init__(self: sdf_tools.Sdf.Intersection, a: sdf_tools.Sdf.Sdf, b: sdf_tools.Sdf.Sdf) None ¶
- Parameters
a – The first sdf.
b – The second sdf.
- at(self: sdf_tools.Sdf.Sdf, r: sdf_tools.real3) float ¶
Evaluate the SDF field at the given position.
- Parameters
r – The position where to evaluate the SDF.
- class _sdf_tools.Sdf.PiecewisePipe¶
The union of many connected capsules, forming a piecewise linear pipe with a constant radius.
- __init__(self: sdf_tools.Sdf.PiecewisePipe, vertices: List[sdf_tools.real3], radius: float, inside: bool) None ¶
- Parameters
vertices – Coordinates of the points forming the center line.
radius – Radius of the capsule.
inside – Whether the domain is inside the capsule or outside of it.
- at(self: sdf_tools.Sdf.Sdf, r: sdf_tools.real3) float ¶
Evaluate the SDF field at the given position.
- Parameters
r – The position where to evaluate the SDF.
- class _sdf_tools.Sdf.Plate¶
Plate defined by one point on the surface and the normal vector, pointing inside.
- __init__(self: sdf_tools.Sdf.Plate, point: sdf_tools.real3, normal: sdf_tools.real3) None ¶
- Parameters
point – One point on the plane.
normal – The normal vector (not necessarily normalized, but must be non-zero) pointing inside.
- at(self: sdf_tools.Sdf.Sdf, r: sdf_tools.real3) float ¶
Evaluate the SDF field at the given position.
- Parameters
r – The position where to evaluate the SDF.
- class _sdf_tools.Sdf.Sdf¶
Base sdf class.
- at(self: sdf_tools.Sdf.Sdf, r: sdf_tools.real3) float ¶
Evaluate the SDF field at the given position.
- Parameters
r – The position where to evaluate the SDF.
- class _sdf_tools.Sdf.Sphere¶
Sphere defined by its center and radius.
- __init__(self: sdf_tools.Sdf.Sphere, center: sdf_tools.real3, radius: float, inside: bool) None ¶
- Parameters
center – Center of the sphere.
radius – Radius of the sphere.
inside – Whether the domain is inside the sphere or outside of it.
- at(self: sdf_tools.Sdf.Sdf, r: sdf_tools.real3) float ¶
Evaluate the SDF field at the given position.
- Parameters
r – The position where to evaluate the SDF.
- class _sdf_tools.Sdf.Union¶
Union between two SDF objects.
- __init__(self: sdf_tools.Sdf.Union, a: sdf_tools.Sdf.Sdf, b: sdf_tools.Sdf.Sdf) None ¶
- Parameters
a – The first sdf.
b – The second sdf.
- at(self: sdf_tools.Sdf.Sdf, r: sdf_tools.real3) float ¶
Evaluate the SDF field at the given position.
- Parameters
r – The position where to evaluate the SDF.