HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GEO_ImplicitSurface< PREC > Class Template Reference

#include <GEO_ImplicitSurface.h>

Classes

struct  DParms
 Time derivatives of shape/operation parameters for computing dparm. More...
 

Public Types

using Float = VEXfloat< PREC >
 
using Vec3 = VEXvec3< PREC >
 
using Vec4 = UT_Vector4T< Float >
 
using Quat = UT_QuaternionT< Float >
 
using Shape = GEO_ImplicitBasicSurface< PREC >
 
using Op = GEO_ImplicitSurfaceOp< PREC >
 
using IntervalF = UT_IntervalT< Float >
 
using BBox3 = UT_BoundingBoxT< Float >
 

Public Member Functions

 GEO_ImplicitSurface ()=default
 
 GEO_ImplicitSurface (const GEO_Detail &geo)
 
void applyTransform (const Vec3 &translate, const Quat &rotate, Float uniform_scale)
 
void applyIndexSpaceTransform (const GA_PrimVolumeXform &index_xform)
 
void applyOffset (const Float offset)
 Apply offset to the surface. More...
 
Float operator() (const Vec3 &P) const
 
Float operator() (const Vec3 &P, Vec3 &grad) const
 
Float operator() (const Vec3 &P, Vec3 &grad, Float &dparm) const
 
void evalBatched (int npts, const Vec3 *P, Float *sdf) const
 
void evalBatched (int npts, const Vec3 *P, Float *sdf, Vec3 *grad) const
 
void evalBatched (int npts, const Vec3 *P, Float *sdf, Vec3 *grad, Float *dparm) const
 
void evalBatched (int npts, const Vec3 *P, Float *sdf, int *shape_id, Vec3 *grad, Float *dparm) const
 
void evalBatchedAttr (int npts, const Vec3 *P, Float *sdf, int *shape_id, Vec3 *grad, Float *dparm, const GA_ROHandleF &h_attr, const GA_IndexMap &ptmap, Float *attr_out) const
 
void evalBatchedAttr (int npts, const Vec3 *P, Float *sdf, int *shape_id, Vec3 *grad, Float *dparm, const GA_ROHandleV3 &h_attr, const GA_IndexMap &ptmap, Vec3 *attr_out) const
 
void evalBatchedVel (int npts, const Vec3 *P, Float *sdf, int *shape_id, Vec3 *grad, Float *dparm, Vec3 *rigid_vel) const
 
IntervalF evalInterval (const BBox3 &P, UT_Array< int > &relevant_ids) const
 Evaluate SDF over an interval region, returning relevant shape IDs. More...
 
IntervalF evalInterval (const BBox3 &P) const
 Evaluate SDF over an interval region. More...
 
IntervalF evalInterval (const Vec3 &center, const Float radius) const
 Evaluate SDF over an interval region. More...
 
IntervalF outputBoundAndPrune (const Vec3 &center, const Float radius, GEO_ImplicitSurface< PREC > &pruned) const
 
Float offsetEstimate ()
 

Public Attributes

UT_ValArray< ShapemyShapes
 
UT_ValArray< OpmyOps
 
UT_ValArray< DParmsmyDParms
 
int myNPoints = 0
 

Detailed Description

template<VEX_Precision PREC>
class GEO_ImplicitSurface< PREC >

Compound Implicit Surface - evaluates compound SDFs built from basic shapes combined with boolean/blending operations.

Constructed from a GEO_Detail whose points carry implicit surface attributes. The evaluation uses a recursive algorithm to handle nested Begin/End groups.

Shape/operation sequence structure:

  • Begin op: starts a new group (recursive call)
  • End shape + Binary op: ends group, returns to caller who applies the op
  • Unary op: modifies current SDF in place
  • Binary op + regular shape: evaluates shape, combines with current SDF

Definition at line 44 of file GEO_ImplicitSurface.h.

Member Typedef Documentation

