so this tests whether a face is trimmed and whether a given u,v coord is trimmed
def is_trimmed(self):
"""
:return: True if the Wire delimiting the Face lies on the bounds
of the surface
if this is not the case, the wire represents a contour that delimits
the face [ think cookie cutter ]
and implies that the surface is trimmed
"""
_round = lambda x: round(x, 3)
a = map(_round, breptools_UVBounds(self))
self.adaptor = BRepAdaptor_Surface(self)
b = map(_round, self.adaptor.Surface().Surface().GetObject().Bounds())
if a != b:
return True
return False
def on_trimmed(self, u, v):
'''tests whether the surface at the u,v parameter has been trimmed
'''
if self._classify_uv is None:
self._classify_uv = BRepTopAdaptor_FClass2d(self, 1e-9)
uv = gp_Pnt2d(u, v)
if self._classify_uv.Perform(uv) == TopAbs_IN:
return True
else:
return False