# Difference between revisions of "Sketcher ConstrainInternalAlignment"

Line 6: | Line 6: | ||

|[[Sketcher_ToggleDrivingConstraint|Toggle reference/driving constraint]] | |[[Sketcher_ToggleDrivingConstraint|Toggle reference/driving constraint]] | ||

|[[Sketcher_Workbench|Sketcher]] | |[[Sketcher_Workbench|Sketcher]] | ||

− | |IconL=Constraint_SnellsLaw. | + | |IconL=Constraint_SnellsLaw.svg |

+ | |IconR=Sketcher_ToggleConstraint.svg | ||

|IconC=Workbench_Sketcher.svg | |IconC=Workbench_Sketcher.svg | ||

− | |||

}} | }} | ||

Line 14: | Line 14: | ||

{{GuiCommand | {{GuiCommand | ||

|Name=Sketcher ConstrainInternalAlignment | |Name=Sketcher ConstrainInternalAlignment | ||

+ | |MenuLocation=Sketch → Sketcher constraints → Constrain InternalAlignment | ||

|Workbenches=[[Sketcher_Workbench|Sketcher]] | |Workbenches=[[Sketcher_Workbench|Sketcher]] | ||

− | |||

|Shortcut={{KEY|Ctrl}} + {{KEY|A}} | |Shortcut={{KEY|Ctrl}} + {{KEY|A}} | ||

− | |||

|Version=0.15 | |Version=0.15 | ||

+ | |SeeAlso=[[Sketcher_RestoreInternalAlignmentGeometry|Sketcher Show/Hide Internal Geometry]], [[Sketcher_CreateEllipseByCenter|Sketcher Ellipse by Center]] | ||

}} | }} | ||

Line 66: | Line 66: | ||

|[[Sketcher_ToggleDrivingConstraint|Toggle reference/driving constraint]] | |[[Sketcher_ToggleDrivingConstraint|Toggle reference/driving constraint]] | ||

|[[Sketcher_Workbench|Sketcher]] | |[[Sketcher_Workbench|Sketcher]] | ||

− | |IconL=Constraint_SnellsLaw. | + | |IconL=Constraint_SnellsLaw.svg |

+ | |IconR=Sketcher_ToggleConstraint.svg | ||

|IconC=Workbench_Sketcher.svg | |IconC=Workbench_Sketcher.svg | ||

− | |||

}} | }} | ||

## Revision as of 20:15, 2 December 2020

Menu location |
---|

Sketch → Sketcher constraints → Constrain InternalAlignment |

Workbenches |

Sketcher |

Default shortcut |

Ctrl + A |

Introduced in version |

0.15 |

See also |

Sketcher Show/Hide Internal Geometry, Sketcher Ellipse by Center |

## Description

This constraint aligns lines and points to particular places of a complex sketcher element (there is just one "complex" element so far, the Ellipse).

For Ellipse and Arc of ellipse, it supports constraining lines to become major and minor diameters, and constraining points to positions of ellipse's foci.

The constraint requires a lot of effort to use in the way other constraints are. It is hidden in the menu, and not exposed on any toolbars by default. There is a helper tool called Show/Hide internal geometry which is exposed on workbenches' toolbars and aimed to completely remove the need to invoke the constraint manually.

## Operation on Ellipse

- Select elements to be aligned and an ellipse. The ellipse must be selected last. Accepted are up to two lines and up to two points.
- Invoking the constraint can be done several ways:
- Pressing the Constrain internal alignment button in the toolbar.
- Using the Ctrl + A keyboard shortcut.
- Using the
**Sketch → Sketcher constraints → Constrain InternalAlignment**entry from the top menu.

The first line that was selected gets aligned to become ellipse's major diameter (but if it is not occupied already by another line, otherwise it will become minor diameter). The second line is aligned to become minor radius. The lines are automatically switched to construction.

Likewise, the first point is constrained to become the first unoccupied focus, and the second point goes to the other focus.

## Scripting

```
Sketch.addConstraint(Sketcher.Constraint('InternalAlignment:EllipseMajorDiameter', index_of_line, index_of_ellipse))
Sketch.addConstraint(Sketcher.Constraint('InternalAlignment:EllipseMinorDiameter', index_of_line, index_of_ellipse))
Sketch.addConstraint(Sketcher.Constraint('InternalAlignment:EllipseFocus1', index_of_point, 1, index_of_ellipse))
Sketch.addConstraint(Sketcher.Constraint('InternalAlignment:EllipseFocus2', index_of_point, 1, index_of_ellipse))
```

Remarks:

`Sketch`is a sketch object.- Number
`1`in the focus calls stands for starting point of a point element (it is ignored).

**The tools:**New sketch, Edit sketch, Leave sketch, View sketch, View section, Map sketch to face, Reorient sketch, Validate sketch, Merge sketches, Mirror sketch

**Sketcher geometries:**Point, Line by 2 point,**Create an arc,**Arc, Arc by 3 Point,**Create a circle**, Circle, Circle by 3 Point,**Create a conic**, Ellipse by center, Ellipse by 3 points, Arc of ellipse, Arc of hyperbola, Arc of parabola,**Create a B-spline**, Create B-spline, Create periodic B-pline, Polyline (multiple-point line), Rectangle,**Create regular polygon**, Triangle, Square, Pentagon, Hexagon, Heptagon, Octagon, Create Regular Polygon, Slot, Fillet, Trimming, Extend, External Geometry, CarbonCopy, Construction Mode

**Sketcher constraints****Geometric constraints**Coincident, Point On Object, Vertical, Horizontal, Parallel, Perpendicular, Tangent, Equal Length, Symmetric, Constrain Block**Dimensional constraints**Lock, Horizontal Distance, Vertical Distance, Distance, Radius, Internal Angle, Snell's Law, Internal Alignment, Toggle reference/driving constraint,

**Sketcher tools**Select solver DOFs, Close Shape, Connect Edges, Select Constraints, Select Origin, Select Vertical Axis, Select Horizontal Axis, Select Redundant Constraints, Select Conflicting Constraints, Select Elements Associated with constraints, Show/Hide internal geometry, Symmetry, Clone, Copy, Move, Rectangular Array, Delete All Geometry, Delete All Constraints

**Sketcher B-spline tools**Show/Hide B-spline degree, Show/Hide B-spline control polygon, Show/Hide B-spline curvature comb, Show/Hide B-spline knot multiplicity, Convert Geometry to B-spline, Increase degree, Increase knot multiplicity, Decrease knot multiplicity

**Sketcher virtual space**Switch Virtual Space

**Getting started****Installation:**Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap**Basics:**About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties; Help FreeCAD, Donate

**Help:**Tutorials, Video tutorials**Workbenches:**Std Base; Arch, Draft, FEM, Image, Inspection, Mesh, OpenSCAD, Part, PartDesign, Path, Points, Raytracing, Reverse Engineering, Sketcher, Spreadsheet, Start, Surface, TechDraw, Test Framework, Web**Deprecated or unmaintained workbenches:**Complete, Drawing, Robot

**Hubs:**User hub, Power users hub, Developer hub