def __init__(self, x, y, z): """Constructor for KbeVertex""" KbeObject.__init__(self, name='Vertex #{0}'.format(self._n)) self._n += 1 # should be a property of KbeObject self._pnt = gp_Pnt(x, y, z) self._vertex = make_vertex(self._pnt) TopoDS_Vertex.__init__(self, self._vertex)
def __init__(self, x,y,z): """Constructor for KbeVertex""" KbeObject.__init__(self, name='Vertex #{0}'.format(self._n)) self._n += 1 # should be a property of KbeObject self._pnt = gp_Pnt(x,y,z) self._vertex = make_vertex(self._pnt) TopoDS_Vertex.__init__(self,self._vertex)
def common_vertex(edg1, edg2): from OCC.TopExp import topexp_CommonVertex vert = TopoDS_Vertex() if topexp_CommonVertex(edg1, edg2, vert): return vert else: raise ValueError('no common vertex found')
def common_vertex(edg1, edg2): vert = TopoDS_Vertex() # topexp.Vertices() if topexp.CommonVertex(edg1, edg2, vert): return vert else: raise ValueError('no common vertex found')
def __init__(self, pnt): if isinstance(pnt, (list, tuple)): self._coord = list(pnt) elif isinstance(pnt, gp_Pnt): self._coord = [pnt.X(), pnt.Y(), pnt.Z()] elif isinstance(pnt, TopoDS_Vertex): pnt = BRep_Tool.Pnt(pnt) self._coord = [pnt.X(), pnt.Y(), pnt.Z()] elif isinstance(pnt, TopoDS_Shape): pnt = BRep_Tool.Pnt(TopoDS_Vertex(pnt)) self._coord = [pnt.X(), pnt.Y(), pnt.Z()] else: raise TypeError
def common_vertex(self, edge): vert = TopoDS_Vertex() if TopExp.CommonVertex(self, edge, vert): return vert else: return False
def common_vertex(cls, edge1, edge2): vert = TopoDS_Vertex() if topexp.CommonVertex(edge1, edge2, vert): return vert else: return None