Hi,
I am trying to compare geometries to each other to find duplicates…
In the example below I am having geometry tagged as “a” (two breps) and “b”/“c” which are curves.
I also got two very dirty breps “d” from an external model, which are identical.
“a” is identified as equal, but “d” is not. I assume this happens because the faces of the brep might be build/converted differently.
Is there any chance to match this?
“b” and “c” are not working at all - which confuses me, because even their build-up is identical.
Is there anything I am missing or are there strategies to make this work properly?
Thanks,
T.
tol_abs = sc.doc.ModelAbsoluteTolerance
objs = rs.ObjectsByName("a")
objs = [rs.coercegeometry(id) for id in objs]
print(objs[0].IsDuplicate(objs[1], tol_abs))
objs = rs.ObjectsByName("d")
objs = [rs.coercegeometry(id) for id in objs]
objs = [x.Duplicate() for x in objs]
objs = rs.ObjectsByName("b")
objs = [rs.coercegeometry(id) for id in objs]
print(Rhino.Geometry.GeometryBase.Equals(objs[0], objs[1]))
objs = rs.ObjectsByName("c")
objs = [rs.coercegeometry(id) for id in objs]
print(Rhino.Geometry.GeometryBase.Equals(objs[0], objs[1]))
True
False
False
False
Compare.3dm (416.4 KB)