Пример #1
0
 def __init__(self,
              base=[0, 0, 0],
              focal=200.0,
              seglen=30.0,
              ang=0.006,
              r0=5.5,
              r1=None
              ):
     '''
     Constructor
     
     Parameters:
         base:    the center point of the wide end of the segment
         seglen:  the axial length of the segment
         ang:     angle of the segment side to the axis
         r0:      radius of the wide end of the segment
         r1:      radius of the small end of the segment
     '''
     # instantiate
     Surface.__init__(self)
     self.base = np.array(base, dt)
     self.focal = focal
     self.seglen = seglen
     self.ang = ang
     ''' Vanspeybroeck and Chase Parameters '''
     self.e = cos(4 * ang) * (1 + (tan(4 * ang) * tan(3 * ang)))
     self.d = focal * tan(4 * ang) * tan((4 * ang) - 3 * ang)
     self.updateDims(r0, r1)
Пример #2
0
    def __init__(self,
                 system,
                 frame1,
                 frame2,
                 dist,
                 invalid='short',
                 name='distance'):
        Surface.__init__(self, system, name)
        self.frame1 = self.system.get_frame(frame1)
        self.frame2 = self.system.get_frame(frame2)
        self.tape_measure = trep.TapeMeasure(system, [frame1, frame2])

        # The invalid keyword controls whether phi < 0 when the distance
        # is less than or greater than the specified distance.
        assert invalid in ['short', 'long'], "Incorrect 'invalid' type"
        if invalid == 'short':
            self.sgn = 1.0
        else:
            self.sgn = -1.0

        if isinstance(dist, str):
            self.config = trep.Config(system=self.system,
                                      name=dist,
                                      kinematic=True)
        else:
            self.config = None
            self.dist = dist

        self.dist = dist
        self.sign = 1.0
Пример #3
0
 def __init__(self, system, frame, Y=0, Z=0, R=1, name=None, tolerance=1e-10, ):
     Surface.__init__(self, system, name, tolerance)
     self.frame = frame
     self.Y = Y
     self.Z = Z
     self.R = R
     self.sign = 1.0
Пример #4
0
 def __init__(self, system, Y, Z, frame, tolerance=1e-10, name=None):
     Surface.__init__(self, system, name, tolerance)
     self.Y = Y
     self.Z = Z
     self.frame = frame
     self.sign = -1.0
     self.pegrw = np.array((0, Y, Z, 1))
Пример #5
0
 def __init__(self, system, Y, Z, frame, tolerance=1e-10, name=None):
     Surface.__init__(self, system, name, tolerance)
     self.Y = Y
     self.Z = Z
     self.frame = frame
     self.sign = -1.0
     self.pegrw = np.array((0,Y,Z,1))
Пример #6
0
 def __init__(self, system, X, Y, Z, R, frame, tolerance=1e-10, name=None):
     Surface.__init__(self, system, name, tolerance)
     self.X = X
     self.Y = Y
     self.Z = Z
     self.R = R
     self.frame = frame
     self.sign = -1.0
Пример #7
0
 def __init__(self, system, point, normal, frame, tolerance=1e-10, name=None):
     Surface.__init__(self, system, name, tolerance)
     self.normal = normal
     self.point = point
     self.frame = frame
     self.plane_d = -np.dot(point, normal)
     self.plane_r = np.sqrt(np.dot(normal,normal))
     self.sign = -1.0
Пример #8
0
 def __init__(self, system, X, Y, Z, R, frame, tolerance=1e-10, name=None):
     Surface.__init__(self, system, name, tolerance)
     self.X = X
     self.Y = Y
     self.Z = Z
     self.R = R
     self.frame = frame
     self.sign = -1.0
Пример #9
0
 def __init__(self,
              system,
              frame,
              name=None,
              tolerance=1e-10,
              dim=2,
              lims=(-3, 3)):
     Surface.__init__(self, system, name, tolerance)
     self.frame = frame
     self.dim = dim
     self.lims = lims
     self.sign = 1.0
Пример #10
0
 def __init__(self, origin = [-1,-1,0], ax1 = [2,0,0], ax2 = [0,2,0]):
     '''
     Constructor
     
     Parameters:
         ax1:     first edge of parallelogram as a vector
         ax2:     second edge of parallelogram as a vector
         origin:  the origin coordinate for both axes
     '''
     Surface.__init__(self)
     self.origin = np.array(origin,dt)
     self.ax1 = np.array(ax1,dt)
     self.ax2 = np.array(ax2,dt)
Пример #11
0
 def __init__(self,
              system,
              point,
              normal,
              frame,
              tolerance=1e-10,
              name=None):
     Surface.__init__(self, system, name, tolerance)
     self.normal = normal
     self.point = point
     self.frame = frame
     self.plane_d = -np.dot(point, normal)
     self.plane_r = np.sqrt(np.dot(normal, normal))
     self.sign = -1.0
Пример #12
0
 def __init__(
     self,
     system,
     frame,
     Y=0,
     Z=0,
     R=1,
     name=None,
     tolerance=1e-10,
 ):
     Surface.__init__(self, system, name, tolerance)
     self.frame = frame
     self.Y = Y
     self.Z = Z
     self.R = R
     self.sign = 1.0
