MeshLib C++ Docs
Loading...
Searching...
No Matches
MRAlignTextToMesh.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRSymbolMeshFwd.h"
4#include "MRSymbolMesh.h"
5
6#include "MRMesh/MRExpected.h"
7#include "MRMesh/MRId.h"
8#include "MRMesh/MRVector3.h"
10#include "MRMesh/MRCurve.h"
11
12namespace MR
13{
14
16{
19
22 Vector2f pivotPoint{0.0f, 0.0f};
23
25 Vector3f direction;
26
28 const Vector3f* textNormal{nullptr};
29
31 float fontHeight{1.0f};
32
34 float surfaceOffset{1.0f};
35
38
40 bool fontBasedSizeCalc{ false };
41};
42
45
47{
50
52 float pivotCurveTime = 0;
53
56 Vector2f pivotBoxPoint{0.0f, 0.0f};
57
58 // Font height, meters
59 float fontHeight{1.0f};
60
61 // Text mesh inside and outside offset of curve's surface
62 float surfaceOffset{1.0f};
63
64 // If true then size of each symbol will be calculated from font height, otherwise - on bounding box of the text
65 bool fontBasedSizeCalc{ false };
66
68 bool stretch = true;
69};
70
74
77
80 const MeshTriPoint & start, const SurfacePath& path, const MeshTriPoint & end, const BendTextAlongCurveParams& params );
81
82} // namespace MR
#define MRSYMBOLMESH_API
Definition MRSymbolMeshFwd.h:12
MR_BIND_IGNORE auto end(const BitSet &)
Definition MRMesh/MRBitSet.h:382
Definition MRCameraOrientationPlugin.h:8
MRSYMBOLMESH_API Expected< Mesh > bendTextAlongCurve(const CurveFunc &curve, const BendTextAlongCurveParams &params)
tl::expected< T, E > Expected
Definition MRExpected.h:28
std::vector< MeshEdgePoint > SurfacePath
Definition MRMeshFwd.h:478
std::function< CurvePoint(float)> CurveFunc
curve given as a function: time -> point
Definition MRCurve.h:17
std::vector< CurvePoint > CurvePoints
curve given as a number of points on it samples at arbitrary steps
Definition MRCurve.h:20
MRSYMBOLMESH_API Expected< Mesh > bendTextAlongSurfacePath(const Mesh &mesh, const MeshTriPoint &start, const SurfacePath &path, const MeshTriPoint &end, const BendTextAlongCurveParams &params)
Creates symbol mesh and deforms it along given surface path.
MRSYMBOLMESH_API Expected< Mesh > alignTextToMesh(const Mesh &mesh, const TextMeshAlignParams &params)
Creates symbol mesh and aligns it to given surface.
Definition MRAlignTextToMesh.h:47
Vector2f pivotBoxPoint
Definition MRAlignTextToMesh.h:56
bool fontBasedSizeCalc
Definition MRAlignTextToMesh.h:65
float fontHeight
Definition MRAlignTextToMesh.h:59
SymbolMeshParams symbolMesh
parameters of contours to mesh conversion
Definition MRAlignTextToMesh.h:49
float pivotCurveTime
Position on the curve, where bounding box's pivot point is mapped.
Definition MRAlignTextToMesh.h:52
float surfaceOffset
Definition MRAlignTextToMesh.h:62
bool stretch
stretch whole text along curve to fit in unit curve range
Definition MRAlignTextToMesh.h:68
Definition MRMeshTriPoint.h:23
Definition MRMesh/MRMesh.h:23
Definition MRSymbolMesh.h:22
Definition MRAlignTextToMesh.h:16
const Vector3f * textNormal
Text normal to surface, if nullptr - use mesh normal at startPoint
Definition MRAlignTextToMesh.h:28
MeshTriPoint startPoint
Position on mesh, where text's pivot point is mapped.
Definition MRAlignTextToMesh.h:18
bool fontBasedSizeCalc
If true then size of each symbol will be calculated from font height, otherwise - on bounding box of ...
Definition MRAlignTextToMesh.h:40
Vector3f direction
Direction of text, must be not zero.
Definition MRAlignTextToMesh.h:25
float textMaximumMovement
Maximum possible movement of text mesh alignment, meters.
Definition MRAlignTextToMesh.h:37
float fontHeight
Font height, meters.
Definition MRAlignTextToMesh.h:31
float surfaceOffset
Text mesh inside and outside offset of input mesh.
Definition MRAlignTextToMesh.h:34
Vector2f pivotPoint
Definition MRAlignTextToMesh.h:22