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{
14
15
18{
21
24 Vector2f pivotPoint{ 0.0f, 0.0f };
25
27 Vector3f xDirection;
28
31 const Vector3f* zDirection{ nullptr };
32
34 float extrusion{ 1.0f };
35
37 float maximumShift{ 2.5f };
38};
39
42
45{
48 float pivotCurveTime = 0;
49
52 Vector2f pivotBoxPoint{0.0f, 0.0f};
53
55 bool periodicCurve = false;
56
58 bool stretch = true;
59
61 float extrusion{ 1.0f };
62};
63
66
69 const BendContoursAlongCurveParams& params );
70
73 const BendContoursAlongCurveParams& params );
74
78MRMESH_API Expected<std::vector<float>> findPartialLens( const CurvePoints& cp, float * outCurveLen = nullptr );
79
83[[nodiscard]] MRMESH_API CurvePoint getCurvePoint( const CurvePoints& cp, const std::vector<float> & lens, float p );
84
88MRMESH_API Expected<CurveFunc> curveFromPoints( const CurvePoints& cp, float * outCurveLen = nullptr );
89MRMESH_API Expected<CurveFunc> curveFromPoints( CurvePoints&& cp, float* outCurveLen = nullptr );
90
92[[nodiscard]] MRMESH_API CurvePoints meshPathCurvePoints( const Mesh& mesh, const GeodesicPath& path );
93[[nodiscard]] MRMESH_API CurvePoints meshPathCurvePoints( const Mesh& mesh, const SurfacePath& path );
94
97MRMESH_API void addBaseToPlanarMesh( Mesh& mesh, float zOffset );
98
99}
#define MRMESH_API
Definition MRMeshFwd.h:80
Expected< CurveFunc > curveFromPoints(const CurvePoints &cp, float *outCurveLen=nullptr)
const Vector3f * zDirection
Definition MRAlignContoursToMesh.h:31
float extrusion
Contours extrusion outside of curve level.
Definition MRAlignContoursToMesh.h:61
Expected< Mesh > bendContoursAlongCurve(const Contours2f &contours, const CurveFunc &curve, const BendContoursAlongCurveParams &params)
Converts contours in thick mesh, and deforms it along given path.
CurvePoints meshPathCurvePoints(const Mesh &mesh, const GeodesicPath &path)
converts polyline given as a number of MeshTriPoint/MeshEdgePoint into CurvePoints
CurvePoint getCurvePoint(const CurvePoints &cp, const std::vector< float > &lens, float p)
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.
tl::expected< T, E > Expected
Definition MRExpected.h:31
std::vector< MeshEdgePoint > SurfacePath
Definition MRMeshFwd.h:481
Contours2< float > Contours2f
Definition MRMeshFwd.h:388
Expected< std::vector< float > > findPartialLens(const CurvePoints &cp, float *outCurveLen=nullptr)
std::vector< CurvePoint > CurvePoints
curve given as a number of points on it samples at arbitrary steps
Definition MRCurve.h:32
float extrusion
Contours extrusion in +z and -z direction.
Definition MRAlignContoursToMesh.h:34
Vector2f pivotBoxPoint
Definition MRAlignContoursToMesh.h:52
bool stretch
stretch all contours along curve to fit in curve.totalLength
Definition MRAlignContoursToMesh.h:58
bool periodicCurve
if true, curve parameter will be always within [0,curve.totalLength) with repetition: xr := mod( x,...
Definition MRAlignContoursToMesh.h:55
Vector3f xDirection
Represents 2d contours xDirection in mesh space.
Definition MRAlignContoursToMesh.h:27
void addBaseToPlanarMesh(Mesh &mesh, float zOffset)
float maximumShift
Maximum allowed shift along 'zDirection' for alignment.
Definition MRAlignContoursToMesh.h:37
Expected< Mesh > bendContoursAlongSurfacePath(const Contours2f &contours, const Mesh &mesh, const GeodesicPath &path, const BendContoursAlongCurveParams &params)
Converts contours in thick mesh, and deforms it along given surface path: start->path->end.
Vector2f pivotPoint
Definition MRAlignContoursToMesh.h:24
MeshTriPoint meshPoint
Point coordinate on mesh, represent position of contours box 'pivotPoint' on mesh.
Definition MRAlignContoursToMesh.h:20
float pivotCurveTime
Definition MRAlignContoursToMesh.h:48
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Parameters for aligning 2d contours along given curve.
Definition MRAlignContoursToMesh.h:45
Parameters for aligning 2d contours onto mesh surface.
Definition MRAlignContoursToMesh.h:18
Definition MRCurve.h:20
Definition MRCurve.h:13
Definition MRSurfacePath.h:20
Definition MRMeshTriPoint.h:26
Definition MRMesh.h:23