mirror of
https://github.com/mcneel/opennurbs.git
synced 2026-03-17 14:56:02 +08:00
Sync changes from upstream repository
Co-authored-by: croudyj <croudyj@gmail.com> Co-authored-by: Dale Lear <dalelear@mcneel.com> Co-authored-by: Greg Arden <greg@mcneel.com> Co-authored-by: Pierre Cuvilliers <pierre@mcneel.com> Co-authored-by: Steve Baer <steve@mcneel.com>
This commit is contained in:
@@ -296,6 +296,14 @@ bool ON_Arc::IsCircle() const
|
||||
? true : false;
|
||||
}
|
||||
|
||||
bool ON_Arc::IsLinear(double tol) const
|
||||
{
|
||||
static const double Theta_max = 2*ON_PI - 4.0 * atan(.5); // about 250 degrees
|
||||
return AngleRadians() < Theta_max && // Angle must be less than max
|
||||
radius * (1.0 - cos(AngleRadians() / 2.0)) < tol && // Segment height less than tol
|
||||
radius * 2.0 * sin(AngleRadians() / 2.0) > tol; // Chord length greater than tol
|
||||
}
|
||||
|
||||
double ON_Arc::AngleRadians() const
|
||||
{
|
||||
return m_angle[1]-m_angle[0];
|
||||
|
||||
Reference in New Issue
Block a user