![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Core/Geometry/Circle.h>
Class representing a circle (actually a disk, so including the inner part) in 3D space. More...
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).
Public Member Functions | |
| Circle (const vec3 ¢er, 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 |
| 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.
| 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.
| 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.
| 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.