new flip_until_delaunay mwe

Open
#155 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Run the supplied Python reproducer and inspect mesh.flip_until_delaunay together with control_mesh. Confirm whether the operation introduces edges counted more than twice, then determine the relevant correction path; done means the reproducer no longer reports non-manifold edges after flipping.

Written by the indexing model from the issue text.

Description

Hi Nico I learned to extract sub-meshes here a small problem which still leads to non-manifold edges.

points=[[-59.930511474609375, -16.41863441467285, 72.35279083251953], [-59.930511474609375, -16.431669235229492, 72.3821029663086], [-58.85724639892578, -15.331669807434082, 72.35279083251953], [-58.83051300048828, -15.331669807434082, 72.46239471435547], [-59.930511474609375, -16.821197509765625, 73.45278930664062], [-59.33971405029297, -16.431669235229492, 73.45278930664062], [-58.83051300048828, -15.742518424987793, 73.45278930664062], [-56.74711608886719, -16.431669235229492, 73.45278930664062], [-58.222530364990234, -15.331669807434082, 73.45278930664062], [-57.24854278564453, -15.331669807434082, 73.45278930664062], [-57.73051452636719, -15.331669807434082, 74.52413177490234], [-59.930511474609375, -17.462806701660156, 74.55279541015625], [-56.92106246948242, -17.53166961669922, 74.55279541015625], [-58.866580963134766, -16.431669235229492, 74.55279541015625], [-58.83051300048828, -16.364282608032227, 74.55279541015625], [-58.83051300048828, -16.431669235229492, 74.68785858154297], [-57.181068420410156, -16.431669235229492, 74.55279541015625], [-57.73051452636719, -15.35062026977539, 74.55279541015625], [-57.14170837402344, -18.631669998168945, 75.65279388427734], [-59.22215270996094, -17.53166961669922, 75.65279388427734], [-58.83051300048828, -16.93937873840332, 75.65279388427734], [-58.83051300048828, -17.53166961669922, 76.5542984008789], [-57.28594207763672, -17.53166961669922, 75.65279388427734], [-58.095924377441406, -16.431669235229492, 75.65279388427734], [-57.52948760986328, -16.431669235229492, 75.65279388427734], [-57.73051452636719, -15.959747314453125, 75.65279388427734], [-57.73051452636719, -16.431669235229492, 76.41547393798828], [-57.73051452636719, -15.331669807434082, 76.28267669677734], [-58.83051300048828, -14.231670379638672, 76.5550765991211], [-57.43680191040039, -14.231670379638672, 75.65279388427734], [-57.73051452636719, -14.231670379638672, 75.7003173828125], [-57.45465850830078, -18.631669998168945, 76.75279235839844], [-58.38652420043945, -17.53166961669922, 76.75279235839844], [-57.58670425415039, -17.53166961669922, 76.75279235839844], [-57.73051452636719, -16.8353271484375, 76.75279235839844], [-57.73051452636719, -17.53166961669922, 77.44210815429688], [-57.73051452636719, -16.092775344848633, 76.75279235839844], [-57.73051452636719, -16.431669235229492, 76.94086456298828], [-56.63051223754883, -16.431669235229492, 77.78882598876953], [-58.014957427978516, -15.331669807434082, 76.75279235839844], [-58.83051300048828, -14.508148193359375, 76.75279235839844], [-58.83051300048828, -15.331669807434082, 77.35101318359375], [-56.80352783203125, -15.331669807434082, 76.75279235839844], [-56.63051223754883, -15.288931846618652, 76.75279235839844], [-56.63051223754883, -15.331669807434082, 76.7909164428711], [-57.720733642578125, -18.631669998168945, 77.85279083251953], [-57.73051452636719, -17.339282989501953, 77.85279083251953], [-56.63051223754883, -16.49909019470215, 77.85279083251953]]
faces=[[4, 1, 5], [2, 3, 6], [0, 2, 6], [0, 6, 5], [0, 5, 1], [6, 3, 8], [11, 4, 5], [13, 11, 5], [7, 12, 16], [5, 14, 13], [6, 14, 5], [8, 10, 17], [8, 17, 6], [6, 17, 14], [10, 16, 17], [10, 9, 16], [9, 7, 16], [18, 22, 12], [13, 15, 20], [11, 13, 20], [11, 20, 19], [20, 15, 23], [12, 22, 16], [22, 24, 16], [13, 14, 15], [15, 25, 23], [15, 14, 25], [14, 17, 25], [24, 17, 16], [25, 17, 24], [18, 31, 22], [31, 33, 22], [19, 20, 21], [23, 26, 34], [20, 23, 34], [20, 34, 32], [20, 32, 21], [26, 33, 34], [26, 24, 33], [24, 22, 33], [27, 23, 25], [27, 39, 23], [26, 23, 36], [36, 23, 39], [36, 24, 26], [36, 42, 24], [25, 24, 27], [27, 24, 42], [39, 28, 40], [39, 27, 28], [27, 30, 28], [29, 27, 43], [29, 30, 27], [42, 43, 27], [35, 33, 45], [33, 31, 45], [37, 32, 34], [37, 33, 38], [37, 34, 33], [38, 33, 47], [35, 46, 33], [47, 33, 46], [37, 39, 41], [37, 36, 39], [42, 36, 37], [42, 37, 44], [39, 40, 41], [42, 44, 43]]

import meshplex
import numpy as np
from meshplex import *
import npx

mesh = meshplex.MeshTri(points, faces)
def control_mesh(mesh):
    s = mesh.idx_hierarchy.shape
    a = np.sort(mesh.idx_hierarchy.reshape(s[0], -1).T)
    b, cts = npx.unique_rows(a, return_counts=True)
    if cts.max() > 2:
        bad = np.where(cts > 2)
        print(f"control_mesh found non-manifold edges", bad)

control_mesh(mesh)
mesh.flip_until_delaunay()
control_mesh(mesh)
Dominant language
No language data
Stars
110
Forks
22
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from meshpro/meshplex

All issues in meshpro/meshplex

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.