Skip to content

Commit 2568487

Browse files
committed
fix(Rasterize): handle triangle with degenerated edges
1 parent 07978ef commit 2568487

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/geode/mesh/helpers/rasterize.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,12 @@ namespace
332332
cells.reserve( max_number_cells( min, max ) );
333333
const auto triangle_edges = get_triangle_edges( triangle );
334334
const auto normal = triangle.new_normal();
335-
if( !normal )
335+
if( !normal
336+
|| absl::c_count_if( triangle_edges,
337+
[]( const geode::Segment3D& segment ) {
338+
return segment.length() <= geode::global_epsilon;
339+
} )
340+
> 0 )
336341
{
337342
for( const auto e : geode::LRange{ 3 } )
338343
{

0 commit comments

Comments
 (0)