mirror of
https://github.com/mcneel/opennurbs.git
synced 2026-04-17 19:56:02 +08:00
Sync changes from upstream repository
Co-authored-by: Andrew Le Bihan <andy@mcneel.com> Co-authored-by: Bozo <bozo@mcneel.com> Co-authored-by: croudyj <croudyj@gmail.com> Co-authored-by: Curtis Wensley <curtis.wensley@gmail.com> Co-authored-by: Dale Lear <dalelear@mcneel.com> Co-authored-by: David Eränen <david.eranen@mcneel.com> Co-authored-by: Joshua Kennedy <joshuakennedy102@gmail.com> Co-authored-by: Jussi Aaltonen <jussi@mcneel.com> Co-authored-by: Luis E. Fraguada <luis@mcneel.com> Co-authored-by: Mathias Fuchs <mathias@mcneel.com> Co-authored-by: piac <giulio@mcneel.com> Co-authored-by: Steve Baer <steve@mcneel.com> Co-authored-by: Tim Hemmelman <tim@mcneel.com>
This commit is contained in:
@@ -38,16 +38,21 @@ bool ON_Polyline::IsValid( double tolerance ) const
|
||||
{
|
||||
for ( i = 1; rc && i < m_count; i++ )
|
||||
{
|
||||
if ( m_a[i].DistanceTo(m_a[i-1]) <= tolerance )
|
||||
if (false == m_a[i].IsValid() || false == m_a[i-1].IsValid())
|
||||
rc = false;
|
||||
else if ( m_a[i].DistanceTo(m_a[i-1]) <= tolerance )
|
||||
rc = false;
|
||||
}
|
||||
if ( rc && m_count < 4 && m_a[0].DistanceTo(m_a[m_count-1]) <= tolerance )
|
||||
rc = false;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
for ( i = 1; rc && i < m_count && rc; i++ )
|
||||
{
|
||||
if ( m_a[i] == m_a[i-1] )
|
||||
if (false == m_a[i].IsValid() || false == m_a[i - 1].IsValid())
|
||||
rc = false;
|
||||
else if ( m_a[i] == m_a[i-1] )
|
||||
rc = false;
|
||||
}
|
||||
if ( rc && m_count < 4 && m_a[0] == m_a[m_count-1] )
|
||||
|
||||
Reference in New Issue
Block a user