本文整理汇总了Python中geometry.Geometry.boundingBox方法的典型用法代码示例。如果您正苦于以下问题:Python Geometry.boundingBox方法的具体用法?Python Geometry.boundingBox怎么用?Python Geometry.boundingBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类geometry.Geometry
的用法示例。
在下文中一共展示了Geometry.boundingBox方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from geometry import Geometry [as 别名]
# 或者: from geometry.Geometry import boundingBox [as 别名]
class Mesh:
## Constructor
def __init__(self, positions=None, indexArray=None):
self._geometry = Geometry(positions)
self.setInexArray(indexArray)
def setPositions(self, positions):
self._geometry.setPositions(positions)
def positions(self):
return self._geometry.positions()
def boundingBox(self):
return self._geometry.boundingBox()
def setNormals(self, normals):
self._geometry.setNormals(normals)
def normals(self):
return self._geometry.normals()
def setInexArray(self, indexArray):
if indexArray is None:
return
indexArray = np.array(indexArray)
self._indexArray = indexArray
if len(indexArray.shape) == 1:
self._geometry.setInexArray(indexArray.ravel())
return
elif indexArray.shape[1] == 3:
self._geometry.setPrimitiveType(GL_TRIANGLES)
elif indexArray.shape[1] == 4:
self._geometry.setPrimitiveType(GL_QUADS)
self._geometry.setInexArray(indexArray.ravel())
def indexArray(self):
return self._indexArray
def setVertexColors(self, vertexColors):
self._geometry.setVertexColors(vertexColors)
def vertexColors(self):
return self._geometry.vertexColors()
def setTexCoords(self, texCoords):
self._geometry.setTexCoords(texCoords)
def gl(self):
self._geometry.gl()