HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_Spine Class Reference

#include <GU_PolyBridge.h>

Public Types

enum  Positioning {
  AS_IS = 0, SRC_TO_DST, ALONG_SRC_DIR, ALONG_DST_DIR,
  TANGENT_TO_SRC_DIR, TANGENT_TO_DST_DIR, TRANSLATE_TO_SRC, TRANSLATE_TO_DST
}
 
enum  SampleMode { PARAMETER_UNIFORM = 0, ARC_LENGTH_UNIFORM, CURVATURE_ADAPTIVE }
 

Public Member Functions

 GU_Spine (const GEO_Face *curve=nullptr, bool reverse=false, fpreal u0=0.0, fpreal u1=1.0, bool straight=false)
 
 ~GU_Spine ()=default
 
void position (UT_Vector3 src_pos, UT_Vector3 src_tan, UT_Vector3 src_norm, UT_Vector3 dst_pos, UT_Vector3 dst_tan, Positioning=SRC_TO_DST, fpreal axial_rotation=0.0)
 
void sample (int size, SampleMode sample_mode, UT_Vector3Array &pos, UT_Vector3Array &tan, UT_Vector3Array &norm, UT_FprealArray &uvals, bool miter, UT_Vector3Array *expands)
 
void setStiffness (fpreal s0, fpreal s1)
 
void setBlend (fpreal b0, fpreal b1)
 
void setClipRange (fpreal c0, fpreal c1)
 
void getClip0 (UT_Vector3 &p, UT_Vector3 &t, UT_Vector3 &n)
 
void getClip1 (UT_Vector3 &p, UT_Vector3 &t, UT_Vector3 &n)
 
UT_Vector3 evalSpine (fpreal u, int du)
 
fpreal evalExternalAttribF (GA_ROHandleF ah, fpreal u, UT_Array< GA_Offset > &offsets, UT_FloatArray &weights, GA_AttributeOwner owner)
 

Detailed Description

A GU_Spine encapsulates a "spine curve": an open curve together with a rotation minimizing orthonormal frame at every point. You can create a spine by supplying the two points and the tangents to the curve at each of them as well as the curve normal at the first point. This will normally create a smooth curve between the two points with the given tangents. The magnitudes of the tangents can be controlled. Furthermore, it is possible to force the spine to move straight along a tangent for a an initial part of the curve and only start to blend into the other direction during a given range. It is also possible to provide an external curve after which to model the spine. The external curve is positioned according to the supplied positioning method and the source and destination directions are blended separately according to their respective blending ranges with this curve. The two resulting curves are then blended using a cubic smooth step function. The main output method is sample() which samples the generated spine to produce arrays of point positions, tangents, and normals. An evaluate spine method is also provided which evaluates the spine curve on a [0-1] parameterization. Note that rotation minimizing frames are only evaluated during sampling and cannot be accessed for random access.

Definition at line 56 of file GU_PolyBridge.h.

Member Enumeration Documentation

Enumerator
AS_IS 
SRC_TO_DST 
ALONG_SRC_DIR 
ALONG_DST_DIR 
TANGENT_TO_SRC_DIR 
TANGENT_TO_DST_DIR 
TRANSLATE_TO_SRC 
TRANSLATE_TO_DST 

Definition at line 59 of file GU_PolyBridge.h.

Enumerator
PARAMETER_UNIFORM 
ARC_LENGTH_UNIFORM 
CURVATURE_ADAPTIVE 

Definition at line 71 of file GU_PolyBridge.h.

Constructor & Destructor Documentation

GU_Spine::GU_Spine ( const GEO_Face curve = nullptr,
bool  reverse = false,
fpreal  u0 = 0.0,
fpreal  u1 = 1.0,
bool  straight = false 
)
explicit
GU_Spine::~GU_Spine ( )
default

Member Function Documentation

fpreal GU_Spine::evalExternalAttribF ( GA_ROHandleF  ah,
fpreal  u,
UT_Array< GA_Offset > &  offsets,
UT_FloatArray weights,
GA_AttributeOwner  owner 
)
UT_Vector3 GU_Spine::evalSpine ( fpreal  u,
int  du 
)

Evaluate the spine curve at parameter value u. The second parameter du can only be 0 or 1 to evaluate the point position or the tangent vector.

void GU_Spine::getClip0 ( UT_Vector3 p,
UT_Vector3 t,
UT_Vector3 n 
)
void GU_Spine::getClip1 ( UT_Vector3 p,
UT_Vector3 t,
UT_Vector3 n 
)
void GU_Spine::position ( UT_Vector3  src_pos,
UT_Vector3  src_tan,
UT_Vector3  src_norm,
UT_Vector3  dst_pos,
UT_Vector3  dst_tan,
Positioning  = SRC_TO_DST,
fpreal  axial_rotation = 0.0 
)
void GU_Spine::sample ( int  size,
SampleMode  sample_mode,
UT_Vector3Array pos,
UT_Vector3Array tan,
UT_Vector3Array norm,
UT_FprealArray uvals,
bool  miter,
UT_Vector3Array expands 
)
void GU_Spine::setBlend ( fpreal  b0,
fpreal  b1 
)
inline

Definition at line 100 of file GU_PolyBridge.h.

void GU_Spine::setClipRange ( fpreal  c0,
fpreal  c1 
)
inline

Definition at line 103 of file GU_PolyBridge.h.

void GU_Spine::setStiffness ( fpreal  s0,
fpreal  s1 
)
inline

Definition at line 97 of file GU_PolyBridge.h.


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