本文整理汇总了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
示例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))
示例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)
示例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
示例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
示例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)
示例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
示例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
示例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)
示例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
示例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)