本文整理汇总了Python中meshpy.tet.MeshInfo.save_poly方法的典型用法代码示例。如果您正苦于以下问题:Python MeshInfo.save_poly方法的具体用法?Python MeshInfo.save_poly怎么用?Python MeshInfo.save_poly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类meshpy.tet.MeshInfo
的用法示例。
在下文中一共展示了MeshInfo.save_poly方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from meshpy.tet import MeshInfo [as 别名]
# 或者: from meshpy.tet.MeshInfo import save_poly [as 别名]
def main():
from math import pi, cos, sin
from meshpy.tet import MeshInfo, build
from meshpy.geometry import generate_surface_of_revolution,\
EXT_CLOSED_IN_RZ, GeometryBuilder
big_r = 3
little_r = 2.9
points = 50
dphi = 2*pi/points
rz = [(big_r+little_r*cos(i*dphi), little_r*sin(i*dphi))
for i in range(points)]
geob = GeometryBuilder()
geob.add_geometry(*generate_surface_of_revolution(rz,
closure=EXT_CLOSED_IN_RZ, radial_subdiv=20))
mesh_info = MeshInfo()
geob.set(mesh_info)
mesh_info.save_nodes("torus")
mesh_info.save_poly("torus")
mesh = build(mesh_info)
mesh.write_vtk("torus.vtk")
mesh.save_elements("torus_mesh")
mesh.save_nodes("torus_mesh")
mesh.write_neu(file("torus.neu", "w"),
{1: ("pec", 0)})
示例2: main
# 需要导入模块: from meshpy.tet import MeshInfo [as 别名]
# 或者: from meshpy.tet.MeshInfo import save_poly [as 别名]
def main():
mesh_info = MeshInfo()
mesh_info.set_points([
(0, 0, 0),
(2, 0, 0),
(2, 2, 0),
(0, 2, 0),
(0, 0, 12),
(2, 0, 12),
(2, 2, 12),
(0, 2, 12),
])
mesh_info.set_facets([
[0, 1, 2, 3],
[4, 5, 6, 7],
[0, 4, 5, 1],
[1, 5, 6, 2],
[2, 6, 7, 3],
[3, 7, 4, 0],
])
mesh_info.save_nodes("bar")
mesh_info.save_poly("bar")
mesh = build(mesh_info)
mesh.save_nodes("barout")
mesh.save_elements("barout")
mesh.save_faces("barout")
mesh.write_vtk("test.vtk")