-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleaning and repairing meshes #354
Comments
I believe MeshLab has the same cleaning operations than the R package Rvcg. I already implemented 0 (I called it |
https://sinestesia.co/blog/tutorials/non-manifold-meshes-and-how-to-fix-them/ Basically, a mesh is said to be manifold when it represents a "simple" surface, i.e. when you look at it locally you can imagine a Cartesian plane with two dimensions. When a vertex shares more than 3 edges or when an edge shares more than 2 faces, it means that we have some sort of feature that doesn't belong to the "surface", e.g. a face that is hanging in a T shape. |
Thanks. |
Yes, I think we can aim for a more composable set of transforms. The naming will be difficult but we can certainly do better. |
Hello, |
Let's follow the numbering convention in MeshLab and Rvcg that you shared in #354 (comment). We can create a single transform called """
Repair{K}
Perform repairing operation with code `K`.
## Available operations
- K = 0: duplicated vertices and faces are removed
- K = 1: ...
"""
struct Repair{K} <: StatelessGeometricTransform end
# implement operation K = 0
function apply(transform::Repair{0}, mesh)
# TODO
end You can save this transform in our transforms folder along with the other available geometric transforms. |
Hmm I don't understand this code. Could you show me how to call |
Any transform defined in this package can be applied as a functor, so you can pipe = Repair{0} → Repair{1}
# pipe syntax
mesh |> pipe
# functor syntax
pipe(mesh) |
I've done the job. But I tried |
Should I export |
Can you share your attempt in a PR so that we can review it together? The transform machinery has many fallback implementations and so you need to implement the correct method to get it dispatched correctly. |
@stla I will work on Repair{7}, we already have it implemented because our HalfEdgeTopology constructor reorders the vertices to make the resulting set of faces coherent. |
@stla I added Repair{7}. You mentioned that you already have Repair{0} and Repair{6} implemented right? Mind submitting them as PRs? I've created a check list in this issue so that we track the missing ones. |
@juliohm I have 0 only for removing the duplicated vertices, not the duplicated faces. Then 6 is very similar, it suffices to replace the equality with the closeness. |
@juliohm Now we have everything ready for the clipping. Should we define |
Can you remind what the clip function does exactly? Maybe in a separate issue or Zulip? This issue we are using to track the repairing operations. |
In #353 some cleaning functions were proposed to eliminate vertices of a mesh that are orphan or to "merge" them somehow. Instead of providing this functionality as isolated functions, we should aim for a more composable transform interface.
I propose that we start listing the possible cleaning operations that we would like to implement in this issue, and then we can open separate PRs for each of them. A good list of cleaning operations is available in the MeshLab project as discussed in our Zulip channel.
The text was updated successfully, but these errors were encountered: