float implicitsurface(<geometry>geometry, vector pos)
float implicitsurface(<geometry>geometry, vector pos, vector &grad)
float implicitsurface(<geometry>geometry, vector pos, vector &grad, float &dparm)
float implicitsurface(<geometry>geometry, vector pos, int &shape_id)
float implicitsurface(<geometry>geometry, vector pos, vector &grad, int &shape_id)
float implicitsurface(<geometry>geometry, vector pos, vector &grad, float &dparm, int &shape_id)
float implicitsurface(<geometry>geometry, vector pos, string attr_name, float &attr)
float implicitsurface(<geometry>geometry, vector pos, vector &grad, string attr_name, float &attr)
float implicitsurface(<geometry>geometry, vector pos, vector &grad, float &dparm, string attr_name, float &attr)
float implicitsurface(<geometry>geometry, vector pos, string attr_name, vector &attr)
float implicitsurface(<geometry>geometry, vector pos, vector &grad, string attr_name, vector &attr)
float implicitsurface(<geometry>geometry, vector pos, vector &grad, float &dparm, string attr_name, vector &attr)
<geometry>
When running in the context of a node (such as a wrangle SOP), this argument can be an integer representing the input number (starting at 0) to read the geometry from.
Alternatively, the argument can be a string specifying a geometry file (for example, a .bgeo) to read from. When running inside Houdini, this can be an op:/path/to/sop reference.
pos
The world-space position at which to evaluate the implicit surface.
grad
The spatial gradient of the implicit surface at the evaluation point. The gradient points in the direction of increasing distance.
dparm
The time derivative of the implicit surface at the evaluation point.
This accounts for moving shapes (via v and w) and changing parameters
(via implicit_surface_dparms and implicit_surface_op_dparms).
The normal speed is -dparm / length(grad).
shape_id
The index of the closest contributing shape in the implicit-surface point array.
Returns -1 when no valid shape contributes.
attr_name
Name of a point attribute to interpolate from the contributing shapes. The attribute must exist as either float or vector depending on overload.
attr
Interpolated attribute value at pos.
Returns
Signed distance to the implicit surface at pos.
Negative values are inside, positive values are outside.
The implicit surface is defined by point attributes on the input geometry:
| Attribute | Type | Description |
|---|---|---|
P
|
vector | Shape center position |
orient
|
quaternion | Shape orientation |
implicit_surface_id
|
int | Shape type ID |
implicit_surface_parms
|
vector4 | Shape parameters |
implicit_surface_invert
|
int | If non-zero, invert the shape |
implicit_surface_op_id
|
int | Operation type ID |
implicit_surface_op_parms
|
vector4 | Operation parameters |
Examples ¶
Basic SDF query:
float sdf = implicitsurface(0, @P);
Query SDF + gradient + dparm:
vector grad; float dparm; float sdf = implicitsurface(0, @P, grad, dparm);
Query with shape id and interpolated attribute:
int sid; vector grad; vector Cd_interp; float w_interp; float sdf = implicitsurface(0, @P, grad, sid); float sdf2 = implicitsurface(0, @P, "myweight", w_interp); float sdf3 = implicitsurface(0, @P, grad, "Cd", Cd_interp);
| See also | |
| implicit | |
| sdf |