Beispiel #1
0
 def __init__(self, *args, **kw):
     baseGeometryObject.__init__(self, **kw)
     if len(args)==1:
         assert type(args[0]) in (list, tuple, ndarray, ooarray)
         self.vertices = [Point(arg) for arg in args[0]] 
     else:
         self.vertices = [args[i] if type(args[i]) == Point \
                                                else Point(args[i]) for i in range(len(args))]
     self.nVertices = len(self.vertices)
Beispiel #2
0
 def __init__(self, *args, **kw):
     baseGeometryObject.__init__(self, *args, **kw)
     # TODO: add initialization by SLE
     self.basePoint = args[0] if isinstance(args[0], Point) else Point(args[0])
     if 'direction' in kw:
         self.direction = kw['direction']
     else:
         assert len(args) == 2
         #self.direction = (args[1] if isinstance(args[1], point) else point(args[1])) - self.basePoint
         self.direction = array(args[1]).view(ooarray) - self.basePoint.view(ooarray)#if isinstance(args[1], point) else point(args[1])) - self.basePoint
     if type(self.direction) in (Point, ndarray): self.direction = self.direction.view(ooarray)
Beispiel #3
0
 def __init__(self, *args, **kw):
     baseGeometryObject.__init__(self, *args, **kw)
     self.basePoint = args[0] if isinstance(args[0], Point) else Point(args[0])
     if 'directions' in kw:
         self.directions = kw['directions']
     else:
         assert len(args) == 3
         #self.direction = (args[1] if isinstance(args[1], point) else point(args[1])) - self.basePoint
         self.directions = [array(args[1]).view(ooarray) - (self.basePoint).view(ooarray), 
                                       array(args[2]).view(ooarray) - (self.basePoint).view(ooarray)]
     if isinstance(self.directions[0], Point): self.directions[0] = self.directions[0].view(ooarray)
     if isinstance(self.directions[1], Point): self.directions[1] = self.directions[1].view(ooarray)
Beispiel #4
0
 def __init__(self, center, radius, *args, **kw):
     assert len(args) == 0
     baseGeometryObject.__init__(self, *args, **kw)
     self.center = Point(center)
     self.radius = radius
     self.linewidth = kw.get('linewidth', 1)
     self.linestyle = kw.get('linestyle', 'solid')#['solid' | 'dashed' | 'dashdot' | 'dotted']
     self.edgecolor = kw.get('edgecolor', 'b')
     
     self.fill = kw.get('fill', False)
     # transparency and facecolor are ignored for fill = False
     self.transparency = kw.get('transparency', 0.5)
     self.facecolor = kw.get('facecolor', 'w')
     
     self.plotCenter = True
     self.color = kw.get('color', 'k')
Beispiel #5
0
 def __init__(self, center, radius, *args, **kw):
     assert len(args) == 0
     baseGeometryObject.__init__(self, *args, **kw)
     self.center = Point(center)
     self.radius = radius
Beispiel #6
0
 def __init__(self, Start, End, *args, **kw):
     self.color = 'b'
     assert len(args) == 0
     baseGeometryObject.__init__(self, *args, **kw)
     self.points = [Start, End]
Beispiel #7
0
 def __init__(self, *args, **kw):
     ooarray.__init__(self)#, *args, **kw)
     baseGeometryObject.__init__(self, *args, **kw)