sdf.Cylinder
sdf.Cylinder(radius, height, material=None)
Cylinder along Z-axis centered at origin.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| radius | float | Scalar | Cylinder radius (float or Scalar parameter) | required |
| height | float | Scalar | Cylinder half-height (total height = 2 * height) | required |
Methods
| Name | Description |
|---|---|
| patch_fields | Side surface plus the two caps, from the sdf’s max composition. |
| sdf | Pure SDF function for cylinder. |
patch_fields
sdf.Cylinder.patch_fields()
Side surface plus the two caps, from the sdf’s max composition.
:meth:sdf is (inside) max(d_xy, |p_z| - height); the axial term splits into the two cap half-spaces. Order: [side, +z cap, -z cap].
sdf
sdf.Cylinder.sdf(p, radius, height)
Pure SDF function for cylinder.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| p | Array | Point(s) to evaluate, shape (…, 3) | required |
| radius | float | Cylinder radius | required |
| height | float | Cylinder half-height | required |
Returns
| Name | Type | Description |
|---|---|---|
| Array | Signed distance to cylinder |
Note
Branches on inside/outside like :meth:Box.sdf so points exactly on the side or cap surfaces receive a valid one-sided subgradient instead of the exact zero an epsilon-smoothed outside norm produces there. The radial epsilon stays: its degenerate point is the axis, which is interior, never on the surface.