MeshLib C++ Docs
Loading...
Searching...
No Matches
MRAlignContoursToMesh.h
Go to the documentation of this file.
1#pragma once
2#include "MRMeshFwd.h"
3#include "MRExpected.h"
4#include "MRId.h"
5#include "MRVector2.h"
6#include "MRVector3.h"
7#include "MRMeshTriPoint.h"
8#include "MRCurve.h"
9
10namespace MR
11{
12
14struct ContoursMeshAlignParams
15{
17 MeshTriPoint meshPoint;
18
21 Vector2f pivotPoint{ 0.0f, 0.0f };
22
24 Vector3f xDirection;
25
28 const Vector3f* zDirection{ nullptr };
29
31 float extrusion{ 1.0f };
32
34 float maximumShift{ 2.5f };
35};
36
38MRMESH_API Expected<Mesh> alignContoursToMesh( const Mesh& mesh, const Contours2f& contours, const ContoursMeshAlignParams& params );
39
42{
44 float pivotCurveTime = 0;
45
48 Vector2f pivotBoxPoint{0.0f, 0.0f};
49
51 bool periodicCurve = false;
52
54 bool stretch = true;
55
57 float extrusion{ 1.0f };
58
60 MR_BIND_PREFER_UNLOCK_GIL_WHEN_USED_AS_PARAM
61};
62
64MRMESH_API Expected<Mesh> bendContoursAlongCurve( const Contours2f& contours, const CurveFunc& curve, const BendContoursAlongCurveParams& params );
65
67MRMESH_API Expected<Mesh> bendContoursAlongSurfacePath( const Contours2f& contours, const Mesh& mesh, const MeshTriPoint & start, const SurfacePath& path, const MeshTriPoint & end,
68 const BendContoursAlongCurveParams& params );
69
71MRMESH_API Expected<Mesh> bendContoursAlongSurfacePath( const Contours2f& contours, const Mesh& mesh, const SurfacePath& path,
72 const BendContoursAlongCurveParams& params );
73
78MRMESH_API Expected<std::vector<float>> findPartialLens( const CurvePoints& cp, bool unitLength = true, float * outCurveLen = nullptr );
79
83[[nodiscard]] MRMESH_API CurvePoint getCurvePoint( const CurvePoints& cp, const std::vector<float> & lens, float p );
84
89MRMESH_API Expected<CurveFunc> curveFromPoints( const CurvePoints& cp, bool unitLength = true, float * outCurveLen = nullptr );
90MRMESH_API Expected<CurveFunc> curveFromPoints( CurvePoints&& cp, bool unitLength = true, float * outCurveLen = nullptr );
91
93[[nodiscard]] MRMESH_API CurvePoints meshPathCurvePoints( const Mesh& mesh, const MeshTriPoint & start, const SurfacePath& path, const MeshTriPoint & end );
94[[nodiscard]] MRMESH_API CurvePoints meshPathCurvePoints( const Mesh& mesh, const SurfacePath& path );
95
98MRMESH_API void addBaseToPlanarMesh( Mesh& mesh, float zOffset );
99
100}
#define MRMESH_API
Definition MRMeshFwd.h:80
Definition MRAlignContoursToMesh.h:42
new unsafe ref float pivotCurveTime
new unsafe ref bool periodicCurve
new unsafe ref float extrusion
new unsafe ref MR.Vector2f pivotBoxPoint
Definition MRAlignContoursToMesh.h:15
new unsafe ref float extrusion
new unsafe MR.? ConstBox_Vector3f zDirection
new unsafe ref MR.Vector3f xDirection
new unsafe ref float maximumShift
new unsafe MR.MeshTriPoint meshPoint
new unsafe ref MR.Vector2f pivotPoint
Definition MRCurve.h:10
Definition MRMeshTriPoint.h:23
Definition MRMesh/MRMesh.h:23
MR_BIND_IGNORE auto end(const BitSet &)
Definition MRMesh/MRBitSet.h:382
Definition MRCameraOrientationPlugin.h:8
MRMESH_API Expected< CurveFunc > curveFromPoints(const CurvePoints &cp, bool unitLength=true, float *outCurveLen=nullptr)
MRMESH_API void addBaseToPlanarMesh(Mesh &mesh, float zOffset)
MRMESH_API Expected< Mesh > bendContoursAlongCurve(const Contours2f &contours, const CurveFunc &curve, const BendContoursAlongCurveParams &params)
Converts contours in thick mesh, and deforms it along given path.
MRMESH_API Expected< Mesh > bendContoursAlongSurfacePath(const Contours2f &contours, const Mesh &mesh, const MeshTriPoint &start, const SurfacePath &path, const MeshTriPoint &end, const BendContoursAlongCurveParams &params)
Converts contours in thick mesh, and deforms it along given surface path: start->path->end.
MRMESH_API Expected< Mesh > alignContoursToMesh(const Mesh &mesh, const Contours2f &contours, const ContoursMeshAlignParams &params)
Creates planar mesh out of given contour and aligns it to given surface.
MRMESH_API CurvePoint getCurvePoint(const CurvePoints &cp, const std::vector< float > &lens, float p)
MRMESH_API CurvePoints meshPathCurvePoints(const Mesh &mesh, const MeshTriPoint &start, const SurfacePath &path, const MeshTriPoint &end)
converts polyline given as a number of MeshTriPoint/MeshEdgePoint into CurvePoints
MRMESH_API Expected< std::vector< float > > findPartialLens(const CurvePoints &cp, bool unitLength=true, float *outCurveLen=nullptr)