template<VEX_Precision PREC>
using GEO_ImplicitSurface< PREC >::BBox3 = UT_BoundingBoxT<Float>

Definition at line 68 of file GEO_ImplicitSurface.h.

template<VEX_Precision PREC>
using GEO_ImplicitSurface< PREC >::Float = VEXfloat<PREC>

Definition at line 47 of file GEO_ImplicitSurface.h.

template<VEX_Precision PREC>
using GEO_ImplicitSurface< PREC >::IntervalF = UT_IntervalT<Float>

Definition at line 67 of file GEO_ImplicitSurface.h.

template<VEX_Precision PREC>
using GEO_ImplicitSurface< PREC >::Op = GEO_ImplicitSurfaceOp<PREC>

Definition at line 52 of file GEO_ImplicitSurface.h.

template<VEX_Precision PREC>
using GEO_ImplicitSurface< PREC >::Quat = UT_QuaternionT<Float>

Definition at line 50 of file GEO_ImplicitSurface.h.

template<VEX_Precision PREC>
using GEO_ImplicitSurface< PREC >::Shape = GEO_ImplicitBasicSurface<PREC>

Definition at line 51 of file GEO_ImplicitSurface.h.

template<VEX_Precision PREC>
using GEO_ImplicitSurface< PREC >::Vec3 = VEXvec3<PREC>

Definition at line 48 of file GEO_ImplicitSurface.h.

template<VEX_Precision PREC>
using GEO_ImplicitSurface< PREC >::Vec4 = UT_Vector4T<Float>

Definition at line 49 of file GEO_ImplicitSurface.h.

Constructor & Destructor Documentation

template<VEX_Precision PREC>
GEO_ImplicitSurface< PREC >::GEO_ImplicitSurface ( )
default
template<VEX_Precision PREC>
GEO_ImplicitSurface< PREC >::GEO_ImplicitSurface ( const GEO_Detail geo)
inline

Construct from geometry, reading all implicit surface attributes from point data into the internal arrays.

Definition at line 80 of file GEO_ImplicitSurface.h.

Member Function Documentation

template<VEX_Precision PREC>
void GEO_ImplicitSurface< PREC >::applyIndexSpaceTransform ( const GA_PrimVolumeXform index_xform)
inline

Transform the implicit surface from world space into the index space of a VDB defined by the given GEO_PrimVolumeXform. After this call, evaluating positions in index space will produce SDF values in index-space units (multiply by voxelsize for world).

Definition at line 174 of file GEO_ImplicitSurface.h.

template<VEX_Precision PREC>
void GEO_ImplicitSurface< PREC >::applyOffset ( const Float  offset)

Apply offset to the surface.

template<VEX_Precision PREC>
void GEO_ImplicitSurface< PREC >::applyTransform ( const Vec3 translate,
const Quat rotate,
Float  uniform_scale 
)
inline

Apply translation, rotation, and uniform scale to all shapes. Positions: new_pos = rotate(old_pos * uniform_scale) + translate Orientations: composed with the rotation quaternion Distance parameters: scaled by uniform_scale on shapes and ops NOTE: DParms (v, w) are not transformed by this method.

Definition at line 154 of file GEO_ImplicitSurface.h.

template<VEX_Precision PREC>
void GEO_ImplicitSurface< PREC >::evalBatched ( int  npts,
const Vec3 P,
Float sdf 
) const
template<VEX_Precision PREC>
void GEO_ImplicitSurface< PREC >::evalBatched ( int  npts,
const Vec3 P,
Float sdf,
Vec3 grad 
) const
template<VEX_Precision PREC>
void GEO_ImplicitSurface< PREC >::evalBatched ( int  npts,
const Vec3 P,
Float sdf,
Vec3 grad,
Float dparm 
) const
template<VEX_Precision PREC>
void GEO_ImplicitSurface< PREC >::evalBatched ( int  npts,
const Vec3 P,
Float sdf,
int shape_id,
Vec3 grad,
Float dparm 
) const

