Mesh.CollapseFacesByArea() stalling Rhino

Hi,

I have a mesh that will stall Rhino indefinitely when running Mesh.CollapseFacesByArea(0.1,0)

collapse_mesh_error.3dm (475.8 KB)

import rhinoscriptsyntax as rs

id = rs.GetObject('Select mesh')
mesh = rs.coercegeometry(id)
mesh.CollapseFacesByArea(0.1, 0)

I tested in V7 as well and there the behaviour is no better

-Willem

FYI
The mesh was created from a ‘crappy’ brep imported from a step ( see brep in file)
(I can provide that is need be but it’s under NDA)

Hi @Willem,

Yeah it’s junk. You can try repairing it. But it’s probably best to just fix the Brep.

– Dale

Hi @dale

I’d like to revive this topic as I ran into this issue a couple times more and consider it a bug, regardless of the mesh input I expect the CollapseFacesByArea to end at some point.

Mesh.CollapseFacesByArea will run like forever only echoing in the commandline “Could not collape face.”
Could it be this is the cause of the process not coming out of a loop?

Attached another example mesh:
CollapseByArea.3dm (767.8 KB)

import rhinoscriptsyntax as rs

id = rs.GetObject('Select mesh')
mesh = rs.coercegeometry(id)
mesh.CollapseFacesByArea(0.1, 0)

Thanks, -Willem

Hi @Willem,

No surprise. Run Check on the mesh and you’ll see this:

General information about this mesh:

Mesh has 27 degenerate faces.
Mesh has 18 non manifold edges.
Mesh has 6 duplicate faces.
Skipping face direction check because of positive non manifold edge count.
Mesh has 32392 pairs of faces that intersect each other.
  This can cause problems if you're doing mesh boolean operations with it.

Mesh has 1558 faces where the face normal differs substantially from the vertex normals.
  These normals can cause problems if the ultimate goal is for rendering or boolean purposes.

– Dale

1 Like