Open3D icon indicating copy to clipboard operation
Open3D copied to clipboard

"pcl.paint_uniform_color" gives segmentation fault.

Open Mauhing opened this issue 1 year ago • 0 comments

Checklist

Describe the issue

"pcl.paint_uniform_color" gives segmentation fault

Steps to reproduce the bug

import open3d as o3d
import numpy as np
import sys

print("Open3D version: {}".format(o3d.__version__))
print("Python version: {}".format(sys.version))

def check_properties(mesh):
    # From: http://www.open3d.org/docs/release/tutorial/geometry/mesh.html
    mesh.compute_vertex_normals()

    edge_manifold = mesh.is_edge_manifold(allow_boundary_edges=True)
    vertex_manifold = mesh.is_vertex_manifold()
    self_intersecting = mesh.is_self_intersecting()
    watertight = mesh.is_watertight()
    orientable = mesh.is_orientable()

    print(f"  edge_manifold:          {edge_manifold}")
    print(f"  vertex_manifold:        {vertex_manifold}")
    print(f"  self_intersecting:      {self_intersecting}")
    print(f"  watertight:             {watertight}")
    print(f"  orientable:             {orientable}")

    geoms = [mesh]
    if not vertex_manifold:
            print("1")
            verts = np.asarray(mesh.get_non_manifold_vertices())
            print("1")
            pcl = o3d.geometry.PointCloud(
                points=o3d.utility.Vector3dVector(np.asarray(mesh.vertices)[verts]))
            print("1")
            pcl.paint_uniform_color((0.0, 0.0, 1.0)) # segmentation fault
            print("1")
            geoms.append(pcl)
    print("Visualizing the mesh and non-manifold vertices in blue.")
    o3d.visualization.draw_geometries(geoms, mesh_show_back_face=True)
    assert edge_manifold, 'The triangle mesh is not edge-manifold.'

def load_and_visualize_mesh(file_path):
    # Load the triangle mesh
    mesh = o3d.io.read_triangle_mesh(file_path)
    check_properties(mesh)

file_path = "mesh.ply"  # Replace this with the path to your mesh file
load_and_visualize_mesh(file_path)

Error message

Open3D version: 0.18.0 Python version: 3.9.19 (main, May 6 2024, 19:43:03) [GCC 11.2.0] edge_manifold: True vertex_manifold: False self_intersecting: True watertight: False orientable: True 1 1 1 Segmentation fault (core dumped)

Expected behavior

Change the color of the point

Open3D, Python and System information

- Operating system: Pop!_OS 22.04 
- Python version: Python 3.9.12 
- Open3D version: 0.18.0 
- System architecture: x86_64 x86_64 x86_64 GNU/Linux
- Is this a remote workstation?: no
- How did you install Open3D?: pip

Additional information

To download my mesh. 2MB https://drive.google.com/file/d/1eRWxaxAdx6IZKF1VaswgQqO1i45Fr5qr/view?usp=sharing

Mauhing avatar Jun 28 '24 09:06 Mauhing