EM FHSegment: Difference between revisions

From FreeCAD Documentation
(Initial creation - work in progress)
 
mNo edit summary
Line 27: Line 27:


# Select two [[EM_FHNode|FHNode]] objects
# Select two [[EM_FHNode|FHNode]] objects
# Press the {{Button|[[Image:EM_FHSegment.svg|16px]] button, or press {{KEY|E}} then {{KEY|S}} keys.
# Press the {{Button|[[Image:EM_FHSegment.svg|16px]] [[EM_FHSegment|EM FHSegment]]}} button, or press {{KEY|E}} then {{KEY|S}} keys.


Or:
Or:


# Select one or multiple [[Draft_Line|Draft Line]] object(s)
# Select one or multiple [[Draft_Line|Draft Line]] object(s)
# Press the {{Button|[[Image:EM_FHSegment.svg|16px]] button, or press {{KEY|E}} then {{KEY|S}} keys. As many FHSegment objects will be created as the Draft Line objects.
# Press the {{Button|[[Image:EM_FHSegment.svg|16px]] [[EM_FHSegment|EM FHSegment]]}} button, or press {{KEY|E}} then {{KEY|S}} keys. As many FHSegment objects will be created as the Draft Line objects.


Remark: if you create a FHSegment object based on a Draft Line object, you can NOT freely move the FHSegment or the end point FHNodes. The FHSegment will always be constrained to the base object. To change the position of the FHSegment, or of its end point, change the underlying Draft Line object (the base object is hidden by default, you can show it again by selecting the object in the tree and pressing {{KEY|Space}}.
Remark: if you create a FHSegment object based on a Draft Line object, you can NOT freely move the FHSegment or the end point FHNodes. The FHSegment will always be constrained to the base object. To change the position of the FHSegment, or of its end point, change the underlying Draft Line object (the base object is hidden by default, you can show it again by selecting the object in the tree and pressing {{KEY|Space}}.

Revision as of 10:18, 4 January 2019

EM FHSegment

Menu location
EM → FHSegment
Workbenches
EM
Default shortcut
E S
Introduced in version
0.17 (Add-on)
See also
EM FHNode, EM FHPath

Description

The FHSegmenttool inserts a FastHenry segment object.

FastHenry FHSegment

How to use

The FHSegment object can be based on the position of a Draft Line object, or on two existing FHNodes that will be the FHSegment end points, or you can select the 3D location of the two end points, where two additional FHNodes will be created.

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

Alternatively, you can also:

  1. Select two FHNode objects
  2. Press the EM FHSegment button, or press E then S keys.

Or:

  1. Select one or multiple Draft Line object(s)
  2. Press the EM FHSegment button, or press E then S keys. As many FHSegment objects will be created as the Draft Line objects.

Remark: if you create a FHSegment object based on a Draft Line object, you can NOT freely move the FHSegment or the end point FHNodes. The FHSegment will always be constrained to the base object. To change the position of the FHSegment, or of its end point, change the underlying Draft Line object (the base object is hidden by default, you can show it again by selecting the object in the tree and pressing Space.

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

  • DataX: the X coordinate of the node
  • DataY: the Y coordinate of the node
  • DataZ: the Z coordinate of the node

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(baseobj=None, X=0.0, Y=0.0, Z=0.0, color=None, size=None, name='FHNode')
  • Creates a FHNode object.
  • baseobj is the Draft Point object whose position can be used as base for the FNNode. It has priority over X, Y, Z. If no baseobj is given, X,Y,Z are used as coordinates.
  • X x coordinate of the node, in absolute coordinate system.
  • Y y coordinate of the node, in absolute coordinate system.
  • Z z coordinate of the node, in absolute coordinate system.
  • color is the node color, e.g. a tuple (1.0,0.0,0.0). Defaults to EMFHNODE_DEF_NODECOLOR.
  • size is the node size. Defaults to EMFHNODE_DEF_NODESIZE.
  • name is the name of the object

The placement of the FHNode can be changed by modifying its Placement property, or changing the X,Y,Z properties individually. Changing X,Y,Z modifies the node position in the relative coordinate system of the Placement.

Additionally, the _FHNode class exposes these methods. The _FHNode class can be accessed through the FHNode object Proxy (e.g. fhnode.Proxy).

pos = getAbsCoord()
  • Get a FreeCAD.Vector containing the node coordinates in the absolute reference system
pos = getRelCoord()
  • Get a FreeCAD.Vector containing the node coordinates relative to the FHNode Placement
pos = setRelCoord(rel_coord, placement=None)
  • Sets the node position relative to the placement
  • rel_coord is a FreeCAD.Vector containing the node coordinates relative to the FHNode Placement
  • placement is a new FHNode placement. If None, the placement is not changed
pos = setAbsCoord(abs_coord, placement=None)
  • Sets the absolute node position, considering the object placement, and in case forcing a new placement
  • abs_coord is a FreeCAD.Vector containing the node coordinates in the absolute reference system
  • placement is a new FHNode placement. If None, the placement is not changed


Example:

import FreeCAD, EM

fhnode = EM.makeFHNode(X=1.0,Y=2.0,Z=0.0)