當前位置: 首頁>>代碼示例>>Python>>正文


Python Surface.__init__方法代碼示例

本文整理匯總了Python中surface.Surface.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python Surface.__init__方法的具體用法?Python Surface.__init__怎麽用?Python Surface.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在surface.Surface的用法示例。


在下文中一共展示了Surface.__init__方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from surface import Surface [as 別名]
# 或者: from surface.Surface import __init__ [as 別名]
 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
開發者ID:elliothevel,項目名稱:whisker_sim,代碼行數:9,代碼來源:circle.py

示例2: __init__

# 需要導入模塊: from surface import Surface [as 別名]
# 或者: from surface.Surface import __init__ [as 別名]
 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))
開發者ID:elliothevel,項目名稱:whisker_sim,代碼行數:9,代碼來源:peg.py

示例3: __init__

# 需要導入模塊: from surface import Surface [as 別名]
# 或者: from surface.Surface import __init__ [as 別名]
 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)
開發者ID:ehsteve,項目名稱:foxsi-optics-sim,代碼行數:30,代碼來源:segmenth.py

示例4: __init__

# 需要導入模塊: from surface import Surface [as 別名]
# 或者: from surface.Surface import __init__ [as 別名]
 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
開發者ID:elliothevel,項目名稱:whisker_sim,代碼行數:10,代碼來源:plane.py

示例5: __init__

# 需要導入模塊: from surface import Surface [as 別名]
# 或者: from surface.Surface import __init__ [as 別名]
 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
開發者ID:elliothevel,項目名稱:whisker_sim,代碼行數:10,代碼來源:sphere.py

示例6: __init__

# 需要導入模塊: from surface import Surface [as 別名]
# 或者: from surface.Surface import __init__ [as 別名]
 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)
開發者ID:ehsteve,項目名稱:foxsi-optics-sim,代碼行數:15,代碼來源:plane.py

示例7: __init__

# 需要導入模塊: from surface import Surface [as 別名]
# 或者: from surface.Surface import __init__ [as 別名]
 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
開發者ID:gotoc,項目名稱:pyjsdl,代碼行數:44,代碼來源:display.py

示例8: __init__

# 需要導入模塊: from surface import Surface [as 別名]
# 或者: from surface.Surface import __init__ [as 別名]
    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
開發者ID:elliothevel,項目名稱:trep_collisions,代碼行數:24,代碼來源:distance.py

示例9: __init__

# 需要導入模塊: from surface import Surface [as 別名]
# 或者: from surface.Surface import __init__ [as 別名]
 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)
開發者ID:humatic,項目名稱:foxsi-optics-sim,代碼行數:25,代碼來源:segment.py

示例10: __init__

# 需要導入模塊: from surface import Surface [as 別名]
# 或者: from surface.Surface import __init__ [as 別名]
 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
開發者ID:elliothevel,項目名稱:trep_collisions,代碼行數:8,代碼來源:ground.py

示例11: __init__

# 需要導入模塊: from surface import Surface [as 別名]
# 或者: from surface.Surface import __init__ [as 別名]
 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)
開發者ID:cheery,項目名稱:essence,代碼行數:8,代碼來源:font.py


注:本文中的surface.Surface.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。