Skip to content
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

Clip method in MeshOperations ignores points that are not part of a cell #311

Open
marcelluethi opened this issue Jan 1, 2020 · 3 comments
Assignees

Comments

@marcelluethi
Copy link
Contributor

When clipping a mesh with the method TriangleMesh3DOperations.clip, one would assume that all the points of the mesh, which satisfy the given predicate are part of the resulting clipped mesh. However, the way it is currently implemented is, that only the points which satisfy the predicate and are part of a triangle are clipped.

In Scalismo we do not enforce that every point in a mesh is part of a triangle. Indeed, it is perfectly valid in Scalismo to create a mesh with an empty triangle list. Therefore we should not assume or enforce that all points are part of a triangle in the clip mesh function.

The same problem most likely occurs when clipping tetrahedral meshes.

@Andreas-Forster
Copy link
Member

I do not fully agree. For a TriangleMesh the natural intuition is, that it consists of triangles. For me, the concept of floating points not associated to any triangle is not represented in this class. For me, the fact that only points used in at least one remaining triangle are kept is a valid post-condition of the function.

Maybe we should discuss the opposite point, why we allow that a user can construct a triangle mesh where not all points are contained in at least one triangle.

@marcelluethi
Copy link
Contributor Author

For me it is not clear how to implement this more strict scenario. Would you throw an exception if not all points are part of a triangle or silently remove these points? Throwing an exception seems not a good option, as perfectly reasonable predicates in the clip operation might lead to such situations. But silently ignoring some points the user has specified could be problematic too, as shown in StatisticalMeshModel.marginal.

@Andreas-Forster
Copy link
Member

Given the discussion in #332 we should address this issue. Maybe we also document which special cases are allowed for TriangleMeshes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants