Sketcher ConstrainPointOnObject: Difference between revisions

From FreeCAD Documentation
No edit summary
No edit summary
(26 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
{{Page_in_progress}}
<translate>
<translate>


Line 18: Line 19:
|Workbenches=[[Sketcher_Workbench|Sketcher]]
|Workbenches=[[Sketcher_Workbench|Sketcher]]
|Shortcut={{KEY|O}}
|Shortcut={{KEY|O}}
|SeeAlso=[[Sketcher_ConstrainCoincidentUnified|Sketcher Constrain Coincident Unified]], [[Sketcher_ConstrainCoincident|Sketcher Constrain Coincident]]
|SeeAlso=[[Sketcher_ConstrainCoincidentUnified|Sketcher ConstrainCoincidentUnified]], [[Sketcher_ConstrainCoincident|Sketcher ConstrainCoincident]]
}}
}}


Line 24: Line 25:


<!--T:2-->
<!--T:2-->
The [[Image:Sketcher_ConstrainPointOnObject.svg|24px]] [[Sketcher_ConstrainPointOnObject|Sketcher ConstrainPointOnObject]] tool affixes a point onto another object such as a line, arc, or sketch axis.
The [[Image:Sketcher_ConstrainPointOnObject.svg|24px]] [[Sketcher_ConstrainPointOnObject|Sketcher ConstrainPointOnObject]] tool fixes points on edges or axes. Lines are treated as infinite, and open curves are virtually extended as well.


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


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

See also: [[Sketcher_Workbench#Drawing_aids|Drawing aids]].

===[[Sketcher_Workbench#Continue_modes|Continue mode]]===


<!--T:16-->
<!--T:16-->
# Make sure there is no selection.
# There are several ways to invoke the tool:
#* 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.
#* Use the keyboard shortcut: {{KEY|O}}.
# The cursor changes to a cross with the tool icon.
# Select a single point and a single edge (in any order).
# A constraint is added.
# Optionally keep creating constraints.
# To finish, right-click or press {{KEY|Esc}}, or start another geometry or constraint creation tool.

===Run-once mode===

# Do one of the following:
# Do one of the following:
#* Select a single point and a single edge.
#* Select a single point and a single edge (in any order).
#* Select several points and a single edge.
#* Select several points and a single edge (idem).
#* Select a single point and several edges.
#* Select a single point and several edges (idem).
# Invoke the tool as explained above.
# There are several ways to invoke the command:
# Depending on the selection one or more constraints are added.
#* Press the {{Button|[[File:Sketcher_ConstrainPointOnObject.svg|16px]] [[Sketcher_ConstrainPointOnObject|Constrain point onto object]]}} button in the toolbar.
#* Use the {{KEY|O}} keyboard shortcut.
#* Use the {{MenuCommand|Sketch → Sketcher constraints → [[File:Sketcher_ConstrainPointOnObject.svg|16px]] Constrain point onto object}} entry in the top menu.


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

Revision as of 09:34, 18 April 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 open curves are virtually extended as well.

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

See also: Drawing aids.

Continue mode

  1. Make sure there is no selection.
  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. 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

  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 explained above.
  3. Depending on the selection one or more constraints are added.

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.