ImFusion SDK 4.3
Circle Class Reference

#include <ImFusion/Core/Geometry/Circle.h>

Class representing a circle (actually a disk, so including the inner part) in 3D space. More...

Detailed Description

Class representing a circle (actually a disk, so including the inner part) in 3D space.

Unless stated otherwise, all operations that involve comparisons use the same tolerance epsilon as vec3::isApprox (which is 1e-12).

See also
Intersections between geometry primitives can be computed using the sets of free functions Geometry::intersection() and Geometry::intersects().

Public Member Functions

 Circle (const vec3 &center, const vec3 &normal, double radius)
 Construct a circle from central point, normal and radius.
 
const vec3 & center () const
 
const vec3 & normal () const
 
double radius () const
 
bool isApprox (const Circle &other)
 Comparison using the same epsilon as Eigen::isApprox.
 
bool isEquivalent (const Circle &other)
 Returns if both Circle objects desribe the same geometrical objects.
 
vec3 closestPoint (const vec3 &p) const
 Returns the point on or inside the circle closest to p, or NAN if p is not finite.
 
vec3 closestPointOnBoundary (const vec3 &p) const
 Returns the point on the circle (excluding the enclosed area) closest to p, or NAN if p is not finite.
 
double distanceToPoint (const vec3 &p) const
 Returns the L2 distance between p and closestPoint(p), or NAN if p is not finite.
 
bool includesPoint (const vec3 &p) const
 Returns if p sits on or inside the circle.
 
AlignedBox bounds () const
 Returns the 3D bounds of the circle.
 
bool operator== (const Circle &) const
 Exact comparisons of Circle instances.
 
bool operator!= (const Circle &) const
 

Constructor & Destructor Documentation

◆ Circle()

Circle ( const vec3 & center,
const vec3 & normal,
double radius )

Construct a circle from central point, normal and radius.

A negative radius will be flipped. Zero length normals result in an invalid object that will return NAN/false on most operations.

Member Function Documentation

◆ operator==()

bool operator== ( const Circle & ) const

Exact comparisons of Circle instances.

If you instead want to check if the represented geometric structures are the same, use isEquivalent.

◆ isEquivalent()

bool isEquivalent ( const Circle & other)

Returns if both Circle objects desribe the same geometrical objects.

Note that unlike all other comparisons provided here this allows anti-parallel normals.

◆ closestPointOnBoundary()

vec3 closestPointOnBoundary ( const vec3 & p) const

Returns the point on the circle (excluding the enclosed area) closest to p, or NAN if p is not finite.

Note that the result is not necessarily unique.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close