Python–根据节点坐标画出mesh

发布于 2022-09-01  732 次阅读


Please refresh the page if equations are not rendered correctly.
---------------------------------------------------------------

import numpy as np
import pyvista as pv
import MultilayerCVFEMFYW as fyw
'''Input material parameters and model geometry'''
L,W,H=0.006,0.004,0.0016
# L,W,H=300,300,1.6
dx,dy,dz=0.001,0.001,0.0004
nl,nw,nh=int(L//dx),int(W//dy),int(H//dz)
######################################################
x=np.arange(0,L+dx,dx)
y=np.arange(0,W+dy,dy)
z=np.arange(0.5*dz,H+0.5*dz,dz)
Eachplynodes=int((nl+1)*(nw+1))
Totalnodes=int((nl+1)*(nw+1)*len(z))
EachPlyTriEle=int(nl*nw*2)
TotalTriEle=int(nl*nw*nh*2)
#####################################################
'''1.1 Nodes Coordinates and Triangular elements'''
Points=np.around((fyw.Points(x, y, z, Totalnodes)),decimals=4, out=None)
mesh=pv.PolyData(Points)
mesh.plot(point_size=10, style='points')


不手动关掉图片,则默认code没有完全执行完

Everything not saved will be lost.
最后更新于 2022-09-01