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{
16
17
19{
22
25 Vector2f pivotPoint{0.0f, 0.0f};
26
28 Vector3f direction;
29
31 const Vector3f* textNormal{nullptr};
32
34 float fontHeight{1.0f};
35
37 float surfaceOffset{1.0f};
38
41
43 bool fontBasedSizeCalc{ false };
44};
45
47MRSYMBOLMESH_API Expected<Mesh> alignTextToMesh( const Mesh& mesh, const TextMeshAlignParams& params );
48
50{
53
55 float pivotCurveTime = 0;
56
59 Vector2f pivotBoxPoint{0.0f, 0.0f};
60
62 float fontHeight{1.0f};
63
65 float surfaceOffset{1.0f};
66
68 bool fontBasedSizeCalc{ false };
69
71 bool periodicCurve = false;
72
74 bool stretch = true;
75};
76
79MRSYMBOLMESH_API Expected<Mesh> bendTextAlongCurve( const CurveFunc& curve, const BendTextAlongCurveParams& params );
80
82MRSYMBOLMESH_API Expected<Mesh> bendTextAlongCurve( const CurvePoints& curve, const BendTextAlongCurveParams& params );
83
85MRSYMBOLMESH_API Expected<Mesh> bendTextAlongSurfacePath( const Mesh& mesh,
86 const MeshTriPoint & start, const SurfacePath& path, const MeshTriPoint & end, const BendTextAlongCurveParams& params );
87
89MRSYMBOLMESH_API Expected<Mesh> bendTextAlongSurfacePath( const Mesh& mesh,
90 const SurfacePath& path, const BendTextAlongCurveParams& params );
91
92}
MR_BIND_IGNORE_PY auto end(const BitSet &)
Definition MRBitSet.h:397
MRSYMBOLMESH_API Expected< Mesh > bendTextAlongCurve(const CurveFunc &curve, const BendTextAlongCurveParams &params)
Vector2f pivotBoxPoint
Definition MRAlignTextToMesh.h:59
bool fontBasedSizeCalc
If true then size of each symbol will be calculated from font height, otherwise - on bounding box of ...
Definition MRAlignTextToMesh.h:68
const Vector3f * textNormal
Text normal to surface, if nullptr - use mesh normal at startPoint
Definition MRAlignTextToMesh.h:31
MeshTriPoint startPoint
Position on mesh, where text's pivot point is mapped.
Definition MRAlignTextToMesh.h:21
bool fontBasedSizeCalc
If true then size of each symbol will be calculated from font height, otherwise - on bounding box of ...
Definition MRAlignTextToMesh.h:43
Vector3f direction
Direction of text, must be not zero.
Definition MRAlignTextToMesh.h:28
float fontHeight
Font height, meters.
Definition MRAlignTextToMesh.h:62
SymbolMeshParams symbolMesh
parameters of contours to mesh conversion
Definition MRAlignTextToMesh.h:52
tl::expected< T, E > Expected
Definition MRExpected.h:31
float pivotCurveTime
Position on the curve, where bounding box's pivot point is mapped.
Definition MRAlignTextToMesh.h:55
std::vector< CurvePoint > CurvePoints
curve given as a number of points on it samples at arbitrary steps
Definition MRCurve.h:32
float surfaceOffset
Text mesh inside and outside offset of curve's surface.
Definition MRAlignTextToMesh.h:65
float textMaximumMovement
Maximum possible movement of text mesh alignment, meters.
Definition MRAlignTextToMesh.h:40
bool stretch
stretch whole text along curve to fit in unit curve range
Definition MRAlignTextToMesh.h:74
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: start->path->end.
float fontHeight
Font height, meters.
Definition MRAlignTextToMesh.h:34
float surfaceOffset
Text mesh inside and outside offset of input mesh.
Definition MRAlignTextToMesh.h:37
Vector2f pivotPoint
Definition MRAlignTextToMesh.h:25
bool periodicCurve
if true, curve parameter will be always within [0,1) with repetition: xr := x - floor(x)
Definition MRAlignTextToMesh.h:71
MRSYMBOLMESH_API Expected< Mesh > alignTextToMesh(const Mesh &mesh, const TextMeshAlignParams &params)
Creates symbol mesh and aligns it to given surface.
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRAlignTextToMesh.h:50
Definition MRCurve.h:20
Definition MRMeshTriPoint.h:26
Definition MRMesh.h:23
Definition MRSymbolMesh.h:25
Definition MRAlignTextToMesh.h:19