Stamper
[Desktop Automation]
This Lua object labels meshes. A text is stamped on the meshes. It expects the position of the text, the estimated plane of the text, and the direction of "up". The example script Script17_LabelMeshes.lua has some helper functions for setting the position, normal, and upvector.
Use the command Generate Lua snippet in text labeling to immediately produce helpful Lua code, including the necessary vectors, from manual placement of the text label on a known mesh.
Properties
Property | Read/write | Type | Description |
---|---|---|---|
![]() |
Read/write | Boolean | Switches bold font weight |
depth | Read/write | number | The depth of the label |
![]() |
Read/write | String | Specifies the typeface. Also use this if and where the specific font uses more complex names for its variations than otherwise selectable through properties of the Stamper object, such as in Bahnschrift SemiBold SemiCondensed. To find the exact font name, use the Fonts system dialog of Windows®. |
![]() |
Read/write | number | Affects tessellation resolution. If chosen too small, the resulting mesh may be unreadable or even be nonsensical and faulty. |
height | Read/write | number | The height of the label in millimeters. The width is scaled to match the original ratio. |
isinverted | Read/write | Boolean | When true, the text is inverted (mirrored). |
issubtracted | Read/write | Boolean | When false, the label is added to meshes (embossed), otherwise is subtracted (impressed). |
![]() |
Read/write | Boolean | Switches the italic font style |
pos | Read | TLUAVector3f | The position of the label |
![]() |
Read/write | Boolean | Switches strike-through font decoration |
normal | Read | TLUAVector3f | The normal of the plane of the label |
![]() |
Read/write | Boolean | Switches underline font decoration |
upvector | Read | TLUAVector3f | The vector to define which way is up |
Methods
Name | Syntax | Description |
---|---|---|
stamp | newmesh = stamper:stamp(Mesh:LUAMesh, text:string) | Generates text geometry, takes the original mesh, and creates a new mesh as an output. |
setpos | stamper:setpos(Pos1:number, Pos2:number, Pos3:number) | Sets the position. This is the center of the text. |
setnormal | stamper:setnormal(Pos1:number, Pos2:number, Pos3:number) | Sets the normal of the plane of the label. For example, (0,0,1) would be the x-y plane. |
setupvector | stamper:setupvector(Pos1:number, Pos2:number, Pos3:number) | If a plane is given for the label, the angle the text should have in the plane is required, i.e. in what direction the text is printed. 'setupvector' sets the upvector which defines what direction is defined as "up" for a text. The Vector should to be perpendicular to the normal vector. |