Core 1.0
Frequently Asked Questions

Geometry

How do I compute the area or the volume of a geometric primitive?
In general, create an instance of the geometric shape, and use aither the member functions Area() or Volume(). In some cases, static member functions have been implemented to avoid instanciation, for instance the area of a circle can be computed directly without creating a Circle:

double a = Circle::Area(r);
double Area() const
Area of a circle.
Definition circle.h:78

How do I compute the bounding box of a given simple geometric primitive? Most primitives have a corresponding member function. For example, see:

Box Cone::GetBox() const;
An axis aligned box.
Definition box.h:21
Box GetBox() const
Compute the axis-aligned bounding box of the cone.
Definition cone.cpp:240

In general those member functions do not yield the tightest bounding box, but a simple to compute and efficient one. See the details of the corresponding member function.

How do I compute the distance from a point to a geometric primitive?
Most geometric primitives, including Box, Sphere, Triangle, Cylinder, Circle or even QuadricCurve implement a specific member function. For example, see:

double Box::R(const Vector&) const;
double R(const Vector &) const
Computes the squared Euclidean distance between the box and a point.
Definition box.h:253
Vectors in three dimensions.
Definition evector.h:20

In general member functions compute the squared distance out of efficiency.