[Python] Stray Voxels after mesh Voxelization using Pyvista

Discussão em 'Python' iniciado por Stack, Julho 21, 2025.

  1. Stack

    Stack Membro Participativo

    I've been playing around with the Threejs BufferGeometry and Pyvista.

    I was able to export it to Pyvista, the visualization of the mesh works just perfectly :

    Normal Visualization

    but I when I voxalize it, It gets some weird stray voxles all around the 3D Scene :

    Voxelized Mesh

    Did any one faced this kind of issues or knows to fix this kind of issue ?

    Thank you in advance.

    tried meshfix, connectivity and lowering the Pyvista Voxelization density value but It didn't change much.

    EDIT :

    The used code :

    mesh = pv.read("test2.stl")

    p.add_mesh(mesh, color="lightblue", opacity=0.5)

    voxels = pv.voxelize(
    mesh.triangulate(), density=mesh.length / 300, check_surface=False
    ).connectivity()


    p.add_mesh(voxels, color=True, show_edges=True, opacity=1)

    p.enable_anti_aliasing("ssaa")
    p.export_obj("voxeled.obj")
    p.show()

    Continue reading...

Compartilhe esta Página