test_voxelfix.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:CuboctSTL 作者: figlax 项目源码 文件源码
def preview_mesh(*args):
    """
    This function plots numpy stl mesh objects entered into args. Note it will scale the preview plot based on the last mesh
    object entered.
    :param args: mesh objects to plot  ex.- preview_mesh(mesh1, mesh2, mesh3)
    :return:
    """
    print ("...preparing preview...")
    # Create a new plot
    figure = pyplot.figure()
    axes = mplot3d.Axes3D(figure)
    for mesh_obj in args:
        axes.add_collection3d(mplot3d.art3d.Poly3DCollection(mesh_obj.vectors))

    # Auto scale to the mesh size. Note it will choose the last mesh
    scale = mesh_obj.points.flatten(-1)
    axes.auto_scale_xyz(scale, scale, scale)

    # Show the plot to the screen
    pyplot.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号