Пример #13
0
 def __init__(self, size, buffered):
     Surface.__init__(self, size)
     MouseWheelHandler.__init__(self, True)
     if isinstance(buffered, bool):
         self._bufferedimage = buffered
     else:
         self._bufferedimage = True
     try:
         if self.impl.canvasContext:
             self._isCanvas = True
     except:
         self._isCanvas = False
         self._bufferedimage = False
     if self._bufferedimage:
         self.surface = Surface(size)
     else:
         self.surface = self
     self.resize(size[0], size[1])
     self.images = {}
     self.image_list = []
     self.function = None
     self.time_wait = 0
     self.time = Time()
     self.event = pyjsdl.event
     self.addMouseListener(self)
     self.addMouseWheelListener(self)
     self.addKeyboardListener(self)
     self.sinkEvents(Event.ONMOUSEDOWN | Event.ONMOUSEUP| Event.ONMOUSEMOVE | Event.ONMOUSEOUT | Event.ONMOUSEWHEEL | Event.ONKEYDOWN | Event.ONKEYPRESS | Event.ONKEYUP)
     self.modKey = pyjsdl.event.modKey
     self.specialKey = pyjsdl.event.specialKey
     self._rect_list = []
     self._rect_list.append(Rect(0,0,0,0))
     self._rect_len = 1
     self._rect_num = 0
     self._rect_temp = Rect(0,0,0,0)
     _animationFrame = self._initAnimationFrame()
     if _animationFrame:
         self.time_hold_min = 0
     else:
         self.time_hold_min = 1
     self.time_hold = self.time_hold_min
     self.initialized = False
Пример #14
0
 def __init__(self, size, buffered):
     Surface.__init__(self, size)
     MouseWheelHandler.__init__(self, True)
     if isinstance(buffered, bool):
         self._bufferedimage = buffered
     else:
         self._bufferedimage = True
     try:
         if self.impl.canvasContext:
             self._isCanvas = True
     except:
         self._isCanvas = False
         self._bufferedimage = False
     if self._bufferedimage:
         self.surface = Surface(size)
     else:
         self.surface = self
     self.resize(size[0], size[1])
     self.images = {}
     self.image_list = []
     self.function = None
     self.time_wait = 0
     self.time = Time()
     self.event = pyjsdl.event
     self.addMouseListener(self)
     self.addMouseWheelListener(self)
     self.addKeyboardListener(self)
     self.sinkEvents(Event.ONMOUSEDOWN | Event.ONMOUSEUP| Event.ONMOUSEMOVE | Event.ONMOUSEOUT | Event.ONMOUSEWHEEL | Event.ONKEYDOWN | Event.ONKEYPRESS | Event.ONKEYUP)
     self.modKey = pyjsdl.event.modKey
     self.specialKey = pyjsdl.event.specialKey
     self._rect_list = []
     self._rect_list.append(Rect(0,0,0,0))
     self._rect_len = 1
     self._rect_num = 0
     self._rect_temp = Rect(0,0,0,0)
     _animationFrame = self._initAnimationFrame()
     if _animationFrame:
         self.time_hold_min = 0
     else:
         self.time_hold_min = 1
     self.time_hold = self.time_hold_min
Пример #15
0
    def __init__(self, system, frame1, frame2, dist, invalid='short'):
        Surface.__init__(self, system, 'Distance')
        self.frame1 = self.system.get_frame(frame1)
        self.frame2 = self.system.get_frame(frame2)
        self.tape_measure = trep.TapeMeasure(system, [frame1, frame2])

        # The invalid keyword controls whether phi < 0 when the distance
        # is less than or greater than the specified distance.
        assert invalid in ['short', 'long'], "Incorrect 'invalid' type"
        if invalid == 'short':
            self.sgn = 1.0
        else:
            self.sgn = -1.0

        if isinstance(dist, str):
            self.config = trep.Config(system=self.system, name=dist, kinematic=True)
        else:
            self.config = None
            self.dist = dist

        self.dist = dist
        self.sign = -self.sgn
Пример #16
0
 def __init__(self,
              base = [0,0,0],
              seglen = 30.0,
              ang = 0.006,
              r0 = 5.5,
              r1 = None
              ):
     '''
     Constructor
     
     Parameters:
         base:    the center point of the wide end of the segment
         seglen:  the axial length of the segment
         ang:     angle of the segment side to the axis
         r0:      radius of the wide end of the segment
         r1:      radius of the small end of the segment
     '''
     # instantiate
     Surface.__init__(self)
     self.base = np.array(base,dt)
     self.seglen = seglen
     self.ang = ang
     self.updateDims(r0,r1)
Пример #17
0
 def __init__(self, system, frame, name=None, tolerance=1e-10, dim=2, lims=(-3,3)):
     Surface.__init__(self, system, name, tolerance)
     self.frame = frame
     self.dim = dim
     self.lims = lims
     self.sign = 1.0
Пример #18
0
 def __init__(self, pys, offsets, baseline, mathline):
     Surface.__init__(self, pys)
     self.offsets = offsets
     self.baseline = baseline
     self.mathline = mathline
     self.geometry = rectangle(vec2(0, 0), self.size)