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

About the normals #2986

Closed
yangyang117 opened this issue Jul 13, 2024 · 1 comment
Closed

About the normals #2986

yangyang117 opened this issue Jul 13, 2024 · 1 comment
Assignees

Comments

@yangyang117
Copy link

Hi, I want to know how to fix the normal or FlipNormals for a polydata.(pseudonormal?)

and I also want to kown how to get all the point id for one edge of the hole edges.(to show all the edge in different color and people can choose which one to fix)
// Find single edge for each hole in mesh
std::vectorMR::EdgeId holeEdges = mesh.topology.findHoleRepresentiveEdges();

@Grantim
Copy link
Contributor

Grantim commented Jul 15, 2024

Hello!

I want to know how to fix the normal or FlipNormals for a polydata

One can flip all normals in mesh with mesh.topology.flipOrientation()

/// flip orientation (normals) of
/// * all mesh elements if \param fullComponents is nullptr, or
/// * given mesh components in \param fullComponents.
/// The behavior is undefined if fullComponents is given but there are connected components with some edges included and not-included there.
MRMESH_API void flipOrientation( const UndirectedEdgeBitSet * fullComponents = nullptr );


I also want to kown how to get all the point id for one edge of the hole edges

Please have a look at this file https://github.com/MeshInspector/MeshLib/blob/master/source/MRMesh/MRRegionBoundary.h it contains functions to find/track holes' edges.
To find edge points you can use mesh.topology.org( edgeId ) mesh.topology.dest( edgeId )

/// returns origin vertex of half-edge
[[nodiscard]] VertId org( EdgeId he ) const { assert(he.valid()); return edges_[he].org; }
/// returns destination vertex of half-edge
[[nodiscard]] VertId dest( EdgeId he ) const { assert(he.valid()); return edges_[he.sym()].org; }

Also, #1377 reading this issue may be useful

@Fedr Fedr closed this as completed Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants