Specifically Rhino.Geometry.Brep.MergeCoplanarFaces()
This is very odd, using a RhinoCommon brep method should not be pushing any messages to the command line about its success or failure… But it does, as if it’s working like the native Rhino command MergeAllCoplanarFaces.
Here is a test script:
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
def SequentialMergeFaces():
obj_ids=rs.GetObjects("Select objects to merge faces",8+16,preselect=True)
if not obj_ids: return
merged=[]
tol=sc.doc.ModelAbsoluteTolerance
atol=Rhino.RhinoMath.ToRadians(0.1)
#atol=sc.doc.ModelAngleToleranceRadians
for i,obj_id in enumerate(obj_ids):
print "Processing object {}/{}".format(i+1,len(obj_ids))
brep=rs.coercebrep(obj_id)
#breps are merged "in place" - success=True if successful
success=brep.MergeCoplanarFaces(tol,atol)
if success: sc.doc.Objects.Replace(obj_ids[i],brep)
sc.doc.Views.Redraw()
SequentialMergeFaces()
Here is the test file - just 3 sorta complicated breps.
MAF-CommLineMsgs.3dm (1.1 MB)
Now, I would expect it to print simply:
Processing object 1/3
Processing object 2/3
Processing object 3/3
Which is what shows in the editor window. However, CommandHistory shows this:
Processing object 1/3
Processing object 2/3
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Processing object 3/3
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
Unable to move edges within face tolerance, nothing done
That’s pretty wild… I specifically tried merging in RhinoCommon because I didn’t want to have the messages printed by the native Rhino command… But nope…