class Surface
{
virtual Mesh mesh(...);
}
Implicit Class Hierarchy
Assignments
Implicit, User - Nate
Primitives: Plane, Sphere, Point, Segment, Offset - Ed
Algebraic, Torus, Quadric, Ellipsoid, Cylinder, Cone - Jeff
Blob, ImpList, Blinn, Wyvill - Lenny
CSG, Union, Intersect, Complement, Subtract - Steve
Blend: Pseudonorm, PNUnion, PNIntersect, PNSubtract, AUnion, AIntersect,
ASubtract - Bill
Transforms - Open
Implicit
User
Plane
Sphere
Point
Segment
Offset
Algebraic
Torus
Quadric
Ellipsoid
Cylinder
Cone
ImpList
Blob
Blinn
Wyvill
CSG
Union
Intersect
Complement
Subtract
Pseudonorm
PNUnion
PNBlend
PNSubtract
Transform
Affine
Taper
Twist
Bend
class Implicit Surface
{
float proc(Vector3 x); // function
that defines surface, defaults to null function (boom)
gmVector3 grad(gmVector3 x); //
defaults to numerical gradient
gmMatrix3 hess(); // defaults
to numerical Hessian
float operator (gmVector3 x); // evaluates proc()
Implicit operator+(Implicit f);
// returns sum of functions...
Implicit operator-(Implicit f);
Implicit operator*(Implicit f);
Implicit operator/(Implicit f);
gmVector3 normal(gmVector3 x);
// unit surface normal at x
gmVector3 tangent(gmVector3 x);
gmVector3 binormal(gmVector3 x);
float k(gmVector3 x); // curvature
at x
float GaussianCurvature(gmVector3 x);
float MeanCurvature(gmVector3 x);
}
class User Implicit
{
float (*userproc)(Vector3 x);
gmVector3 (*usergrad)(Vector3 x);
gmMatrix3 (*userhess)(Vector3 x);
User(float (*f)(gmVector3));
User(float (*f)(gmVector3), gmVector3 (*g)(gmVector3));
User(float (*f)(gmVector3), gmVector3 (*g)(gmVector3),
gmMatrix3 (*h)(gmVector3));
}
class Lipschitz Implicit
{
virtual float L(gmVector3 x);
// Lipschitz constant (bound) at x
float d(gmVector3 x); // distance to surface
}
// Primitives
// all primitives default to canonical position centered at origin
oriented symmetically about z-axis
class Plane Implicit
{
gmVector3 m_n; // normal
float m_d; // distance from origin
Plane();
Plane(float a, float b, float c, float d);
Plane(gmVector3 n, float d);
Plane(gmVector3 n, gmVector3 p);
}
class Algebraic Implicit
{
float *m_a[]; // coefficients
int m_d; // degree
Algebraic(int degree);
operator()(float *x); // application
on an array of variables
operator[](int i);
// returns a coefficient of the algebraic
int Degree();
// returns degree
}
class Quadric Algebraic
{
Quadric(float a, float e, float h, float j);
Quadric(float a, float b, float c, float d, float
e, float f, float g, float h, float i, float j);
Quadric(float q[10]);
gmMatrix4 Q();
Transform(gmMatrix4x4 t);
gmVector3 Centroid();
}
// Sphere - uses algebraic distance
class Sphere Implicit
{
gmVector3 m_x;
float m_r;
Sphere();
Sphere(float r);
Sphere(gmVector3 x, float r);
}
class Ellipsoid Quadric
{
Ellipsoid(float a, float b, float c);
// major axis
Ellipsoid(gmVector3 x, float a, float b, float c);
// position
}
class Cylinder Quadric
{
Cylinder();
Cylinder(floar r);
Cylinder(gmVector3 d, float r);
Cylinder(gmVector3 x, gmVector3 d, float r);
}
class Cone Quadric
{
Cone();
Cone(float r); // radius one unit
from apex
Cone(gmVector3 d, float r); //
direction of cone axis
Cone(gmVector3 x, gmVector3 d, float r);
// position of apex
}
class Torus Algebraic
{
Torus(float R, float r); // torus
with major radius R and minor radius r surrounding z-axis
}
// Blobs
class Point Implicit
{
gmVector3 m_x;
Point();
Point(gmVector3 x);
}
class ImpList Implicit
{
Implicit *flist; // array of implicits
float operator ()(gmVector3 x); // returns the sum of the implicit elements
ImpList();
int Insert(Implicit f);
Implicit operator [](int i); //
returns an implicit element
Delete(int i);
}
Class Blinn Implicit
{
float m_b; // blobbiness
float m_r; // radius
Blinn(Implicit f);
Blinn(Implicit f, float b);
Blinn(Implicit f, float b, float r);
}
Class Wyvill Implicit
{
float m_r;
Wyvill(Implicit f);
Wyvill(Implicit f, float r);
}
// Blends
class CSG Implicit
{
Implicit *m_f, *m_g;
}
class Union CSG
{
Union(Implicit f, Implicit g);
}
class Intersect CSG
{
Intersect(Implicit f, Implicit g);
}
class Complement CSG
{
Complement(Implicit f, Implicit g);
}
class Subtract CSG
{
Subtract(Implicit f, Implicit g);
}
class Pseudonorm CSG
{
float m_r1, m_r2, m_t;
}
class PNUnion Pseudonorm
{
PNUnion(Implicit f, Implicit g);
}
class PNIntersect Pseudonorm
{
PNIntersect(Implicit f, Implicit g);
}
class AUnion CSG Algebraic {
}
class AIntersect CSG Algebraic {
}
class ASubtract CSG Algebraic {
}
// Implicit operations
class UnaryOp Implicit
{
Implicit m_f;
}
class Offset UnaryOp
{
float m_r;
Offset(Implicit f, float r);
}
class Affine UnaryOp
{
gmMatrix4 m_ti; // inverse of
transformation
Transform(Implicit f, gmMatrix4 m_t);
}
class Taper UnaryOp
{
float (*m_taper_proc)(float);
Taper(Implicit f, float taper_proc);
}
class Twist UnaryOp
{
float m_k; // rate of twist
Twist(Implicit f,float k)
}
class Bend UnaryOp
{
float m_theta; // bend angle
Bend(Implicit f, float theta);
}
// Developable surfaces
class Developable Surface {
virtual int compute(float t);
}
class Subdivision Developable
{
Subdivision(Mesh m); // constructor
needs an input mesh
}
class LevelSet Developable
{
virtual float f(); // speed function
}