Sketcher Dialog

From FreeCAD Documentation
Revision as of 20:40, 30 April 2023 by Roy 043 (talk | contribs)
This documentation is a work in progress. Please don't mark it as translatable since it will change in the next hours and days.
This page is currently being updated for the coming v0.21

Introduction

If you are in a sketch, the sketcher dialog is shown in the Combo view panel in the tab Tasks (task bar). To jump into a sketch, select it in the model tree an either double-click on it or right-click on it and then select Edit sketch in the context menu. Another possibility is to click on the toolbar icon (Edit sketch).

The dialog consists of the following sections:

Solver messages

This section informs you about the state of the sketch, if it is under- or over-constrained and how many degrees of freedom the sketch has. By clicking on the the degrees of freedom the under-constrained sketch elements will be highlighted with green color.

There are two solver messages options:

Name Description
Auto Remove Redundants If checked, new created constraints that would be redundant to the existing constraints will automatically be removed. The removal will be silent for constrains that are not dimensional.
Note: For dimensional redundant constraints you will be informed that the new constraint is invalid, no matter if you use Auto Remove Redundants or not.
Auto Update If checked, the whole document will be recomputed after every sketch action. The advantage is that if you e.g. edit the sketch of a pocket, you will see the effect immediately. The disadvantage is that it takes a long time for complex documents. Thus disable the option if editing sketches gets slow.

Advanced solver control

This section will only appear if you check the option Show section 'Advanced solver control' in the sketcher preferences.

Available options:

Option Description
Default solver The solver that is used for solving the geometry. LevenbergMarquardt and DogLeg are trust region optimization algorithms. The BFGS solver uses the Broyden–Fletcher–Goldfarb–Shanno algorithm.
DogLeg Gauss step This setting is only available for the solver DogLeg. It is the step type used in the DogLeg algorithm.
Maximum iterations If the solver needs more iterations to find a convergence to a solution, it will stop and output that it failed.
Sketch size multiplier If checked, the maximum iterations will be multiplied by the number of parameters. The idea is that bigger sketches would need more iterations to converge.
Convergence The threshold for the squared error. This error is used to determine whether a solution converges or not.
Eps/Eps1/Tau These settings are only available for the solver LevenbergMarquardt. You should only change there something if you fully understand how the LevenbergMarquardt solver works.
Tolg/Tolx/Tolf These settings are only available for the solver DogLeg. You should only change there something if you fully understand how the DogLeg solver works.
QR Algorithm During diagnosing the rank of the matrix is calculated which enables to further analyze the constraint system to determine if there are redundant/conflicting constraints. The rank revealing decomposition used in FreeCAD is QR. There are two algorithms: Eigen Dense QR is a dense matrix QR with full pivoting, which is the legacy proven algorithm that works very well but it is rather slow as the system grows. The Eigen Sparse QR algorithm is an optimization for sparse matrices (having lots of zeros), which is usually much faster, since FreeCAD's systems do have a lot of zeros.
Pivot threshold When doing a QR, values under the pivot threshold are treated as zero.
Redundant Solver The solver that is used during diagnosing to determine whether a group is redundant or conflicting.
Red. Max Iterations The same as Maximum iterations, but for the redundant solving.
Red. Sketch size multiplier The same as Sketch size multiplier, but for the redundant solving.
Red. Convergence The same as Convergence, but for the redundant solving.
R.Eps/R.Eps1/R.Tau The same as Eps/Eps1/Tau, but for the redundant solving.
R.Tolg/R.Tolx/R.Tolf The same as Tolg/Tolx/Tolf, but for the redundant solving.
Console Debug mode Setting to specify the verbosity of the console output.
Solve With this button the solver will explicitly started.
Restore Defaults With this button the default solver settings will be restored.

Note that most of the solver parameters are of no practical use. They can however help with testing and understanding the solvers.

Constraints

This section lists the constraints in the sketch. Unchecking a constraint in the list will hide it in the sketch. Constraints can be selected in the list as well as in the sketch.

Available options:

Option Description
Filter If the Filter checkbox is checked the Filter dropdown list controls which constraints are listed:
  • All: All constraints.
  • Geometric: Geometric constraints.
  • Datums: Driving dimensional constraints.
  • Named: Named constraints.
  • Reference: Driven dimensional constraints.
  • Selected constraints: Constraints selected in the sketch.
  • Associated constraints: Constraints associated with elements selected in the sketch.
This button toggles the visibility of the listed constraints in the sketch.
This button opens a settings menu:
  • Auto constraints: If checked, some geometric constraints are applied automatically to new elements.
  • Auto remove redundants: If checked, new constraints that are redundant are automatically removed.
  • Show only filtered Constraints: If checked, only the listed constraints are shown in the sketch.
  • Extended information (in widget): If checked, extended information is added in this form:
[(GeoID1,PosID1),(GeoID2,PosID2),(GeoID3,PosID3)]
GeoID is a zero-based index number for non-external geometry. The X axis has GeoID -1, the Y axis has GeoID -2. GeoID -3, -4 etc. are used for external geometry.
PosID can have the following values:
0 = edge, 1 = start point, 2 = end point, 3 = center point.
For example a dimension from the origin to the center of a circle with the element number 2 will get this information:
[(-1,1),(1,3)]
  • Hide internal alignment (in widget): If checked, constraints associated with internal alignments are hidden in the list. The Show/Hide internal geometry tool can also hide these constraints, but will also hide the internal alignments in the sketch.

Elements

This section lists the elements in the sketch. Unchecking an element in the list will hide it in the sketch. Elements can be selected in the list as well as in the sketch.

Available options:

Option Description
Filter If the Filter checkbox is checked the Filter dropdown list controls which elements are listed:
  • Normal: Normal geometry: geometry that does not fall in the next three categories.
  • Construction: Construction geometry.
  • Internal: Internal geometry.
  • External: External geometry.
  • All types: All geometry types. Specific types can be selected in the rest of the list:
    • Point
    • Line
    • Circle
    • Ellipse
    • Arc of circle
    • Arc of ellipse
    • Arc of hyperbola
    • Arc of parabola
    • B-Spline
This button opens a settings menu:
  • Extended information: If checked, extended element information is provided.
For normal geometry the information in the list then changes from:
<N>-<TYPE>
to:
<TYPE>(Edge<N>#ID<GeoID>#VL0)[-Construction]
<TYPE>: Element type.
<N>: A 1-based index that indicates the creation order of the element.
<GeoID>: see under Constraints.
VL0: ??
Each element in the list has 1 to 4 buttons organized in 4 columns. These select a specific part of the element. For each element only the applicable buttons are shown.
  • Button in column 1: Selects the edge of the element.
  • Button in column 2: Selects the start point of the element.
  • Button in column 3: Selects the end point of the element.
  • Button in column 4: Selects the center point of the element.

Clicking the text has the same effect as clicking the first available button of the element.