# Exposing Edge Tolerances

I’ve been hoping to visualize edge tolerance in a meaningful way to improve my solid modeling. Has anyone created any scripts which do this? I usually work in grasshopper and python but know of no way to do this. Coloring edges by their tolerance would be my first thought – similar to draft angle analysis (upper bound&lower bound). If there were a way to expose them into grasshopper the visualization would be easy. Sorry if this was googlable and I’ve missed something. Cumulative edge tolerances are such a nuisance that I’d like to be able to check them every now and then to see the good and bad parts of my model. The ‘what’ command will give me the range but not specify which edges are loose.

not 100% sure but you might get the brep edge list and start here to get edge tolerance values.

``````import Rhino
import rhinoscriptsyntax as rs

def ListEdgeTolerance():
id = rs.GetObject("select a surface or brep", 8+16, True, False)
if not id: return

brep = rs.coercebrep(id)
for edge in brep.Edges:
print "Edge:", edge.EdgeIndex, "Tolerance:", edge.Tolerance

if __name__=="__main__":
ListEdgeTolerance()
``````

I´m not sure if the returned lists are in identical order, maybe `brep.DuplicateEdgeCurves()` would give you curves to color. From what i remember, VSR had a dialog to list edge tolerances too…

c.

Hi Alexander, Clement

Maybe we can get the curve straight from the edge object, since BrepEdge inherits from Curve.

I edited Clement’s script, as an example:

``````import Rhino
import rhinoscriptsyntax as rs

def ListEdgeTolerance():
id = rs.GetObject("select a surface or brep", 8+16, True, False)
if not id: return

brep = rs.coercebrep(id)
for edge in brep.Edges:
Rhino.RhinoDoc.ActiveDoc.Objects.AddTextDot( str( edge.Tolerance ), edge.PointAt( edge.Domain.Mid ) )
Rhino.RhinoDoc.ActiveDoc.Views.Redraw()

ListEdgeTolerance()
``````

HTH, Cheers

1 Like

Cool! Thanks to both of you. I’ll be playing with this more this evening. For practical purposes this is all I need. I may see still if I can get the colored edges since it’s so close.