Same as above, but also outputs the winning shape id per point. grad/dparm may be nullptr if not needed.

template<VEX_Precision PREC>
void GEO_ImplicitSurface< PREC >::evalBatchedAttr ( int  npts,
const Vec3 P,
Float sdf,
int shape_id,
Vec3 grad,
Float dparm,
const GA_ROHandleF h_attr,
const GA_IndexMap ptmap,
Float attr_out 
) const

Batched evaluation that also interpolates an arbitrary point attribute (float or vector) across the blended shapes.

template<VEX_Precision PREC>
void GEO_ImplicitSurface< PREC >::evalBatchedAttr ( int  npts,
const Vec3 P,
Float sdf,
int shape_id,
Vec3 grad,
Float dparm,
const GA_ROHandleV3 h_attr,
const GA_IndexMap ptmap,
Vec3 attr_out 
) const
template<VEX_Precision PREC>
void GEO_ImplicitSurface< PREC >::evalBatchedVel ( int  npts,
const Vec3 P,
Float sdf,
int shape_id,
Vec3 grad,
Float dparm,
Vec3 rigid_vel 
) const

Batched evaluation that also blends the per-shape rigid velocity (v + w x (P - pos)) across the blended shapes.

template<VEX_Precision PREC>
IntervalF GEO_ImplicitSurface< PREC >::evalInterval ( const BBox3 P,
UT_Array< int > &  relevant_ids 
) const

Evaluate SDF over an interval region, returning relevant shape IDs.

template<VEX_Precision PREC>
IntervalF GEO_ImplicitSurface< PREC >::evalInterval ( const BBox3 P) const

Evaluate SDF over an interval region.

template<VEX_Precision PREC>
IntervalF GEO_ImplicitSurface< PREC >::evalInterval ( const Vec3 center,
const Float  radius 
) const

Evaluate SDF over an interval region.

template<VEX_Precision PREC>
Float GEO_ImplicitSurface< PREC >::offsetEstimate ( )
inline

Return a conservative estimate on the isoline offset. This is used whe we get bounding box based on the visualization geometry, we expand this bounding box by this offset to get a better estimate on a region where implicut surface is contained.

Definition at line 256 of file GEO_ImplicitSurface.h.

template<VEX_Precision PREC>
Float GEO_ImplicitSurface< PREC >::operator() ( const Vec3 P) const
template<VEX_Precision PREC>
Float GEO_ImplicitSurface< PREC >::operator() ( const Vec3 P,
Vec3 grad 
) const
template<VEX_Precision PREC>
Float GEO_ImplicitSurface< PREC >::operator() ( const Vec3 P,
Vec3 grad,
Float dparm 
) const
template<VEX_Precision PREC>
IntervalF GEO_ImplicitSurface< PREC >::outputBoundAndPrune ( const Vec3 center,
const Float  radius,
GEO_ImplicitSurface< PREC > &  pruned 
) const

Evaluate interval over a sphere and build a pruned surface expression. Pruning follows operation interval optimization flags and emits a new shape/op sequence equivalent on the queried sphere.

Member Data Documentation

template<VEX_Precision PREC>
UT_ValArray<DParms> GEO_ImplicitSurface< PREC >::myDParms

Definition at line 73 of file GEO_ImplicitSurface.h.

template<VEX_Precision PREC>
int GEO_ImplicitSurface< PREC >::myNPoints = 0

Definition at line 74 of file GEO_ImplicitSurface.h.

template<VEX_Precision PREC>
UT_ValArray<Op> GEO_ImplicitSurface< PREC >::myOps

Definition at line 72 of file GEO_ImplicitSurface.h.

template<VEX_Precision PREC>
UT_ValArray<Shape> GEO_ImplicitSurface< PREC >::myShapes

Definition at line 71 of file GEO_ImplicitSurface.h.


The documentation for this class was generated from the following file: