Browse Source

Don't skip caching triangulation for failure

Failed triangulation can have multiple causes but we don't have another
approach, so skipping the cache just causes the same issue to be raised
again and again

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16946
newinvert
Seth Hillbrand 2 years ago
parent
commit
c6c1dbb844
  1. 13
      libs/kimath/src/geometry/shape_poly_set.cpp

13
libs/kimath/src/geometry/shape_poly_set.cpp

@ -3067,7 +3067,10 @@ void SHAPE_POLY_SET::CacheTriangulation( bool aPartition, bool aSimplify )
// This pushes the triangulation for all polys in partitions
// to be referenced to the ii-th polygon
m_triangulationValid &= triangulate( partitions, ii , m_triangulatedPolys );
if( !triangulate( partitions, ii , m_triangulatedPolys ) )
{
wxLogDebug( "Failed to triangulate partitioned polygon %d", ii );
}
}
}
else
@ -3078,11 +3081,13 @@ void SHAPE_POLY_SET::CacheTriangulation( bool aPartition, bool aSimplify )
tmpSet.Fracture( PM_FAST );
m_triangulationValid = triangulate( tmpSet, -1, m_triangulatedPolys );
if( !triangulate( tmpSet, -1, m_triangulatedPolys ) )
{
wxLogDebug( "Failed to triangulate polygon" );
}
}
if( m_triangulationValid )
m_hash = checksum();
m_hash = checksum();
}

Loading…
Cancel
Save