Project
Loading...
Searching...
No Matches
o2::cad::surface::TorusBoundedSurface Class Referencefinal

#include <BoundedSurface.h>

Inherits o2::cad::surface::BoundedSurface.

Public Member Functions

bool initialize (const Vec3 &centerPoint, const Vec3 &axis, const Vec3 &referenceAxisU, double majorRadius, double minorRadius, double phiStart, double phiSweep, double tubeStart, double tubeSweep, bool innerWall, std::string &errorMessage)
 
bool initialize (const Vec3 &centerPoint, const Vec3 &axis, const Vec3 &referenceAxisU, double majorRadius, double minorRadius, double phiStart, double phiSweep, double tubeStart, double tubeSweep, bool innerWall, const std::vector< Curve2D > &outerTrim, const std::vector< std::vector< Curve2D > > &innerTrims, std::string &errorMessage, double joinTolerance=kWireJoinTolerance)
 Wire-trimmed overload: the wires in the (phiRing, phiTube) domain decide containment; a trim wrapping a full turn is refused.
 
bool hasWireTrim () const
 
bool pointInTrim (double phiRing, double phiTube, bool *boundary=nullptr) const
 Whether (phiRing, phiTube) lies in the trim wire, both angles unwrapped into their windows.
 
bool fullRingSweep () const
 
bool fullTubeSweep () const
 
Vec3 toLocal (const Vec3 &point) const
 
bool ringInSweep (double phiRing) const
 
bool tubeInSweep (double phiTube) const
 
Vec3 pointAt (double phiRing, double phiTube) const
 
Vec3 localNormal (const Vec3 &localPoint) const
 Unit outward normal (pointing away from the tube spine) from a local surface point.
 
bool containsPointOnSurface (const Vec3 &point) const override
 True if the 3D point lies on the trimmed patch within tolerance.
 
void appendIntersections (const Vec3 &rayOrigin, const Vec3 &rayDirection, double minDistance, double maxDistance, std::vector< RayHit > &hits) const override
 Append every hit of the ray with the trimmed patch in [minDistance, maxDistance], with the outward normal; no tangential grazes.
 
double distanceSqToPatch (const Vec3 &point) const override
 Distance to the patch: exact for the full torus by the meridian distance, a lower bound for a trimmed patch.
 
Vec3 normalAt (const Vec3 &point) const override
 Outward-oriented normal at (or nearest to) the given point.
 
void parametricMetric (const Vec2 &uv, double &gUU, double &gUV, double &gVV) const override
 (u, v) = (phiRing[rad], phiTube[rad]): the tube scale is r, the ring scale the distance from the axis.
 
double capacityContribution () const override
 Divergence-theorem contribution over the (phiRing, phiTube) rectangle; a wire trim uses the contour form.
 
bool capacityIsExact () const override
 Whether capacityContribution() is analytically exact for this surface.
 
void conservativeBounds (Vec3 &lower, Vec3 &upper) const override
 Accumulate a conservative axis-aligned bounding box of the trimmed patch.
 
void appendCoverBoxes (std::vector< CoverBox > &boxes) const override
 Cover boxes: the full torus in angular chunks, since the meridian projection ignores the trim; a spindle torus uses one box.
 
int ringSegments () const
 
int tubeSegments () const
 
void appendDisplayMesh (std::vector< Vec3 > &vertices, std::vector< std::array< int, 3 > > &triangles) const override
 Append this patch's visualization triangulation (navigation must never depend on it).
 
void appendDirectedEdges (std::vector< std::pair< Vec3, Vec3 > > &edges) const override
 Append the 3D directed boundary edges of the patch, for solid-closure validation.
 
bool sampleTrimCurve (size_t index, std::vector< Vec3 > &samples) const override
 Sample trim curve index into 3D, in construction order; false when this face has no such curve.
 
- Public Member Functions inherited from o2::cad::surface::BoundedSurface
virtual ~BoundedSurface ()=default
 
double parametricLengthSqAt (const Vec2 &uv, const Vec2 &delta) const
 The 3D length squared spanned by a parametric displacement delta starting at uv.
 
virtual void appendRims (std::vector< SurfaceRim > &rims) const
 Append the trim boundary as rims, one polyline per loop; the default chains appendDirectedEdges().
 
void setBoundaryEdges (std::vector< BoundaryEdgeRef > refs)
 
const std::vector< BoundaryEdgeRef > & boundaryEdges () const
 

Additional Inherited Members

