Пример #1
0
 def __init__(self,*args,**kws):
    Element.__init__(self,*args,**kws)
    self.density=kws.get('density',50)
    self.linewidth=kws.get('linewidth',.015)
    self.color = kws.get("color",YELLOW)
    self.zlines=[]
    self.deps=[]
Пример #2
0
 def __init__(self,*args,**kws):
    Element.__init__(self,*args,**kws)
    self.density=kws.get('density',50)
    self.pointsize=kws.get('pointsize',.1)
    self.color = kws.get("color",CYAN)
    self.zpoints=[]
    self.deps=[]
Пример #3
0
 def setshow(self):
     Element.setshow(self)
     if self.show_normal:
         if self.show and self.Not_null:
             self.nrend.visible = True
         else:
             self.nrend.visible = False
Пример #4
0
    def __init__(self, *args, **kws):
        # inherit geometric intelligence of the Position3 class

        Position3.__init__(self, *args)
        self.Not_null = True
        self._pos = None

        # inherit default attributes and functions common to all PyGeo elements. Overide
        # defaults where desired.

        Element.__init__(self, *args, **kws)
        # override defalut color of Element clasas

        self.color = kws.get("color", CYAN)

        # set defaults for keyword arguments specific to Points and derived classes.

        self.pointsize = kws.get("pointsize", 0.5)
        if self.label:
            self.fontsize = kws.get("fontsize", NORMALFONT)
            self.fontcolor = kws.get("fontcolor", BLACK)
            self.fontXoffset = kws.get("fontXoffset", self.pointsize / 10.0 + 3)
            self.fontYoffset = kws.get("fontYoffset", self.pointsize / 10.0 + 3)

        if self.trace:
            self.tmparray = Position3()
            self.tmparray.set(self)
            self.mintrace = kws.get("mintrace", 0.1)
            self.maxtrace = kws.get("maxtrace", 200.0)
            self.tracewidth = kws.get("tracewidth", self.pointsize / 2.0)
            self.tracecolor = kws.get("tracecolor", self.color)

        self.deps = []
Пример #5
0
   def __init__(self,*args,**kws):
       self.Not_null = True
       self._pos=None

      #inherit default attributes and functions common to all PyGeo elements. Overide
      #defaults where desired.
       Element.__init__(self,*args,**kws)
       
       self.color = kws.get("color",CYAN)
      #set defaults for keyword arguments specific to Points and derived classes.
       self.pointsize=kws.get("pointsize",.1)
       if self.label:
           self.fontsize=kws.get("fontsize",TINYFONT)
           self.fontcolor=kws.get("fontcolor",BLACK)
           self.fontXoffset=kws.get("fontXoffset",self.pointsize/10.+3)
           self.fontYoffset=kws.get("fontYoffset",self.pointsize/10.+3)
       if self.trace:
           self.tmparray=CPosition()
           self.tmparray.set(self)
           self.tracecurve=kws.get("tracecurve",True)
           self.mintrace=kws.get("mintrace",.0001)
           self.maxtrace=kws.get("maxtrace",50.)
           self.tracewidth=kws.get("tracewidth",self.pointsize/2.0)
           self.tracecolor=kws.get("tracecolor",self.color)
       self.deps=[]
Пример #6
0
 def init(self):
    if self.line .seg:
       self.toInterpolated(self.line.p1,self.line.p2,self.ratio)
    else:
       self.maxplus=Position3(MAX*self.line.getDirection()+self.line.p2)
       self.maxminus=Position3(-MAX*self.line.getDirection()+self.line.p1)
       self.toInterpolated(self.maxplus,self.maxminus,self.ratio)
    Element.init(self)
Пример #7
0
 def init(self):
   x=sin(self.theta)*cos(self.phi)
   y=sin(self.theta)*sin(self.phi)
   z=cos(self.theta)
   self.set(vector(x,y,z))
   self.initvector=Position3()
   self.initvector.set(self)
   Element.init(self)
