GetObject<BrepEdge> Duplicates Breps?

I’m creating a Rhino command that takes BrepEdges as input. The issues is, even when all brep edges are from the same brep, Rhino says that edgeA.Brep != edgeB.Brep. I have tried using the provided Equals and GetHashCode functions, and they all say these edges come from different breps? The only thing that I can think of is that the the edge getter is duplicating the parent of the edge for every edge. Can anyone help?

You could try Rhino.Geometry.GeometryBase.GeometryEquals() to compare the brep geometry for equality. If you’re selecting the edges with rs.GetObject() with subobjects=True, then you can use the ObjectId property of the returned ObjRef.

1 Like