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
41MRMESH_API Expected<Mesh> alignContoursToMesh( const Mesh& mesh, const Contours2f& contours, const ContoursMeshAlignParams& params );
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
65MRMESH_API Expected<Mesh> bendContoursAlongCurve( const Contours2f& contours, const CurveFunc& curve, const BendContoursAlongCurveParams& params );
66
68MRMESH_API Expected<Mesh> bendContoursAlongSurfacePath( const Contours2f& contours, const Mesh& mesh, const MeshTriPoint & start, const SurfacePath& path, const MeshTriPoint & end,
69 const BendContoursAlongCurveParams& params );
70
72MRMESH_API Expected<Mesh> bendContoursAlongSurfacePath( const Contours2f& contours, const Mesh& mesh, const SurfacePath& path,
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 MeshTriPoint & start, const SurfacePath& path, const MeshTriPoint & end );
93[[nodiscard]] MRMESH_API CurvePoints meshPathCurvePoints( const Mesh& mesh, const SurfacePath& path );
94
97MRMESH_API void addBaseToPlanarMesh( Mesh& mesh, float zOffset );
98
99}
MR_BIND_IGNORE_PY auto end(const BitSet &)
Definition MRBitSet.h:397
const Vector3f * zDirection
Definition MRAlignContoursToMesh.h:31
MRMESH_API Expected< CurveFunc > curveFromPoints(const CurvePoints &cp, float *outCurveLen=nullptr)
float extrusion
Contours extrusion outside of curve level.
Definition MRAlignContoursToMesh.h:61
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< std::vector< float > > findPartialLens(const CurvePoints &cp, float *outCurveLen=nullptr)
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.
tl::expected< T, E > Expected
Definition MRExpected.h:31
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
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
float maximumShift
Maximum allowed shift along 'zDirection' for alignment.
Definition MRAlignContoursToMesh.h:37
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 MRMeshTriPoint.h:26
Definition MRMesh.h:23