EM FHNode

From FreeCAD Documentation
Revision as of 00:05, 4 January 2019 by Ediloren (talk | contribs) (Inital page - work in progress)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

EM FHNode

Menu location
EM → FHNode
Workbenches
EM
Default shortcut
E N
Introduced in version
0.17 (Add-on)
See also
EM FHSegment, EM FHPath, EM FHPlane, EM FHPlane Add/Remove Node/Hole, EM FHEquiv, EM FHPort

Description

The FHNode tool inserts a FastHenry node object.

FastHenry FHNode

How to use

The FHNode object can be based on the position of a Draft Point object, or you can select the 3D location of the FHNode.

  1. Press the EM FHNode button, or press E then N keys.
  2. Click a point on the 3D view, or type a coordinate and press the add point button.

Alternatively, you can also:

  1. Select a Draft Point object
  2. Press the EM FHNode button, or press E then N keys. A FHNode will be created at the same coordinates of the Draft Point.

Options

  • To enter coordinates manually, simply enter the numbers, then press Enter between each X, Y and Z component. You can press the add point button when you have the desired values to insert the point.
  • Press Esc or the Close button to abort the current command.

Properties

  • DataPosition: specifies the position of the base point of the compound shape.
  • DataAngle: specifies the rotation of the baseline of the shape.
  • DataAxis: specifies the axis to use for the rotation.
  • DataString: specifies the text string to display; unlike the Draft Text tool, the Draft ShapeString can only display a single line.
  • DataSize: specifies the general height of the letters.
  • DataTracking: specifies the additional inter-character spacing in the string.
  • DataFont File: specifies the full path of the font file used to draw the string.

Scripting

See also: FreeCAD Scripting Basics.

The FHNode object can be used in macros and from the Python console by using the following function:

node = makeFHNode(String, FontFile, Size=100, Tracking=0)
  • Creates a ShapeString compound shape using the specified String and the full path of a supported FontFile.
  • Size is the height of the resulting text in millimeters.
  • Tracking is the additional inter-character spacing in millimeters.

The placement of the ShapeString can be changed by overwriting its Placement attribute, or by individually overwriting its Placement.Base and Placement.Rotation attributes.

Example:

import FreeCAD, Draft

font1 = "/usr/share/fonts/truetype/msttcorefonts/Arial.ttf"
font2 = "/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf"
font3 = "/usr/share/fonts/truetype/freefont/FreeSerifItalic.ttf"

S1 = Draft.makeShapeString("This is a sample text", font1, 200)

S2 = Draft.makeShapeString("Inclined text", font2, 200, 10)

ZAxis = FreeCAD.Vector(0, 0, 1)
p2 = FreeCAD.Vector(-1000, 500, 0)
place2 = FreeCAD.Placement(p2, FreeCAD.Rotation(ZAxis, 45))
S2.Placement = place2

S3 = Draft.makeShapeString("Upside-down text", font3, 200, 10)
S3.Placement.Base = FreeCAD.Vector(0, -1000, 0)
S3.Placement.Rotation = FreeCAD.Rotation(ZAxis, 180)