MeshLib
 
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
11namespace MR
12{
13
15{
16 // Start coordinate on mesh, represent lowest left corner of text
18 // Position of the startPoint in a text bounding box
19 // (0, 0) - bottom left, (0, 1) - bottom right, (0.5, 0.5) - center, (1, 1) - top right
20 Vector2f pivotPoint{0.0f, 0.0f};
21 // Direction of text
23 // Text normal to surface, if nullptr - use mesh normal at `startPoint`
24 const Vector3f* textNormal{nullptr};
25 // Font height, meters
26 float fontHeight{1.0f};
27 // Text mesh inside and outside offset of input mesh
28 float surfaceOffset{1.0f};
29 // Maximum possible movement of text mesh alignment, meters
31 // If true then size of each symbol will be calculated from font height, otherwise - on bounding box of the text
32 bool fontBasedSizeCalc{ false };
33};
34
35// Creates symbol mesh and aligns it to given surface
37}
#define MRSYMBOLMESH_API
Definition MRSymbolMeshFwd.h:11
represents a 3-dimentional float-typed vector
Definition MRDotNet/MRVector3.h:8
Definition MRCameraOrientationPlugin.h:7
tl::expected< T, E > Expected
Definition MRExpected.h:49
MRSYMBOLMESH_API Expected< Mesh > alignTextToMesh(const Mesh &mesh, const TextMeshAlignParams &params)
Definition MRMesh/MRMeshTriPoint.h:23
Definition MRMesh/MRMesh.h:23
Definition MRSymbolMesh.h:22
Definition MRAlignTextToMesh.h:15
const Vector3f * textNormal
Definition MRAlignTextToMesh.h:24
MeshTriPoint startPoint
Definition MRAlignTextToMesh.h:17
bool fontBasedSizeCalc
Definition MRAlignTextToMesh.h:32
Vector3f direction
Definition MRAlignTextToMesh.h:22
float textMaximumMovement
Definition MRAlignTextToMesh.h:30
float fontHeight
Definition MRAlignTextToMesh.h:26
float surfaceOffset
Definition MRAlignTextToMesh.h:28
Vector2f pivotPoint
Definition MRAlignTextToMesh.h:20