Sketcher ConstrainPointOnObject: Difference between revisions

From FreeCAD Documentation
No edit summary
(WIP + continue mode)
Line 1: Line 1:
<languages/>
<languages/>
{{Page_in_progress}}
<translate>
<translate>


Line 24: Line 25:


<!--T:2-->
<!--T:2-->
The [[Image:Sketcher_ConstrainPointOnObject.svg|24px]] [[Sketcher_ConstrainPointOnObject|Sketcher ConstrainPointOnObject]] command fixes points on edges or axes. Lines are treated as infinite, and arcs are treated as full circles/ellipses.
The [[Image:Sketcher_ConstrainPointOnObject.svg|24px]] [[Sketcher_ConstrainPointOnObject|Sketcher ConstrainPointOnObject]] tool fixes points on edges or axes. Lines are treated as infinite, and arcs are treated as full circles/ellipses.


<!--T:20-->
<!--T:20-->
{{Version|0.22}}: This command is replaced by the [[Sketcher_ConstrainCoincidentUnified|Sketcher ConstrainCoincidentUnified]] command if the {{MenuCommand|Unify Coincident and PointOnObject}} option is selected in the [[Sketcher_Preferences#General|Sketcher Preferences]].
{{Version|0.22}}: This tool is replaced by the [[Sketcher_ConstrainCoincidentUnified|Sketcher ConstrainCoincidentUnified]] tool if the {{MenuCommand|Unify Coincident and PointOnObject}} option is selected in the [[Sketcher_Preferences#General|Sketcher Preferences]].


==Usage== <!--T:3-->
==Usage== <!--T:3-->


<!--T:16-->
<!--T:16-->
# Do one of the following (optional if the tool will run in [[Sketcher_Workbench#Continue_modes|continue mode]]):
# Optionally do one of the following:
#* Select a single point and a single edge (in any order).
#* Select a single point and a single edge (in any order).
#* Select several points and a single edge (idem).
#* Select several points and a single edge (idem).
#* Select a single point and several edges (idem).
#* Select a single point and several edges (idem).
# There are several ways to invoke the command:
# There are several ways to invoke the tool:
#* Press the {{Button|[[Image:Sketcher_ConstrainPointOnObject.svg|16px]] [[Sketcher_ConstrainPointOnObject|Constrain point onto object]]}} button.
#* Press the {{Button|[[Image:Sketcher_ConstrainPointOnObject.svg|16px]] [[Sketcher_ConstrainPointOnObject|Constrain point onto object]]}} button.
#* Select the {{MenuCommand|Sketch → Sketcher constraints → [[Image:Sketcher_ConstrainPointOnObject.svg|16px]] Constrain point onto object}} option from the menu.
#* Select the {{MenuCommand|Sketch → Sketcher constraints → [[Image:Sketcher_ConstrainPointOnObject.svg|16px]] Constrain point onto object}} option from the menu.
#* Use the keyboard shortcut: {{KEY|O}}.
#* Use the keyboard shortcut: {{KEY|O}}.
# If the tool runs in [[Sketcher_Workbench#Continue_modes|continue mode]]:
# To indicate that the command has been activated the cursor changes to a white cross with the command icon.
## The cursor changes to a white cross with the tool icon.
# Optionally keep selecting elements. You can only select two elements at a time now.
## Optionally keep selecting elements. You can only select two elements at a time now.
# To finish the command press {{KEY|Esc}} or the right mouse button, or start a another constraints or geometries command.
## To finish, right-click or press {{KEY|Esc}}, or start a another constraints or geometries tool.


==Scripting== <!--T:19-->
==Scripting== <!--T:19-->

Revision as of 10:05, 29 February 2024

This documentation is a work in progress. Please don't mark it as translatable since it will change in the next hours and days.

Sketcher ConstrainPointOnObject

Menu location
Sketch → Sketcher constraints → Constrain point onto object
Workbenches
Sketcher
Default shortcut
O
Introduced in version
-
See also
Sketcher ConstrainCoincidentUnified, Sketcher ConstrainCoincident

Description

The Sketcher ConstrainPointOnObject tool fixes points on edges or axes. Lines are treated as infinite, and arcs are treated as full circles/ellipses.

introduced in version 0.22: This tool is replaced by the Sketcher ConstrainCoincidentUnified tool if the Unify Coincident and PointOnObject option is selected in the Sketcher Preferences.

Usage

  1. Do one of the following (optional if the tool will run in continue mode):
    • 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. There are several ways to invoke the tool:
    • Press the Constrain point onto object button.
    • Select the Sketch → Sketcher constraints → Constrain point onto object option from the menu.
    • Use the keyboard shortcut: O.
  3. If the tool runs in continue mode:
    1. The cursor changes to a white cross with the tool icon.
    2. Optionally keep selecting elements. You can only select two elements at a time now.
    3. To finish, right-click or press Esc, or start a another constraints or geometries tool.

Scripting

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 onto the LineFixed (the line which is fixed).
  • PointOfLineMoving is the number of the vertex of line LineMoving, that has to be moved onto the LineFixed.
  • LinedFixed is the number of the line to be affixed onto the point PointOfLineMoving.

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