HDK
|
#include <GQ_StraightSkeleton.h>
Public Types | |
enum | InOutType { VERTEX_ORDER = 0, SIMPLE_REACHABILITY, ALTERNATING_REACHABILITY, ALTERNATING_REACHABILITY_WITH_SHARED_EDGES } |
How to determine inside/outside from the input graph. More... | |
enum | OffsetGeoType { OFFSET_CURVES = 0, OFFSET_SURFACES = 1 } |
Public Member Functions | |
GQ_StraightSkeleton () | |
virtual | ~GQ_StraightSkeleton () |
void | setPlane (const UT_Vector3 &normal, fpreal distance) |
Set the plane where triangulation happens. More... | |
bool | fitPlane (const GU_Detail *gdp, const GA_PointGroup *pointGroup=0, UT_Vector3 *outNormal=0, fpreal *outDistance=0) |
Fit a plane to the input points. Returns true if it succeeded. More... | |
void | setInOutType (InOutType type) |
InOutType | getInOutType () const |
void | setInsideWeightAttrib (const char *attrib) |
const UT_StringHolder & | getInsideWeightAttrib () const |
void | setOutsideWeightAttrib (const char *attrib) |
const UT_StringHolder & | getOutsideWeightAttrib () const |
void | setDistanceTol (fpreal64 tol) |
fpreal64 | getDistanceTol () const |
void | setParallelismTol (fpreal64 tol) |
fpreal64 | getParallelismTol () const |
void | computeSkeleton (GU_Detail *gdp, const GA_PrimitiveGroup *prim_group) |
UT_ErrorSeverity | getSkeletonComputationErrorSeverity () |
void | getSkeletonComputationErrors (UT_ErrorManager &errors) |
void | buildOffsetGeometry (GU_Detail *gdp, OffsetGeoType type, fpreal64 distance, int ndivs, bool inside, bool outside, bool keep_input, const GA_PrimitiveGroup *input_group, GA_PrimitiveGroup *inside_group, GA_PrimitiveGroup *outside_group, bool split_curves_to_omit_end_caps, const char *edge_dist_attrib_name, const char *edge_speed_attrib_name, bool updatePointNormals=true) |
UT_Vector2 | make2D (const UT_Vector3 &pos) const |
Project 3D point onto plane. More... | |
UT_Vector3 | make3D (const UT_Vector2 &pos) const |
Straight skeleton computation for general polygonal figures in a 2D plane.
The algorithm used is a kinetic triangulation, originally described by Aichholzer, Aurenhammer in "Straight Skeletons for General Polygonal Figures in the Plane", with some implementation details filled in by Palfrader, Held and Huber in "On Computing Straight Skeletons by Means of Kinetic Triangulations".
We use GQ_PolyDelaunay internally for the initial triangulation.
Definition at line 49 of file GQ_StraightSkeleton.h.
How to determine inside/outside from the input graph.
Definition at line 67 of file GQ_StraightSkeleton.h.
Enumerator | |
---|---|
OFFSET_CURVES | |
OFFSET_SURFACES |
Definition at line 123 of file GQ_StraightSkeleton.h.
|
explicit |
Some local typedefs for our helper classes to avoid having to fully qualify the names everywhere.
|
virtual |
void GQ_StraightSkeleton::buildOffsetGeometry | ( | GU_Detail * | gdp, |
OffsetGeoType | type, | ||
fpreal64 | distance, | ||
int | ndivs, | ||
bool | inside, | ||
bool | outside, | ||
bool | keep_input, | ||
const GA_PrimitiveGroup * | input_group, | ||
GA_PrimitiveGroup * | inside_group, | ||
GA_PrimitiveGroup * | outside_group, | ||
bool | split_curves_to_omit_end_caps, | ||
const char * | edge_dist_attrib_name, | ||
const char * | edge_speed_attrib_name, | ||
bool | updatePointNormals = true |
||
) |
The distance parameter is actually interpreted as the time during the wavefront propagation. This is the same thing for skeletons computed without local edge weights and, for skeletons with local edge weights, where our interest really lies.
void GQ_StraightSkeleton::computeSkeleton | ( | GU_Detail * | gdp, |
const GA_PrimitiveGroup * | prim_group | ||
) |
bool GQ_StraightSkeleton::fitPlane | ( | const GU_Detail * | gdp, |
const GA_PointGroup * | pointGroup = 0 , |
||
UT_Vector3 * | outNormal = 0 , |
||
fpreal * | outDistance = 0 |
||
) |
Fit a plane to the input points. Returns true if it succeeded.
|
inline |
Definition at line 109 of file GQ_StraightSkeleton.h.
|
inline |
Definition at line 88 of file GQ_StraightSkeleton.h.
|
inline |
Definition at line 99 of file GQ_StraightSkeleton.h.
|
inline |
Definition at line 103 of file GQ_StraightSkeleton.h.
|
inline |
Definition at line 116 of file GQ_StraightSkeleton.h.
void GQ_StraightSkeleton::getSkeletonComputationErrors | ( | UT_ErrorManager & | errors | ) |
UT_ErrorSeverity GQ_StraightSkeleton::getSkeletonComputationErrorSeverity | ( | ) |
UT_Vector2 GQ_StraightSkeleton::make2D | ( | const UT_Vector3 & | pos | ) | const |
Project 3D point onto plane.
UT_Vector3 GQ_StraightSkeleton::make3D | ( | const UT_Vector2 & | pos | ) | const |
The tolerance used to identify coincident points during triangle collapses.
Definition at line 87 of file GQ_StraightSkeleton.h.
|
inline |
Assigning attributes to use for edge weights turns this into a weighted straight skeleton. We only support positive weighted straight skeletons, ignoring any zero or negative edge weights and replacing them with a weight of 1.
Edge weights can be queried from a vertex, point, or primitive attribute, in that order of priority.
Definition at line 97 of file GQ_StraightSkeleton.h.
|
inline |
Definition at line 101 of file GQ_StraightSkeleton.h.
The tolerance used to identify parallel edges to detect infinitely fast moving wavefront points during triangle collapsed. Bisectors of edges with angles (in radians) less than this will be considered infinitely fast.
void GQ_StraightSkeleton::setPlane | ( | const UT_Vector3 & | normal, |
fpreal | distance | ||
) |
Set the plane where triangulation happens.