MeshLib C++ Docs
Loading...
Searching...
No Matches
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{
11
12
16{
19 UndirectedEdgeBitSet splitEdges;
20
25};
26
35{
40
42 FaceMap* new2OldMap{nullptr};
43
46 enum class FillPart
47 {
51 } fillPart{ FillPart::Both };
52
57 enum class ForceFill
58 {
62 } forceFillMode{ ForceFill::None };
63
66};
67
73{
75 std::vector<EdgePath> resultCut;
79};
80
97MRMESH_API CutMeshResult cutMesh( Mesh& mesh, const OneMeshContours& contours, const CutMeshParameters& params = {} );
98
99
105[[nodiscard]] MRMESH_API Expected<FaceBitSet> cutMeshByContour( Mesh& mesh, const Contour3f& contour, const AffineXf3f& xf = {} );
106
112[[nodiscard]] MRMESH_API Expected<FaceBitSet> cutMeshByContours( Mesh& mesh, const Contours3f& contours, const AffineXf3f& xf = {} );
113
114
117{
119 Vector3f direction;
120
122 const AffineXf3f* cont2mesh{ nullptr };
123};
124
135
143[[nodiscard]]
144MRMESH_API Expected<OneMeshContours> convertMeshTriPointsSurfaceOffsetToMeshContours( const Mesh& mesh, const std::vector<MeshTriPoint>& surfaceLine,
145 float offset, SearchPathSettings searchSettings = {} );
146
154[[nodiscard]]
155MRMESH_API Expected<OneMeshContours> convertMeshTriPointsSurfaceOffsetToMeshContours( const Mesh& mesh, const std::vector<MeshTriPoint>& surfaceLine,
156 const std::function<float(int)>& offsetAtPoint, SearchPathSettings searchSettings = {});
157
158}
#define MRMESH_API
Definition MRMeshFwd.h:82
CutMeshResult cutMesh(Mesh &mesh, const OneMeshContours &contours, const CutMeshParameters &params={})
Cuts mesh by given contours.
std::vector< OneMeshContour > OneMeshContours
Special data type for MR::cutMesh.
Definition MRIntersectionContour.h:13
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...
Contour3< float > Contour3f
Definition MRMeshFwd.h:375
HashMap< UndirectedEdgeId, int > map
Definition MRContoursCut.h:24
const AffineXf3f * cont2mesh
if set - used to transform contours form its local space to mesh local space
Definition MRContoursCut.h:122
const SortIntersectionsData * sortData
Definition MRContoursCut.h:39
UndirectedEdgeBitSet splitEdges
Definition MRContoursCut.h:19
enum MR::CutMeshParameters::ForceFill None
Contours3< float > Contours3f
Definition MRMeshFwd.h:385
enum MR::CutMeshParameters::FillPart Both
std::vector< EdgePath > resultCut
Paths of new edges on mesh, they represent same contours as input, but already cut.
Definition MRContoursCut.h:75
Expected< std::vector< EdgePath > > cutMeshByProjection(Mesh &mesh, const Contours3f &contours, const CutByProjectionSettings &settings)
Performs orthographic projection with of given contours to mesh and cut result lines,...
tl::expected< T, E > Expected
Definition MRExpected.h:31
FaceMap * new2OldMap
This is optional output - map from newly generated faces to old faces (N-1)
Definition MRContoursCut.h:42
Vector3f direction
direction of projection (in mesh space)
Definition MRContoursCut.h:119
Expected< FaceBitSet > cutMeshByContours(Mesh &mesh, const Contours3f &contours, const AffineXf3f &xf={})
FaceBitSet fbsWithContourIntersections
Definition MRContoursCut.h:78
NewEdgesMap * new2oldEdgesMap
Optional output map for each new edge introduced after cut maps edge from old topology or old face.
Definition MRContoursCut.h:65
ForceFill
Definition MRContoursCut.h:58
FillPart
Definition MRContoursCut.h:47
Expected< FaceBitSet > cutMeshByContour(Mesh &mesh, const Contour3f &contour, const AffineXf3f &xf={})
phmap::flat_hash_map< K, V, Hash, Eq > HashMap
Definition MRMeshFwd.h:603
@ Good
< if bad faces occur does not fill anything
Definition MRContoursCut.h:60
@ None
Definition MRContoursCut.h:59
@ All
< fills all faces except bad ones
Definition MRContoursCut.h:61
@ Both
Definition MRContoursCut.h:48
@ Right
Definition MRContoursCut.h:50
@ Left
Definition MRContoursCut.h:49
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Settings structurer for cutMeshByProjection function.
Definition MRContoursCut.h:117
Parameters of MR::cutMesh.
Definition MRContoursCut.h:35
Definition MRContoursCut.h:73
Definition MRMesh.h:23
Definition MRContoursCut.h:16
Geo path search settings.
Definition MROneMeshContours.h:87
Special data to sort intersections more accurate.
Definition MROneMeshContours.h:17