- Public Types inherited from o2::cad::surface::BoundedSurface
using CoverBox = std::pair< Vec3, Vec3 >
 One axis-aligned cover box of the sub-patch BVH, as a (lower corner, upper corner) pair.
 
- Protected Attributes inherited from o2::cad::surface::BoundedSurface
std::vector< BoundaryEdgeRefmBoundaryEdges
 

Detailed Description

A torus of major radius R and minor radius r, trimmed to a (phiRing, phiTube) rectangle or by curve wires; X(u, v) = centre + (U cos u + V sin u)(R + r cos v) + W r sin v, orientation-consistent with the outward normal.

Definition at line 4213 of file BoundedSurface.h.

Member Function Documentation

◆ appendCoverBoxes()

void o2::cad::surface::TorusBoundedSurface::appendCoverBoxes ( std::vector< CoverBox > &  boxes) const
inlineoverridevirtual

Cover boxes: the full torus in angular chunks, since the meridian projection ignores the trim; a spindle torus uses one box.

Reimplemented from o2::cad::surface::BoundedSurface.

Definition at line 4515 of file BoundedSurface.h.

◆ appendDirectedEdges()

void o2::cad::surface::TorusBoundedSurface::appendDirectedEdges ( std::vector< std::pair< Vec3, Vec3 > > &  edges) const
inlineoverridevirtual

Append the 3D directed boundary edges of the patch, for solid-closure validation.

Implements o2::cad::surface::BoundedSurface.

Definition at line 4584 of file BoundedSurface.h.

◆ appendDisplayMesh()

void o2::cad::surface::TorusBoundedSurface::appendDisplayMesh ( std::vector< Vec3 > &  vertices,
std::vector< std::array< int, 3 > > &  triangles 
) const
inlineoverridevirtual

Append this patch's visualization triangulation (navigation must never depend on it).

Implements o2::cad::surface::BoundedSurface.

Definition at line 4559 of file BoundedSurface.h.

◆ appendIntersections()

void o2::cad::surface::TorusBoundedSurface::appendIntersections ( const Vec3 rayOrigin,
const Vec3 rayDirection,
double  minDistance,
double  maxDistance,
std::vector< RayHit > &  hits 
) const
inlineoverridevirtual

Append every hit of the ray with the trimmed patch in [minDistance, maxDistance], with the outward normal; no tangential grazes.

Implements o2::cad::surface::BoundedSurface.

Definition at line 4354 of file BoundedSurface.h.

◆ capacityContribution()

double o2::cad::surface::TorusBoundedSurface::capacityContribution ( ) const
inlineoverridevirtual

Divergence-theorem contribution over the (phiRing, phiTube) rectangle; a wire trim uses the contour form.

Implements o2::cad::surface::BoundedSurface.

Definition at line 4445 of file BoundedSurface.h.

◆ capacityIsExact()

bool o2::cad::surface::TorusBoundedSurface::capacityIsExact ( ) const
inlineoverridevirtual

Whether capacityContribution() is analytically exact for this surface.

Implements o2::cad::surface::BoundedSurface.

Definition at line 4491 of file BoundedSurface.h.

◆ conservativeBounds()

void o2::cad::surface::TorusBoundedSurface::conservativeBounds ( Vec3 lower,
Vec3 upper 
) const
inlineoverridevirtual

Accumulate a conservative axis-aligned bounding box of the trimmed patch.

Implements o2::cad::surface::BoundedSurface.

Definition at line 4493 of file BoundedSurface.h.

◆ containsPointOnSurface()

bool o2::cad::surface::TorusBoundedSurface::containsPointOnSurface ( const Vec3 point) const
inlineoverridevirtual

True if the 3D point lies on the trimmed patch within tolerance.

Implements o2::cad::surface::BoundedSurface.

Definition at line 4335 of file BoundedSurface.h.

◆ distanceSqToPatch()

double o2::cad::surface::TorusBoundedSurface::distanceSqToPatch ( const Vec3 point) const
inlineoverridevirtual

Distance to the patch: exact for the full torus by the meridian distance, a lower bound for a trimmed patch.

Implements o2::cad::surface::BoundedSurface.

Definition at line 4428 of file BoundedSurface.h.

◆ fullRingSweep()

bool o2::cad::surface::TorusBoundedSurface::fullRingSweep ( ) const
inline

Definition at line 4293 of file BoundedSurface.h.

◆ fullTubeSweep()

