Jump to content

Sketcher ConstrainPointOnObject

From FreeCAD Documentation

Sketcher ConstrainPointOnObject

Menu location
Sketch → Constraints → Point-On-Object Constraint
Workbenches
Sketcher
Default shortcut
O
Introduced in version
-
See also
Sketcher ConstrainCoincidentUnified, Sketcher ConstrainCoincident

Description[edit | edit source]

The Sketcher ConstrainPointOnObject tool fixes points on edges or axes. Lines are treated as infinite, and open curves are virtually extended as well.

introduced in 1.0: This tool is replaced by the Sketcher ConstrainCoincidentUnified tool if the Unify coincident and point-on-object constraints option is selected in the preferences.

Usage[edit | edit source]

See also: Drawing aids.

Continue mode[edit | edit source]

  1. Make sure there is no selection.
  2. There are several ways to invoke the tool:
    • Press the Point-On-Object Constraint button.
    • Select the Sketch → Constraints → Point-On-Object Constraint option from the menu.
    • Use the keyboard shortcut: O.
  3. The cursor changes to a cross with the tool icon.
  4. Select a single point and a single edge (in any order).
  5. A constraint is added.
  6. Optionally keep creating constraints.
  7. To finish, right-click or press Esc, or start another geometry or constraint creation tool.

Run-once mode[edit | edit source]

  1. Do one of the following:
    • Select a single point and a single edge (in any order).
    • Select several points and a single edge (idem).
    • Select a single point and several edges (idem).
  2. Invoke the tool as described above, or with the following additional option:
    • Right-click in the Elements section of the Sketcher Dialog and select the Point-On-Object Constraint option from the context menu.
  3. Depending on the selection one or more constraints are added.

Scripting[edit | edit source]

The constraint can be created from macros and from the Python console by using the following command:

Sketch.addConstraint(Sketcher.Constraint('PointOnObject',LineMoving,PointOfLineMoving,LineFixed))

  • Sketch is a sketch object.
  • LineMoving is the number that designates the line, which contains the point that has to be moved on the LineFixed (the line which is fixed).
  • PointOfLineMoving is the number of the vertex of line LineMoving, that has to be moved on the LineFixed.
  • LinedFixed is the number of the line to be affixed on the point PointOfLineMoving.

The Sketcher scripting page explains how to identify the numbers that designate lines and points.