1919from OCC .TopoDS import TopoDS_Vertex
2020from OCC .ShapeBuild import ShapeBuild_ReShape
2121
22- from base import KbeObject
23- from Construct import make_vertex
24- from Common import vertex2pnt
22+ from OCCUtils .base import BaseObject
23+ from OCCUtils .Construct import make_vertex
2524
2625
27- class Vertex (TopoDS_Vertex , KbeObject ):
26+ class Vertex (TopoDS_Vertex , BaseObject ):
2827 """
2928 wraps gp_Pnt
3029 """
@@ -33,7 +32,7 @@ class Vertex(TopoDS_Vertex, KbeObject):
3332 def __init__ (self , x , y , z ):
3433 super (Vertex , self ).__init__ ()
3534 """Constructor for KbeVertex"""
36- KbeObject .__init__ (self , name = 'Vertex #{0}' .format (self ._n ))
35+ BaseObject .__init__ (self , name = 'Vertex #{0}' .format (self ._n ))
3736
3837 self ._n += 1 # should be a property of KbeObject
3938 self ._pnt = gp_Pnt (x , y , z )
@@ -49,19 +48,11 @@ def _update(self):
4948 reshape = ShapeBuild_ReShape ()
5049 reshape .Replace (self ._vertex , make_vertex (self ._pnt ))
5150
52- @staticmethod
53- def from_vertex (cls , vertex ):
54- return Vertex .from_pnt (vertex2pnt (vertex ))
55-
5651 @staticmethod
5752 def from_pnt (cls , pnt ):
58- x , y , z = pnt .Coord ()
53+ x , y , z = pnt .X (), pnt . Y (), pnt . Z ()
5954 return cls (x , y , z )
6055
61- @classmethod
62- def from_vec (cls ):
63- raise NotImplementedError
64-
6556 @property
6657 def x (self ):
6758 return self ._pnt .X ()
0 commit comments