MeshLib C++ Docs
Loading...
Searching...
No Matches
MRMesh/MRContoursCut.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRBitSet.h"
4#include "MRAffineXf3.h"
5#include "MROneMeshContours.h"
6
7namespace MR
8{
9
13{
16 UndirectedEdgeBitSet splitEdges;
17
22};
23
32{
38 FaceMap* new2OldMap{nullptr};
43 enum class ForceFill
44 {
45 None, //< if bad faces occur does not fill anything
46 Good, //< fills all faces except bad ones
47 All //< fills all faces with bad ones, but on bad faces triangulation can also be bad (may have self-intersections or tunnels)
48 } forceFillMode{ ForceFill::None };
49
52};
53
58struct CutMeshResult
59{
61 std::vector<EdgePath> resultCut;
65};
66
83MRMESH_API CutMeshResult cutMesh( Mesh& mesh, const OneMeshContours& contours, const CutMeshParameters& params = {} );
84
85
90MRMESH_API Expected<FaceBitSet> cutMeshByContour( Mesh& mesh, const Contour3f& contour, const AffineXf3f& xf = {} );
91
99[[nodiscard]]
100MRMESH_API Expected<OneMeshContours> convertMeshTriPointsSurfaceOffsetToMeshContours( const Mesh& mesh, const std::vector<MeshTriPoint>& surfaceLine,
101 float offset, SearchPathSettings searchSettings = {} );
102
110[[nodiscard]]
111MRMESH_API Expected<OneMeshContours> convertMeshTriPointsSurfaceOffsetToMeshContours( const Mesh& mesh, const std::vector<MeshTriPoint>& surfaceLine,
112 const std::function<float(int)>& offsetAtPoint, SearchPathSettings searchSettings = {});
113
114} //namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:79
std::vector< OneMeshContour > OneMeshContours
Special data type for MR::cutMesh.
Definition MRMesh/MRIntersectionContour.h:9
MRMESH_API CutMeshResult cutMesh(Mesh &mesh, const OneMeshContours &contours, const CutMeshParameters &params={})
Cuts mesh by given contours.
MRMESH_API Expected< OneMeshContours > convertMeshTriPointsSurfaceOffsetToMeshContours(const Mesh &mesh, const std::vector< MeshTriPoint > &surfaceLine, float offset, SearchPathSettings searchSettings={})
Makes continuous contour by iso-line from mesh tri points, if first and last meshTriPoint is the same...
Definition MRCameraOrientationPlugin.h:8
MRMESH_API Expected< FaceBitSet > cutMeshByContour(Mesh &mesh, const Contour3f &contour, const AffineXf3f &xf={})
tl::expected< T, E > Expected
Definition MRExpected.h:25
Contour3< float > Contour3f
Definition MRMesh/MRMeshFwd.h:317
phmap::flat_hash_map< K, V, Hash, Eq > HashMap
Definition MRMesh/MRMeshFwd.h:528
Parameters of MR::cutMesh.
const SortIntersectionsData * sortData
Definition MRMesh/MRContoursCut.h:36
enum MR::CutMeshParameters::ForceFill None
FaceMap * new2OldMap
This is optional output - map from newly generated faces to old faces (N-1)
Definition MRMesh/MRContoursCut.h:38
NewEdgesMap * new2oldEdgesMap
Optional output map for each new edge introduced after cut maps edge from old topology or old face.
Definition MRMesh/MRContoursCut.h:51
ForceFill
Definition MRMesh/MRContoursCut.h:44
std::vector< EdgePath > resultCut
Paths of new edges on mesh, they represent same contours as input, but already cut.
Definition MRMesh/MRContoursCut.h:61
FaceBitSet fbsWithContourIntersections
Definition MRMesh/MRContoursCut.h:64
Definition MRMesh/MRMesh.h:22
Definition MRMesh/MRContoursCut.h:13
HashMap< UndirectedEdgeId, int > map
Definition MRMesh/MRContoursCut.h:21
UndirectedEdgeBitSet splitEdges
Definition MRMesh/MRContoursCut.h:16
Geo path search settings.
Definition MROneMeshContours.h:82
Definition MROneMeshContours.h:14