Пример #8
0
 def __init__(self, *args, **kws):
     Element.__init__(self, *args, **kws)
     self.color = kws.get("color", MAGENTA)
     self.density = kws.get("density", 50)
     self.linewidth = kws.get("linewidth", 0.1)
     self.drawradius = kws.get("drawradius", 5)
     self.lines = []
     self.element_array = self.lines
     self.deps = []
Пример #9
0
 def __init__(self, *args, **kws):
     Element.__init__(self, *args, **kws)
     self.precision = kws.get("precision", 70)
     self.linewidth = kws.get("linewidth", 0.05)
     self.color = kws.get("color", RED)
     self.style = kws.get("style", LINES)
     self.density = kws.get("density", 30)
     self.circles = []
     self.deps = []
Пример #10
0
 def __init__(self, *args, **kws):
     Element.__init__(self, *args, **kws)
     self.color = kws.get("color", RED)
     self.linewidth = kws.get("linewidth", 0.1)
     self.style = kws.get("style", "LINES")
     self.density = kws.get("density", 25)
     self.scale = kws.get("scale", 1)
     self.planes = []
     self.element_array = self.planes
     self.deps = []
Пример #11
0
 def __init__(self, *args, **kws):
     Element.__init__(self, *args, **kws)
     self.color = kws.get("color", WHITE)
     self.style = kws.get("style", LINES)
     self.linewidth = kws.get("linewidth", 0.02)
     self.scale = kws.get("scale", 10)
     self.show_normal = kws.get("show_normal", False)
     self.normal_width = kws.get("normal_width", 0.4)
     self._u = Position3(0, 0, 0)
     self._s = Position3(0, 0, 0)
     self._d = 0
     self.deps = []
Пример #12
0
 def __init__(self, *args, **kws):
     Element.__init__(self, *args, **kws)
     self.density = kws.get("density", 50)
     self.pointsize = kws.get("pointsize", 0.4)
     self.color = kws.get("color", CYAN)
     self.drawcurve = kws.get("drawcurve", False)
     self.drawpoints = kws.get("drawpoints", True)
     if self.drawcurve:
         self.linewidth = kws.get("linewidth", 0.2)
     self.points = []
     self.element_array = self.points
     self.deps = []
Пример #13
0
 def __init__(self, *args, **kws):
     Element.__init__(self, *args, **kws)
     self.precision = kws.get("precision", 10)
     self.color = kws.get("color", GREEN)
     self.style = kws.get("style", LINES)
     self.linewidth = kws.get("linewidth", 0.1)
     self.fixed = kws.get("fixed", False)
     self._radius = 0
     self._radiusSquared = 0
     self._cpoint = _Point(append=False)
     self._center = _Point(append=False)
     if self.fixed is True:
         self.init = self._findSelf
     self.deps = []
Пример #14
0
 def __init__(self,*args,**kws):
    Element.__init__(self,*args,**kws)
    self.precision = kws.get("precision",40)
    self.linewidth=kws.get("linewidth",.02)
    self.color = kws.get("color",GREEN)
    self.show_normal=kws.get("show_normal",False)
    self.normal_width=kws.get("normal_width",.02)
    self.bounds1 = None
    self.bounds2 = None
    if self.label:
       self.fontsize=kws.get("fontsize",TINYFONT)
       self.fontcolor=kws.get("fontcolor",BLACK)
       self.fontXoffset=kws.get("fontXoffset",self.pointsize/10.+3)
       self.fontYoffset=kws.get("fontYoffset",self.pointsize/10.+3)
       self.lratio=kws.get("label_ratio",.5)
    self.p1=_zPoint(append=False)
    self.p2=_zPoint(append=False)
Пример #15
0
 def __init__(self,*args,**kws):
    self.precision = kws.get("precision",40)
    self.style = kws.get("style",LINES)
    self.linewidth = kws.get("linewidth",.02)
    self.show_normal=False
    self._u=vector(0,0,1)
    self._s=CPosition(1,0)
    self._radiusSquared=0
    self._radius=0
    self._d=0
    self._center=_zPoint(append=False)
    self._cpoint=_zPoint(append=False)
    Element.__init__(self,*args,**kws)
    self.color = kws.get("color",BLUE)
    O = kws.get("O","+")
    if O=="+":
       self.a=1
    else:
       self.a=-1
Пример #16
0
 def __init__(self, *args, **kws):
     Element.__init__(self, *args, **kws)
     self.precision = kws.get("precision", 40)
     self.color = kws.get("color", BLUE)
     self.style = kws.get("style", LINES)
     self.show_normal = kws.get("show_normal", False)
     self.normal_width = kws.get("normal_width", 0.4)
     self.fixed = kws.get("fixed", False)
     self.linewidth = kws.get("linewidth", 0.2)
     if self.fixed is True:
         self.init = self._findSelf
     self._radius = 0
     self._radiusSquared = 0
     self._u = Position3(0, 0, 0)
     self._s = Position3(0, 0, 0)
     self._d = 0
     self._center = _Point(append=False)
     self._cpoint = _Point(append=False)
     self.type = kws.get("type", "Center")
     #      self.draw()
     self.deps = []
Пример #17
0
    def __init__(self, *args, **kws):
        Element.__init__(self, *args, **kws)
        self.linewidth = kws.get("linewidth", 0.2)
        self.color = kws.get("color", GREEN)
        self.show_normal = kws.get("show_normal", False)
        self.normal_width = kws.get("normal_width", 0.4)
        self.seg = kws.get("seg", False)
        self.bounds1 = None
        self.bounds2 = None
        self.direction = Position3()
        self.normal = Position3()
        if self.label:
            self.fontsize = kws.get("fontsize", NORMALFONT)
            self.fontcolor = kws.get("fontcolor", BLACK)
            self.lratio = kws.get("label_ratio", 0.5)
            self.fontXoffset = kws.get("fontXoffset", self.linewidth / 10 + 1)
            self.fontYoffset = kws.get("fontYoffset", self.linewidth / 10 + 1)

        self.p1 = _Point(append=False)
        self.p2 = _Point(append=False)
        if self.trace:
            self.tracewidth = kws.get("tracewidth", self.linewidth)
            self.tracecolor = kws.get("tracecolor", self.color)
        self.deps = []
Пример #18
0
 def init(self):
    x=sin(self.theta)*cos(self.phi)
    y=sin(self.theta)*sin(self.phi)
    z=cos(self.theta)
    self.set(vector(x,y,z)*self.sphere._radius+self.sphere._center)
    Element.init(self)
Пример #19
0
 def init(self):
    self.toInterpolated(self.line.p1,self.line.p2,self.t)
    Element.init(self)
Пример #20
0
 def init(self):
    self.set(self.ucircle._cpoint)
    Element.init(self)
Пример #21
0
 def init(self):
   x=sin(self.theta)*cos(self.phi)
   y=sin(self.theta)*sin(self.phi)
   z=cos(self.theta)
   self.set(vector(x,y,z))
   Element.init(self)
Пример #22
0
 def rmatrix(self):
     center = self._center
     mat = Element.rmatrix(self)
     mat[3:] = array((center.x, center.y, center.z, 1.0), "d")
     return mat
Пример #23
0
 def init(self):
    self.set(self.ucircle._cpoint)
    self.toCircumPoint(self.ucircle,self.angle)
    Element.init(self)
Пример #24
0
 def init(self):
    circle=self.zcircle
    self.set(circle._radius*(math_E**complex(0,self.angle))+circle._center)
    Element.init(self)
Пример #25
0
 def init(self):
    self.set(self.zline.p1*(1.0-self.ratio)+self.zline.p2*self.ratio)
    Element.init(self)
Пример #26
0
 def init(self):
    self.set(self.zLine.p1)
    Element.init(self)
Пример #27
0
 def init(self):
    self.set(self.zcircle._s*self.zcircle._radius+self.zcircle._center)
    Element.init(self)
Пример #28
0
 def __init__(self,*args,**kws):
    Element.__init__(self,*args,**kws)
    self.color = kws.get("color",None)
    self.level = kws.get("level",None)
    self.deps=[]
Пример #29
0
 def rmatrix(self):
    mat=Element.rmatrix(self)
    mat[3:]=array([[0.0,0.0,0.0,1.0]])
    return mat