Sketcher ConstrainDistance/fr: Difference between revisions

From FreeCAD Documentation
No edit summary
(Updating to match new version of source page)
Line 38: Line 38:


Le cas échéant envisagez d'utiliser de préférence les fonctions de contrainte {{Button|[[File:Sketcher_ConstrainDistanceX.svg|16px]] [[Sketcher_ConstrainDistanceX/fr|Sketcher Distance horizontale]]}} ou {{Button|[[File:Sketcher_ConstrainDistanceY.svg|16px]] [[Sketcher_ConstrainDistanceY/fr|Sketcher Distance verticale]]}}. Ces contraintes sont plus robustes et plus rapides à calculer que la '''contrainte dimensionnelle'''.
Le cas échéant envisagez d'utiliser de préférence les fonctions de contrainte {{Button|[[File:Sketcher_ConstrainDistanceX.svg|16px]] [[Sketcher_ConstrainDistanceX/fr|Sketcher Distance horizontale]]}} ou {{Button|[[File:Sketcher_ConstrainDistanceY.svg|16px]] [[Sketcher_ConstrainDistanceY/fr|Sketcher Distance verticale]]}}. Ces contraintes sont plus robustes et plus rapides à calculer que la '''contrainte dimensionnelle'''.

== Scripting ==

Distance from origin:

{{Code|code=Sketch.addConstraint(Sketcher.Constraint('DistanceX', Edge, PointOfEdge, App.Units.Quantity('123.0 mm')))}}

Distance between two vertices:

{{Code|code=Sketch.addConstraint(Sketcher.Constraint('Distance', Edge1, PointOfEdge1, Edge2, PointOfEdge2, App.Units.Quantity('123.0 mm')))}}

Length of line (the GUI allows selecting the edge itself, but it is just a shorthand for using the two extremities of the same line:
{{Code|code=Sketch.addConstraint(Sketcher.Constraint('Distance', Line, 1, Line, 2, App.Units.Quantity('123.0 mm')))}}

Distance from point ({{incode|Edge, PointOfEdge}}) to nearest point on line ({{incode|Line}}):
{{Code|code=Sketch.addConstraint(Sketcher.Constraint('Distance', Edge, PointOfEdge, Line, App.Units.Quantity('123.0 mm')))}}

The [[Scripting Sketcher constraints in Python]] page explains the values which can be used for {{incode|Edge1}}, {{incode|Edge2}}, {{incode|Edge}}, {{incode| PointOfEdge1}}, {{incode| PointOfEdge2}}, {{incode|PointOfEdge}} and {{incode|Line}}, and contains further examples on how to create constraints from Python scripts.



{{Docnav/fr
{{Docnav/fr

Revision as of 19:22, 23 January 2021

Sketcher Contrainte dimensionnelle

Emplacement du menu
Sketch → Contraintes d'esquisse → Contrainte dimensionnelle
Ateliers
Sketcher
Raccourci par défaut
Maj + D
Introduit dans la version
-
Voir aussi
Sketcher Contrainte distance horizontale, Sketcher Contrainte distance verticale

Description

La contrainte dimensionnelle spécifie par une valeur la longueur d'une ligne, la distance perpendiculaire entre un point et une ligne, ou la distance entre deux points.

Utilisation

  1. Choisissez deux points ou une ligne ou un point et une ligne.
  2. Appelez la commande de plusieurs manières:
    • Appuyez sur le bouton Contraindre dimensionnelle
    • Utilisez le raccourci clavier Maj + D. (D est pour Distance)
    • Utilisez l'entrée Sketch → Contraintes d'esquisse → Contraindre dimensionnelle dans le menu supérieur.
  3. Une boîte de dialogue contextuelle s'ouvre pour modifier ou confirmer la valeur. Appuyez sur OK pour valider.

Remarque : l'outil de contrainte peut également être démarré sans sélection préalable. Pour définir la distance perpendiculaire entre un point et une droite, le point doit être sélectionné en premier. Par défaut, la commande sera en mode continu afin de créer de nouvelles contraintes; appuyez sur le bouton droit de la souris ou sur ÉCHAP pour quitter la commande.

Suggestion

Le cas échéant envisagez d'utiliser de préférence les fonctions de contrainte Sketcher Distance horizontale ou Sketcher Distance verticale. Ces contraintes sont plus robustes et plus rapides à calculer que la contrainte dimensionnelle.

Scripting

Distance from origin:

Sketch.addConstraint(Sketcher.Constraint('DistanceX', Edge, PointOfEdge, App.Units.Quantity('123.0 mm')))

Distance between two vertices:

Sketch.addConstraint(Sketcher.Constraint('Distance', Edge1, PointOfEdge1, Edge2, PointOfEdge2, App.Units.Quantity('123.0 mm')))

Length of line (the GUI allows selecting the edge itself, but it is just a shorthand for using the two extremities of the same line:

Sketch.addConstraint(Sketcher.Constraint('Distance', Line, 1, Line, 2, App.Units.Quantity('123.0 mm')))

Distance from point (Edge, PointOfEdge) to nearest point on line (Line):

Sketch.addConstraint(Sketcher.Constraint('Distance', Edge, PointOfEdge, Line, App.Units.Quantity('123.0 mm')))

The Scripting Sketcher constraints in Python page explains the values which can be used for Edge1, Edge2, Edge, PointOfEdge1, PointOfEdge2, PointOfEdge and Line, and contains further examples on how to create constraints from Python scripts.