McStas logo McStas - A neutron ray-trace simulation package ILL; PSI; ESS Niels Bohr Institute DTU Physics

McStas

About McStas
 Conditions of use
 Authors/Contacts
 Project funding

Download
 Components

Mailing list

Search web/mailinglist

Documentation
 Wiki (GitHub)
 McStas manual
 Publications

Links

Report bugs (GitHub)

Code-repository (GitHub)


McStas: Text2OFF

[ Identification | Description | Examples | Input parameters | Links ]

The Text2OFF Instrument

Render a text string as 3D geometry, e.g. for export to an OFF file

Identification

  • Site: Templates
  • Author: Peter Willendrup (pkwi@fysik.dtu.dk)
  • Origin: DTU Physics
  • Date: October 2026

Description

Draws the string given in "letters" with the Text component and nothing else -
no particles are traced. Use it with mcdisplay-cad to turn a text into CAD
geometry, for instance an OFF file that can be fed back into components that
read OFF geometry (labels, logos, test shapes):

mcdisplay-cad Text2OFF.instr -t 2 -f off letters="McStas" size=0.5

Notes:
- Use --trace 2 (-t 2): with the default trace level 1 Text draws thin lines,
which carry no surfaces and give an empty OFF/STL file.
- Each stroke is a cylinder and each stroke end/joint a sphere, so the
resulting surfaces overlap - fine for display, not a closed single solid.
- Letters are drawn upper-case; characters without a glyph are left blank.

Example: letters="McStas" size=0.5 plane="XY"

Examples

(Test cases in bold)

Input parameters

Parameters in boldface are required; the others are optional.
NameUnitDescriptionDefault
lettersstrText to draw"McStas"
sizemLetter height0.5
planestrPlane of the text: "XY", "YZ" or "XZ""XY"
thickness1Stroke diameter as fraction of size0.1
rxdegRotation of the text around the x axis0
rydegRotation of the text around the y axis0
rzdegRotation of the text around the z axis0

Links

  • Source code for Text2OFF.instr.
  • Text.comp, mcdisplay-cad --help

[ Identification | Description | Examples | Input parameters | Links ]

Generated for mcstas 3.10.0


Last Modified: Friday, 23-Oct-2026 18:32:10 CEST
Search website mailinglist archive GitHub repos