pfSweptSurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
NAME
pfGetSweptClassType, pfNewSweptSurface, pfSweptSurfaceCrossSection,
pfSweptSurfacePath, pfSweptSurfaceT, pfSweptSurfaceB, pfSweptSurfaceProf,
pfGetSweptSurfaceCrossSection, pfGetSweptSurfacePath, pfGetSweptSurfaceT,
pfGetSweptSurfaceB, pfGetSweptSurfaceProf, pfSweptSurfaceEvalPt - A
parametric swept surface
FUNCTION SPECIFICATION
#include <Performer/pf.h>
pfType * pfGetSweptClassType(void);
pfSweptSurface* pfNewSweptSurface(void *arena);
void pfSweptSurfaceCrossSection(pfSweptSurface* ss,
pfCurve3d *crossSection);
void pfSweptSurfacePath(pfSweptSurface* ss,
pfCurve3d *path);
void pfSweptSurfaceT(pfSweptSurface* ss, pfCurve3d *tng);
void pfSweptSurfaceB(pfSweptSurface* ss, pfCurve3d *b);
void pfSweptSurfaceProf(pfSweptSurface* ss,
pfScalar *profile);
pfCurve3d* pfGetSweptSurfaceCrossSection(pfSweptSurface* ss);
pfCurve3d* pfGetSweptSurfacePath(pfSweptSurface* ss);
pfCurve3d* pfGetSweptSurfaceT(pfSweptSurface* ss);
pfCurve3d* pfGetSweptSurfaceB(pfSweptSurface* ss);
pfScalar* pfGetSweptSurfaceProf(pfSweptSurface* ss);
void pfSweptSurfaceEvalPt(pfSweptSurface *ss, pfReal u,
pfReal v, pfVec3& pnt);
PARENT CLASS FUNCTIONS
The OpenGL Performer class pfSweptSurface is derived from the parent
class pfParaSurface, so each of these member functions of class
pfParaSurface are also directly usable with objects of class
pfSweptSurface. Casting an object of class pfSweptSurface to an object
of class pfParaSurface is taken care of automatically. This is also true
for casts to objects of ancestor classes of class pfParaSurface.
void pfParaSurfaceBeginU(pfParaSurface* surf, pfReal u);
void pfParaSurfaceEndU(pfParaSurface* surf, pfReal u);
Page 1
pfSweptSurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
void pfParaSurfaceBeginV(pfParaSurface* surf, pfReal v);
void pfParaSurfaceEndV(pfParaSurface* surf, pfReal v);
void pfParaSurfaceSolidId(pfParaSurface* surf, int solidId);
void pfParaSurfaceTopoId(pfParaSurface* surf, int topoId);
void pfParaSurfaceSurfaceId(pfParaSurface* surf, int surfaceId);
pfReal pfGetParaSurfaceBeginU(pfParaSurface* surf);
pfReal pfGetParaSurfaceEndU(pfParaSurface* surf);
pfReal pfGetParaSurfaceBeginV(pfParaSurface* surf);
pfReal pfGetParaSurfaceEndV(pfParaSurface* surf);
int pfGetParaSurfaceTrimLoopCount(pfParaSurface* surf);
pfLoop pfGetParaSurfaceTrimLoopClosed(pfParaSurface* surf,
int loopNum);
int pfGetParaSurfaceTrimCurveCount(pfParaSurface* surf,
int loopNum);
pfEdge* pfGetParaSurfaceTrimCurve(pfParaSurface* surf, int loopNum,
int curveNum);
pfTopo* pfGetParaSurfaceTopo(pfParaSurface* surf);
int pfGetParaSurfaceTopoId(pfParaSurface* surf);
int pfGetParaSurfaceSolidId(pfParaSurface* surf);
int pfGetParaSurfaceSurfaceId(pfParaSurface* surf);
void pfParaSurfaceHandednessHint(pfParaSurface* surf,
pfBool _clockWise);
pfBool pfGetParaSurfaceHandednessHint(pfParaSurface* surf);
void pfParaSurfaceInsertTrimCurve(pfParaSurface* surf,
int loopNum, pfCurve2d *c, pfDisCurve2d *d);
void pfParaSurfaceAddTrimCurve(pfParaSurface* surf, int loopNum,
pfCurve2d *c, pfDisCurve2d *d);
void pfParaSurfaceTrimLoopClosed(pfParaSurface* surf,
int loopNum, pfLoop closed);
void pfParaSurfaceEvalPt(pfParaSurface* surf, pfReal u,
pfReal v, pfVec3 pnt);
void pfParaSurfaceEvalDu(pfParaSurface* surf, pfReal u,
pfReal v, pfVec3 Du);
void pfParaSurfaceEvalDv(pfParaSurface* surf, pfReal u,
pfReal v, pfVec3 Dv);
void pfParaSurfaceEvalDuu(pfParaSurface* surf, pfReal u,
pfReal v, pfVec3 Duu);
void pfParaSurfaceEvalDvv(pfParaSurface* surf, pfReal u,
pfReal v, pfVec3 Dvv);
void pfParaSurfaceEvalDuv(pfParaSurface* surf, pfReal u,
pfReal v, pfVec3 Duv);
void pfParaSurfaceEvalNorm(pfParaSurface* surf, pfReal u,
pfReal v, pfVec3 norm);
void pfParaSurfaceEvalD(pfParaSurface* surf, pfReal u, pfReal v,
pfReal theta, pfVec3 D);
void pfParaSurfaceEvalDD(pfParaSurface* surf, pfReal u,
pfReal v, pfReal theta, pfVec3 DD);
int pfParaSurfaceGState(pfParaSurface* surf,
pfGeoState *gState);
pfGeoState* pfGetParaSurfaceGState(pfParaSurface* surf);
Page 2
pfSweptSurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
void pfParaSurfaceClearTessellation(pfParaSurface* surf);
Since the class pfParaSurface is itself derived from the parent class
pfGeode, objects of class pfSweptSurface can also be used with these
functions designed for objects of class pfGeode.
void pfRepOrigin(pfRep *rep, const pfVec3 origin);
void pfRepOrient(pfRep *rep, const pfMatrix mat);
void pfGetRepOrigin(pfRep *rep, pfVec3* origin);
void pfGetRepOrient(pfRep *rep, pfMatrix *mat);
Since the class pfGeode is itself derived from the parent class pfGeode,
objects of class pfSweptSurface can also be used with these functions
designed for objects of class pfGeode.
int pfAddGSet(pfGeode* geode, pfGeoSet* gset);
int pfRemoveGSet(pfGeode* geode, pfGeoSet* gset);
int pfInsertGSet(pfGeode* geode, int index, pfGeoSet* gset);
int pfReplaceGSet(pfGeode* geode, pfGeoSet* old, pfGeoSet* new);
pfGeoSet * pfGetGSet(const pfGeode* geode, int index);
int pfGetNumGSets(const pfGeode* geode);
Since the class pfGeode is itself derived from the parent class pfNode,
objects of class pfSweptSurface can also be used with these functions
designed for objects of class pfNode.
pfGroup * pfGetParent(const pfNode *node, int i);
int pfGetNumParents(const pfNode *node);
void pfNodeBSphere(pfNode *node, pfSphere *bsph, int mode);
int pfGetNodeBSphere(pfNode *node, pfSphere *bsph);
pfNode* pfClone(pfNode *node, int mode);
pfNode* pfBufferClone(pfNode *node, int mode, pfBuffer *buf);
int pfFlatten(pfNode *node, int mode);
int pfNodeName(pfNode *node, const char *name);
const char * pfGetNodeName(const pfNode *node);
pfNode* pfFindNode(pfNode *node, const char *pathName,
pfType *type);
pfNode* pfLookupNode(const char *name, pfType* type);
int pfNodeIsectSegs(pfNode *node, pfSegSet *segSet,
pfHit **hits[]);
void pfNodeTravMask(pfNode *node, int which, uint mask,
int setMode, int bitOp);
uint pfGetNodeTravMask(const pfNode *node, int which);
void pfNodeTravFuncs(pfNode* node, int which,
pfNodeTravFuncType pre, pfNodeTravFuncType post);
void pfGetNodeTravFuncs(const pfNode* node, int which,
pfNodeTravFuncType *pre, pfNodeTravFuncType *post);
Page 3
pfSweptSurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
void pfNodeTravData(pfNode *node, int which, void *data);
void * pfGetNodeTravData(const pfNode *node, int which);
void pfNodeTravMode(pfNode* node, int which, int mode,
int val);
int pfGetNodeTravMode(const pfNode* node, int which,
int mode);
Since the class pfNode is itself derived from the parent class pfObject,
objects of class pfSweptSurface can also be used with these functions
designed for objects of class pfObject.
void pfUserDataSlot(pfObject *obj, int slot, void *data);
void pfUserData(pfObject *obj, void *data);
void* pfGetUserDataSlot(pfObject *obj, int slot);
void* pfGetUserData(pfObject *obj);
int pfGetNumUserData(pfObject *obj);
int pfGetNamedUserDataSlot(const char *name);
const char* pfGetUserDataSlotName(int slot);
int pfGetNumNamedUserDataSlots(void);
int pfDeleteGLHandle(pfObject *obj);
Since the class pfObject is itself derived from the parent class
pfMemory, objects of class pfSweptSurface can also be used with these
functions designed for objects of class pfMemory.
pfType * pfGetType(const void *ptr);
int pfIsOfType(const void *ptr, pfType *type);
int pfIsExactType(const void *ptr, pfType *type);
const char * pfGetTypeName(const void *ptr);
int pfRef(void *ptr);
int pfUnref(void *ptr);
int pfUnrefDelete(void *ptr);
int pfUnrefGetRef(void *ptr);
int pfGetRef(const void *ptr);
int pfCopy(void *dst, void *src);
int pfDelete(void *ptr);
int pfIsFluxed(void *ptr);
int pfCompare(const void *ptr1, const void *ptr2);
void pfPrint(const void *ptr, uint which, uint verbose,
FILE *file);
void * pfGetArena(void *ptr);
DESCRIPTION
A swept surface is a parametric surface defined taking a cross-sectional
3-dimensional curve, pfCurve3d, and sweeping it along a path, another
pfCurve3d. The cross section is scaled by a scalar function, called the
profile.
The surface is defined as:
s(u,v) = path(u) + frame(t(u),b(u)) * profile(u) * crossSection(v)
Page 4
pfSweptSurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
where
path(u) is a point-valued function in (x,y,z)
frame(v1,v2) is a 3x3 matrix valued function.
The "u" parameter maps to the longitudinal or the sweeping direction. The
"v" parameter maps to the cross sectional direction. Both are given in
units relative to the parametric space of the defining curves. To obtain
an arbitrarily-oriented swept surface, either set the orientation matrix
by using the appropriate superclass, pfRep, member function, or reorient
the defining curves either explicitly or through their respective pfRep
orientation matrix.
It takes two vectors v1 != v2 and generates a changes of basis
transformation. This transformation takes the z-axis and aligns it with
v1 and takes the x-axis and aligns it with a projection of the v2 vector
on the plane normal to v1. V1 will most often be the tangent vector to
path(u) and v2 a binormal vector to path(u).
t(u) is a vector-valued function, like the tangent vector
b(u) is a vector-valued function, like the binormal
(The binormal, the tangent vector and their cross product are known as
the Frenet-Serret frame.)
profile(u) is a scalar-valued function
crossSection(v) is a point-valued function in (x,y,0)
Here u runs along the spine or path, and v runs "around" the path. The
crossSection is a function in the x,y plane which outlines the shape.
Profile is a scalar function along the path which scales the cross
section as it is swept along the path. So a cone would be a circle swept
along a linear path with a profile that also varied linearly along the
path.
For a more explicit example here a definition of a torus lying in the x,y
plane would be:
path(u) = ( cos(u)*radius_1, sin(u)*radius_1, 0 ) t(u) = (-
sin(u)*radius_1, cos(u)*radius_1, 0 ) b(u) = (-cos(u)*radius_1,-
sin(u)*radius_1, 0 ) profile(u) = radius_2 crossSection(v) = (cos(v),
sin(v), 0)
Note that the twist and alignment of the profile curve is a function of
of two vector-valued functions along the path. Usually these will be the
normal and binormal of the Frenet-Serret frame, see pfFrenetSweptSurface,
but need not be. This generalization is necessary because for certain
paths the Frenet-Serret frame can do unpredictable things, due to
singularities in the first and second derivatives. Thus the API allows
for the specification of arbitrary vector-valued functions. These
vector-valued functions can, for instance, define a parallel transport
function which keeps things from twisting and can be defined
incrementally by starting with two vectors and updating them as you move
Page 5
pfSweptSurface(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
in u. This incremental update is made by minimizing the relative twist
from one frame to the next.
The family of surfaces definable as swept surfaces is fairly large and
include: all ruled surfaces, cones, spheres, planes, cylinders, genus-1
(single hole) torii, ribbons and mobius strips, fillets, chamfers, water
shaped drops.
pfGetSweptClassType returns the pfType* for the class pfSweptSurface.
The pfType* returned by pfGetConeClassType is the same as the pfType*
returned by invoking pfGetType on any instance of class pfSweptSurface.
Because OpenGL Performer allows subclassing of built-in types, when
decisions are made based on the type of an object, it is usually better
to use pfIsOfType to test if an object is of a type derived from a
Performer type rather than to test for strict equality of the pfType*'s.
pfNewSweptSurface creates an instance of pfSweptSurface. Most of it's
members, such as crossSection, are set to NULL.
pfSweptSurfaceCrossSection sets the crossSection field.
pfGetSweptSurfaceCrossSection returns the crossSection field.
pfSweptSurfacePath sets the path field.
pfGetSweptSurfacePath returns the path field.
pfSweptSurfaceT sets the t field.
pfGetSweptSurfaceT returns the t field.
pfSweptSurfaceB sets the b field.
pfGetSweptSurfaceB returns the b field.
pfSweptSurfaceProf sets the profile field.
pfGetSweptSurfaceProf returns the profile field.
pfSweptSurfaceEvalPt calculates the point on the surface, pnt, as the
vector sum of (a) the point on the path corresponding to the value u and
(b) the point on the cross section corresponding to the value v. The
vector location the point on the cross section is scaled by the value at
u of the profile function, if profile is not NULL.
SEE ALSO
pfRep, pfGeode, pfParaSurface, pfCurve3d, pfScalar
Page 6