-
Hi! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
I found the addPart method, but after merging two Meshes, the identical vertex parts are not merged. |
Beta Was this translation helpful? Give feedback.
-
Hi,
Actually, there are many different ways of accomplishing it. You can look at our fill hole implementation, for example. As to high-level function, please consider // adds triangles in the existing topology, given face indecies must be free;
// settings.region on output contain the remaining triangles that could not be added into the topology right now, but may be added later when other triangles appear in the mesh
MRMESH_API void addTriangles( MeshTopology & res, const Triangulation & t, const BuildSettings & settings = {} );
// adds triangles in the existing topology, auto selecting face ids for them;
// vertTriples on output contain the remaining triangles that could not be added into the topology right now, but may be added later when other triangles appear in the mesh
MRMESH_API void addTriangles( MeshTopology & res, std::vector<VertId> & vertTriples,
FaceBitSet * createdFaces = nullptr ); //< this set receives indices of added triangles These functions allows one to add triangles to existing mesh topology, properly connecting them with existing triangles, if they share common vertices. And vertex coordinates can be set directly in
/// this version has more parameters:
/// if flipOrientation then every from triangle is inverted before adding
MRMESH_API void Mesh::addPartByMask( const Mesh & from, const FaceBitSet & fromFaces, bool flipOrientation = false,
const std::vector<EdgePath> & thisContours = {}, // contours on this mesh that have to be stitched with
const std::vector<EdgePath> & fromContours = {}, // contours on from mesh during addition
// optionally returns mappings: from.id -> this.id
const PartMapping & map = {} ); It joins new triangles with existing triangles along common edges given in "contour"-arguments. |
Beta Was this translation helpful? Give feedback.
-
For iterating over all 1-ring vertex neighbours
|
Beta Was this translation helpful? Give feedback.
Hi,
Actually, there are many different ways of accomplishing it. You can look at our fill hole implementation, for example.
As to high-level function, please consider
addTriangles
fromMRMeshBuilder.h
: