MeshLib C++ Docs
Loading...
Searching...
No Matches
MRMeshTrimWithPlane.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRPch/MRBindingMacros.h"
4#include "MRMeshFwd.h"
5#include "MRPlane3.h"
6#include <functional>
7namespace MR
8{
11
12
18MRMESH_API FaceBitSet subdivideWithPlane( Mesh & mesh, const Plane3f & plane, FaceHashMap * new2Old = nullptr, float eps = 0, std::function<void(EdgeId, EdgeId, float )> onEdgeSplitCallback = nullptr );
19
30[[deprecated]] MRMESH_API MR_BIND_IGNORE void trimWithPlane( Mesh& mesh, const Plane3f & plane,
31 UndirectedEdgeBitSet * outCutEdges = nullptr, FaceHashMap * new2Old = nullptr, float eps = 0, std::function<void( EdgeId, EdgeId, float )> onEdgeSplitCallback = nullptr );
32
43[[deprecated]] MRMESH_API MR_BIND_IGNORE void trimWithPlane( Mesh& mesh, const Plane3f & plane,
44 std::vector<EdgeLoop> * outCutContours, FaceHashMap * new2Old = nullptr, float eps = 0, std::function<void( EdgeId, EdgeId, float )> onEdgeSplitCallback = nullptr );
45
48{
50 Plane3f plane;
52 float eps = 0;
54 std::function<void( EdgeId, EdgeId, float )> onEdgeSplitCallback;
55};
56
59{
61 UndirectedEdgeBitSet* outCutEdges = nullptr;
63 std::vector<EdgeLoop>* outCutContours = nullptr;
65 FaceHashMap* new2Old = nullptr;
67 Mesh* otherPart = nullptr;
69 FaceHashMap* otherNew2Old = nullptr;
71 std::vector<EdgeLoop>* otherOutCutContours = nullptr;
72};
73
81MRMESH_API void trimWithPlane( Mesh& mesh, const TrimWithPlaneParams& params, const TrimOptionalOutput& optOut = {} );
82
83}
float eps
if existing vertex is within eps distance from the plane, then move the vertex not introducing new on...
Definition MRMeshTrimWithPlane.h:52
MRMESH_API MR_BIND_IGNORE void trimWithPlane(Mesh &mesh, const Plane3f &plane, UndirectedEdgeBitSet *outCutEdges=nullptr, FaceHashMap *new2Old=nullptr, float eps=0, std::function< void(EdgeId, EdgeId, float)> onEdgeSplitCallback=nullptr)
trim mesh by plane
MRMESH_API FaceBitSet subdivideWithPlane(Mesh &mesh, const Plane3f &plane, FaceHashMap *new2Old=nullptr, float eps=0, std::function< void(EdgeId, EdgeId, float)> onEdgeSplitCallback=nullptr)
Mesh * otherPart
left part of the trimmed mesh
Definition MRMeshTrimWithPlane.h:67
FaceHashMap * new2Old
mapping from newly appeared triangle to its original triangle (part to full)
Definition MRMeshTrimWithPlane.h:65
std::vector< EdgeLoop > * otherOutCutContours
newly appeared hole contours where each edge does not have right face in otherPart
Definition MRMeshTrimWithPlane.h:71
std::function< void(EdgeId, EdgeId, float)> onEdgeSplitCallback
is invoked each time when an edge is split. Receives edge ID before split, edge ID after split,...
Definition MRMeshTrimWithPlane.h:54
UndirectedEdgeBitSet * outCutEdges
newly appeared hole boundary edges
Definition MRMeshTrimWithPlane.h:61
FaceHashMap * otherNew2Old
mapping from newly appeared triangle to its original triangle (part to full) in otherPart
Definition MRMeshTrimWithPlane.h:69
Plane3f plane
Input plane to cut mesh with.
Definition MRMeshTrimWithPlane.h:50
std::array< Vector3f, 3 > MR_BIND_IGNORE
Definition MRMeshBuilderTypes.h:13
std::vector< EdgeLoop > * outCutContours
newly appeared hole contours where each edge does not have right face
Definition MRMeshTrimWithPlane.h:63
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRMesh.h:23
stores optional output params for trimWithPlane function
Definition MRMeshTrimWithPlane.h:59
stores basic params for trimWithPlane function
Definition MRMeshTrimWithPlane.h:48