bool o2::cad::surface::TorusBoundedSurface::fullTubeSweep ( ) const
inline

Definition at line 4294 of file BoundedSurface.h.

◆ hasWireTrim()

bool o2::cad::surface::TorusBoundedSurface::hasWireTrim ( ) const
inline

Definition at line 4283 of file BoundedSurface.h.

◆ initialize() [1/2]

bool o2::cad::surface::TorusBoundedSurface::initialize ( const Vec3 centerPoint,
const Vec3 axis,
const Vec3 referenceAxisU,
double  majorRadius,
double  minorRadius,
double  phiStart,
double  phiSweep,
double  tubeStart,
double  tubeSweep,
bool  innerWall,
const std::vector< Curve2D > &  outerTrim,
const std::vector< std::vector< Curve2D > > &  innerTrims,
std::string &  errorMessage,
double  joinTolerance = kWireJoinTolerance 
)
inline

Wire-trimmed overload: the wires in the (phiRing, phiTube) domain decide containment; a trim wrapping a full turn is refused.

Definition at line 4256 of file BoundedSurface.h.

◆ initialize() [2/2]

bool o2::cad::surface::TorusBoundedSurface::initialize ( const Vec3 centerPoint,
const Vec3 axis,
const Vec3 referenceAxisU,
double  majorRadius,
double  minorRadius,
double  phiStart,
double  phiSweep,
double  tubeStart,
double  tubeSweep,
bool  innerWall,
std::string &  errorMessage 
)
inline

Definition at line 4216 of file BoundedSurface.h.

◆ localNormal()

Vec3 o2::cad::surface::TorusBoundedSurface::localNormal ( const Vec3 localPoint) const
inline

Unit outward normal (pointing away from the tube spine) from a local surface point.

Definition at line 4320 of file BoundedSurface.h.

◆ normalAt()

Vec3 o2::cad::surface::TorusBoundedSurface::normalAt ( const Vec3 point) const
inlineoverridevirtual

Outward-oriented normal at (or nearest to) the given point.

Implements o2::cad::surface::BoundedSurface.

Definition at line 4436 of file BoundedSurface.h.

◆ parametricMetric()

void o2::cad::surface::TorusBoundedSurface::parametricMetric ( const Vec2 uv,
double &  gUU,
double &  gUV,
double &  gVV 
) const
inlineoverridevirtual

(u, v) = (phiRing[rad], phiTube[rad]): the tube scale is r, the ring scale the distance from the axis.

Implements o2::cad::surface::BoundedSurface.

Definition at line 4439 of file BoundedSurface.h.

◆ pointAt()

Vec3 o2::cad::surface::TorusBoundedSurface::pointAt ( double  phiRing,
double  phiTube 
) const
inline

Definition at line 4312 of file BoundedSurface.h.

◆ pointInTrim()

bool o2::cad::surface::TorusBoundedSurface::pointInTrim ( double  phiRing,
double  phiTube,
bool *  boundary = nullptr 
) const
inline

Whether (phiRing, phiTube) lies in the trim wire, both angles unwrapped into their windows.

Definition at line 4286 of file BoundedSurface.h.

◆ ringInSweep()

bool o2::cad::surface::TorusBoundedSurface::ringInSweep ( double  phiRing) const
inline

Definition at line 4302 of file BoundedSurface.h.

◆ ringSegments()

int o2::cad::surface::TorusBoundedSurface::ringSegments ( ) const
inline

Definition at line 4549 of file BoundedSurface.h.

◆ sampleTrimCurve()

bool o2::cad::surface::TorusBoundedSurface::sampleTrimCurve ( size_t  index,
std::vector< Vec3 > &  samples 
) const
inlineoverridevirtual

Sample trim curve index into 3D, in construction order; false when this face has no such curve.

Reimplemented from o2::cad::surface::BoundedSurface.

Definition at line 4623 of file BoundedSurface.h.

◆ toLocal()

Vec3 o2::cad::surface::TorusBoundedSurface::toLocal ( const Vec3 point) const
inline

Definition at line 4296 of file BoundedSurface.h.

◆ tubeInSweep()

bool o2::cad::surface::TorusBoundedSurface::tubeInSweep ( double  phiTube) const
inline

Definition at line 4307 of file BoundedSurface.h.

◆ tubeSegments()

int o2::cad::surface::TorusBoundedSurface::tubeSegments ( ) const
inline

Definition at line 4554 of file BoundedSurface.h.


The documentation for this class was generated from the following file: