def __init__(self, edge): ''' ''' assert isinstance(edge, TopoDS_Edge), 'need a TopoDS_Edge, got a %s'% edge.__class__ super(Edge, self).__init__() self.TShape(edge.TShape()) self.Location(edge.Location()) self.Orientation(edge.Orientation()) KbeObject.__init__(self, name='edge') # tracking state self._local_properties_init = False self._curvature_init = False self._geometry_lookup_init = False self._curve_handle = None self._curve = None self._adaptor = None self._adaptor_handle = None # instantiating cooperative classes # cooperative classes are distinct through CamelCaps from normal method -> pep8 self.DiffGeom = DiffGeomCurve(self) self.Intersect = IntersectCurve(self) self.Construct = ConstructFromCurve(self) #self.graphic = GraphicCurve(self) # GeomLProp object self._curvature = None
def __init__(self, edge): ''' ''' assert isinstance( edge, TopoDS_Edge), 'need a TopoDS_Edge, got a %s' % edge.__class__ KbeObject.__init__(self, 'edge') TopoDS_Edge.__init__(self, edge) # tracking state self._local_properties_init = False self._curvature_init = False self._geometry_lookup_init = False self._curve_handle = None self._curve = None self._adaptor = None self._adaptor_handle = None # instantiating cooperative classes # cooperative classes are distinct through CamelCaps from normal method -> pep8 self.DiffGeom = DiffGeomCurve(self) self.Intersect = IntersectCurve(self) self.Construct = ConstructFromCurve(self) #self.graphic = GraphicCurve(self) # GeomLProp object self._curvature = None
def __init__(self, face): """ """ super(Face, self).__init__() self.TShape(face.TShape()) self.Location(face.Location()) self.Orientation(face.Orientation()) KbeObject.__init__(self, name="face") # cooperative classes self.DiffGeom = DiffGeomSurface(self) self._n += 1 # STATE; whether cooperative classes are yet initialized self._curvature_initiated = False self._geometry_lookup_init = False # =============================================================================== # properties # =============================================================================== self._h_srf = None self._srf = None self._adaptor = None self._adaptor_handle = None self._classify_uv = None # cache the u,v classifier, no need to rebuild for every sample self._topo = None # aliasing of useful methods def is_u_periodic(self): return self.adaptor.IsUPeriodic() def is_v_periodic(self): return self.adaptor.IsVPeriodic() def is_u_closed(self): return self.adaptor.IsUClosed() def is_v_closed(self): return self.adaptor.IsVClosed() def is_u_rational(self): return self.adaptor.IsURational() def is_u_rational(self): return self.adaptor.IsVRational() def u_degree(self): return self.adaptor.UDegree() def v_degree(self): return self.adaptor.VDegree() def u_continuity(self): return self.adaptor.UContinuity() def v_continuity(self): return self.adaptor.VContinuity()
def __init__(self, wire): ''' ''' assert isinstance( wire, TopoDS_wire), 'need a TopoDS_Wire, got a %s' % wire.__class__ KbeObject.__init__(self, 'wire') TopoDS_Wire.__init__(self, wire)
def __init__(self, edge): ''' ''' assert isinstance(edge, TopoDS_Edge), 'need a TopoDS_Edge, got a %s'% edge.__class__ KbeObject.__init__(self, 'edge') self._topo_type = TopoDS_Edge self.topo = edge # STATE; whether cooperative classes are initialized self._local_properties_init = False self._curvature_init = False self._geometry_lookup_init = False self._curve_handle = None self._curve = None self._adaptor = None # instantiating cooperative classes self.diff_geom = DiffGeomCurve(self) self.intersect = IntersectCurve(self) self.construct = ConstructFromCurve(self) #self.graphic = GraphicCurve(self) # GeomLProp object self._curvature = None self._local_properties() # some aliasing of useful methods self.is_closed = self.adaptor.IsClosed self.is_periodic = self.adaptor.IsPeriodic self.is_rational = self.adaptor.IsRational self.continuity = self.adaptor.Continuity self.degree = self.adaptor.Degree self.nb_knots = self.adaptor.NbKnots self.nb_poles = self.adaptor.NbPoles
def __init__(self, wire): ''' ''' assert isinstance(wire, TopoDS_wire), 'need a TopoDS_Wire, got a %s'% wire.__class__ KbeObject.__init__(self, 'wire') TopoDS_Wire.__init__(self, wire) # BRepAdaptor_CompCurve
def __init__(self, face): ''' ''' KbeObject.__init__(self, name='face') TopoDS_Face.__init__(self, face) # cooperative classes self.DiffGeom = DiffGeomSurface(self) # STATE; whether cooperative classes are yet initialized self._curvature_initiated = False self._geometry_lookup_init = False #=============================================================================== # properties #=============================================================================== self._h_srf = None self._srf = None self._adaptor = None self._adaptor_handle = None self._classify_uv = None # cache the u,v classifier, no need to rebuild for every sample self._topo = None # aliasing of useful methods def is_u_periodic(self): return self.adaptor.IsUPeriodic() def is_v_periodic(self): return self.adaptor.IsVPeriodic() def is_u_closed(self): return self.adaptor.IsUClosed() def is_v_closed(self): return self.adaptor.IsVClosed() def is_u_rational(self): return self.adaptor.IsURational() def is_u_rational(self): return self.adaptor.IsVRational() def u_degree(self): return self.adaptor.UDegree() def v_degree(self): return self.adaptor.VDegree() def u_continuity(self): return self.adaptor.UContinuity() def v_continuity(self): return self.adaptor.VContinuity()
def __init__(self, face): ''' ''' from OCC.TopoDS import TopoDS_Face KbeObject.__init__(self, name='face') self._topo_type = TopoDS_Face self.topo = face # cooperative classes self.GlobalProperties = GlobalProperties(self) self.DiffGeom = DiffGeomSurface(self) # STATE; whether cooperative classes are yet initialized self._curvature_initiated = False self._geometry_lookup_init = False self._h_srf = None self._srf = None self._adaptor = None self._adaptor_handle = None self._classify_uv = None # cache the u,v classifier, no need to rebuild for every sample # aliasing of useful methods self.is_u_periodic = self.adaptor.IsUPeriodic self.is_v_periodic = self.adaptor.IsVPeriodic self.is_u_closed = self.adaptor.IsUClosed self.is_v_closed = self.adaptor.IsVClosed self.is_u_rational = self.adaptor.IsURational self.is_u_rational = self.adaptor.IsVRational self.u_degree = self.adaptor.UDegree self.v_degree = self.adaptor.VDegree self.u_continuity = self.adaptor.UContinuity self.v_continuity = self.adaptor.VContinuity # meh, RuntimeError... self.nb_u_knots = self.adaptor.NbUKnots self.nb_v_knots = self.adaptor.NbVKnots self.nb_u_poles = self.adaptor.NbUPoles self.nb_v_poles = self.adaptor.NbVPoles