Core 1.0
Public Member Functions | Static Public Attributes | Protected Attributes | Friends | List of all members
Tubular Class Reference

A tubular object is a pierced cylinder. More...

#include <tubular.h>

Inheritance diagram for Tubular:
Axis RevolutionQuadricTube

Public Member Functions

 Tubular ()
 Empty.
 
 Tubular (const Vector &, const Vector &, const double &, const double &)
 Creates a tube given vertices and radii. More...
 
 ~Tubular ()
 Empty.
 
double Radius () const
 Gets the external radius.
 
double InternalRadius () const
 Gets the external radius.
 
bool Inside (const Vector &) const
 Check if a point is inside or outside the tube. More...
 
Vector Normal (const Vector &) const
 Compute the normal vector to a tube. More...
 
double R (const Vector &) const
 Compute the squared distance to a tube. More...
 
double Signed (const Vector &) const
 Compute the signed Euclidean distance to a tube. More...
 
double Volume () const
 Computes the volume of a tube.
 
double Area () const
 Compute the surface area of a tube.
 
void Translate (const Vector &)
 Translate a tube. More...
 
void Rotate (const Matrix &)
 Rotates a tube. More...
 
void Scale (const double &)
 Scale a tube. More...
 
Box GetBox () const
 Computes the axis-aligned bounding box of a tube. More...
 
Vector Vertex (int) const
 Return one of the end vertexes of the axis.
 

Static Public Attributes

static const double epsilon = 1.0e-4
 Epsilon value for intersection tests.
 

Protected Attributes

double ri = 1.0
 External and internal radii.
 
- Protected Attributes inherited from Axis
Vector b = Vector::Z
 End vertices of the axis.
 
Vector axis = Vector::Z
 Normalized axis vector.
 
double length = 1.0
 Length of the axis.
 

Friends

std::ostream & operator<< (std::ostream &, const Tubular &)
 Overloaded. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Axis
double Radial (const Vector &, Vector &, Vector &) const
 Compute the radial coordinates of a point. More...
 
Vector2 Radial (const Vector &) const
 Compute the radial coordinates of a point. More...
 
 Axis ()
 Empty.
 
 Axis (const Vector &, const Vector &)
 Creates an axis given end vertices. More...
 
 ~Axis ()
 Empty.
 
void Rotate (const Matrix &)
 Rotates an axis. More...
 
void Translate (const Vector &)
 Translates an axis. More...
 
void Scale (const double &)
 Uniformly scales an axis. More...
 
void Scale (const Vector &)
 Scales an axis. More...
 
Quadric Equation (const Ray &) const
 Compute the polynomial equation of the Euclidean distance between a ray and the axis. More...
 
Vector Vertex (int) const
 Return one of the end vertexes of the axis.
 
Vector Point (const double &) const
 Compute a point on the axis.
 
Vector GetAxis () const
 Returns the normalized axis vector.
 
double Length () const
 Return the axis length.
 
Vector Symmetric (const Vector &) const
 Symmetric point. More...
 
Sphere Symmetric (const Sphere &) const
 Symmetric sphere. More...
 
Vector Normal (const Vector &) const
 Compute the normal vector between a point and its projection onto the edge. More...
 
double R (const Vector &) const
 Compute the squared distance to the segment. More...
 
double R (const Axis &) const
 Compute the squared distance between two axes. More...
 
double R (const Vector &, double &) const
 Compute the squared distance to the axis. More...
 
Matrix GetFrame () const
 Compute an orthonormal frame attached to the axis. More...
 
- Static Protected Member Functions inherited from Axis
static Matrix GetFrame (const Vector &)
 Compute an orthonormal frame attached to the axis. More...
 
static Vector BoxVector (const Vector &)
 Compute the box vector extent of a unit circle with a given axis. More...
 

Detailed Description

A tubular object is a pierced cylinder.

Note that only the radii are stored, the squared radii are computed on the fly whenever needed.

Constructor & Destructor Documentation

◆ Tubular()

Tubular::Tubular ( const Vector a,
const Vector b,
const double &  ri,
const double &  re 
)
explicit

Creates a tube given vertices and radii.

Parameters
a,bEnd vertices of the axis.
ri,reInternal and external radii.

Member Function Documentation

◆ GetBox()

Box Tubular::GetBox ( ) const

Computes the axis-aligned bounding box of a tube.

See also
Cylinder::GetBox()

◆ Inside()

bool Tubular::Inside ( const Vector p) const

Check if a point is inside or outside the tube.

Parameters
pPoint.

◆ Normal()

Vector Tubular::Normal ( const Vector p) const

Compute the normal vector to a tube.

Parameters
pPoint.

◆ R()

double Tubular::R ( const Vector p) const

Compute the squared distance to a tube.

See also
TreeTubular::Normal
Parameters
pPoint.

◆ Rotate()

void Tubular::Rotate ( const Matrix r)

Rotates a tube.

Parameters
rRotation matrix.

◆ Scale()

void Tubular::Scale ( const double &  s)

Scale a tube.

Parameters
sScaling factor.

◆ Signed()

double Tubular::Signed ( const Vector p) const

Compute the signed Euclidean distance to a tube.

See also
SDFTubular::Normal
Parameters
pPoint.

◆ Translate()

void Tubular::Translate ( const Vector t)

Translate a tube.

Parameters
tTranslation vector.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  s,
const Tubular tubular 
)
friend

Overloaded.

Parameters
sStream.
tubularThe tubular object.