本文整理汇总了Python中mesh.Mesh.normals方法的典型用法代码示例。如果您正苦于以下问题:Python Mesh.normals方法的具体用法?Python Mesh.normals怎么用?Python Mesh.normals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mesh.Mesh
的用法示例。
在下文中一共展示了Mesh.normals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: readMesh
# 需要导入模块: from mesh import Mesh [as 别名]
# 或者: from mesh.Mesh import normals [as 别名]
def readMesh(self,ncoords,nelems,nplex,props,eltype,normals,sep,objtype='Mesh'):
"""Read a Mesh from a pyFormex geometry file.
The following arrays are read from the file:
- a coordinate array with `ncoords` points,
- a connectivity array with `nelems` elements of plexitude `nplex`,
- if present, a property number array for `nelems` elements.
Returns the Mesh constructed from these data, or a subclass if
an objtype is specified.
"""
# Make sure to import the Mesh subclasses that can be read
from plugins.trisurface import TriSurface
ndim = 3
x = readArray(self.fil,Float,(ncoords,ndim),sep=sep)
e = readArray(self.fil,Int,(nelems,nplex),sep=sep)
if props:
p = readArray(self.fil,Int,(nelems,),sep=sep)
else:
p = None
M = Mesh(x,e,p,eltype)
if objtype != 'Mesh':
try:
clas = locals()[objtype]
except:
clas = globals()[objtype]
M = clas(M)
if normals:
n = readArray(self.fil,Float,(nelems,nplex,ndim),sep=sep)
M.normals = n
return M