-
Notifications
You must be signed in to change notification settings - Fork 98
Open
Description
I am trying to detect tunnels in a mesh using detectTunnelFaces. To test the function, I generated a torus mesh with the following code:
import meshlib.mrmeshpy as mm
import meshlib.mrmeshnumpy as mn
import polyscope as ps
import numpy as np
# Generate torus mesh
torus = mm.makeTorus(2, 1, 100, 100, None)
# Detect tunnels
settings = mm.DetectTunnelSettings()
tunnels = mm.detectTunnelFaces(torus, settings)
# Extract incident vertices
verts_for_move = mm.getIncidentVerts(torus.topology, tunnels)
verts_for_move = mn.getNumpyBitSet(verts_for_move)
# Visualize in Polyscope
ps.init()
verts = mn.getNumpyVerts(torus)
faces = mn.getNumpyFaces(torus.topology)
ps_mesh = ps.register_surface_mesh("mesh", verts, faces)
colors = np.zeros((len(verts), 3), dtype=np.uint8)
colors[verts_for_move] = [1, 0, 0]
ps_mesh.add_color_quantity("colors", colors)
ps.show()
Observed Behavior:
The highlighted tunnel faces (see attached screenshot) don’t seem to correspond to the expected tunnel region on the torus. It looks like the detection is not working as intended.
Expected Behavior:
I expected detectTunnelFaces to highlight the faces corresponding to the actual tunnel of the torus.
Question:
Is my usage of detectTunnelFaces correct for this case?
Should I be using a different function (e.g., detectBasisTunnels) or additional settings for detecting tunnels on a torus?

Metadata
Metadata
Assignees
Labels
No labels