# Sketcher project

This is the FreeCAD Sketcher development project. It follows the rules of the Getting things done process. The projects are collected in the Development roadmap.

## Purpose and principles

This is a software development project aimed to implement a Constraint Sketcher capabilities. Its about implementing some Gui elements and the binding to the constraint solver.

The development steps are planed here and tracked in the Issue tracking system to get a well formed Change Log.

## Outcome

## Brainstorming

In order to improve the solving performance of the sketcher, a graph-based partitioning of the constraints system can take place. The set of the constraints and the set of the unknown parameters can be represented in a bipartite graph with constraints corresponding to left nodes and unknowns to right nodes. **DONE**

A simple but often very useful preprocessing step is to recognize any disjoint subgroups so that they can be treated separately in the solver. **DONE**

Moreover one could reduce the number of the unknown parameters that are taken into account in the solution. At the beginning of a solution it should be checked which constraints are not already satisfied. By graph analysis one could find a minimum set of unknown parameters that should be taken into account in order to satisfy all unsatisfied constraints.

Going one step further, rigid sub-parts of a sketch could be detected and reduced to 3 degrees of freedom (x,y,rotation).

## Organizing

## Next actions

For 0.14:

- Mouse Dragging for multiple selection
- List of Geometries in the task panel (similar to the list of Constraints)
- Add a popup menu option to convert a coincident points constraint to tangency constraints
- Polygon tool (convenience)
- Update wiki documentation on Symmetry constraint and Polyline tool (m-key)

Idea Brainstorm:

User Interface :

- Full Screen Grid (Units aware)
- Smarter Auto-constraints:
- Algorithm only considers geometry that is on the screen to increase performance and improve selection
- Prevent constraint conflicts

- Hint Lines: horizontal, vertical, perpendicular, tangent constraints?
- Overhaul of constraint icons by merging into one SoNode
- Merge into one SoNode to improve performance
- Remove need for ray pick to increase performance
- Share texture memory more efficiently.
- Improve algorithm for preventing overlap
- Tool Bar for toggling constraint visuals independently

- Datum Label Improvements:
- Radius label can be positioned at any angle
- Remove need for storing in SoImage which isn't needed any more

- Fix Grid Edge
- Auto constraints whilst dragging (Point on Point, Point on Line Coincident)?
- Highlight entities or zoom to over constrained area of sketch
- Related to part design (transparent support objects)
- Implement Sketch Plane Feature with introduction of Assembly module
- Improve Point Selection by implementing new custom node.
- Construction lines use dashes instead of solid lines.

For 0.13:

- support for arc/arc and arc/circle in the tangent constraint -
**DONE**[logari81] - support for arcs in the perpendicular constraint -
**DONE**[logari81] - zoom-independent arrows (symmetry constraint) / dimension lines -
**DONE**[mrlukeparry] - external geometry / constraints -
**DONE**[logari81] - box selection -
**DONE**[mrlukeparry] - mouse dragging of multiple selection -
**SKIPPED for 0.14** - better constrainess diagnostics (Issue #691)-
**DONE**[logari81] - list of Geometries in the task panel (similar to the list of Constraints) -
**SKIPPED for 0.14** - support for points as construction geometry -
**DONE**[logari81] - add a popup menu option to convert a coincident points constraint to tangency constraints -
**SKIPPED for 0.14** - make symmetry constraint to work with symmetry points instead of symmetry lines (useful e.g. for midpoint definition) -
**DONE**[logari81]

For 0.12:

- constraint parameters (datums) editable in the 3D view
**DONE**[jriegel] - synchronization between listwidgetview selection - 3D view selection -
**DONE**[wmayer] - avoid overlapping of constraints symbols
**DONE**- [mrlukeparry]- make constraints symbols smaller, selectable and avoid overlapping when zooming out
**DONE**- [mrlukeparry] - create constraint icons for 3D Inventor view
**DONE**- [mrlukeparry] - make datum text size dependant on zoom
**DONE**- [mrlukeparry] - make datum text easier to select
**DONE**- [mrlukeparry] - Prevent text overlap on Datum Labels
**DONE**- [mrlukeparry]

- make constraints symbols smaller, selectable and avoid overlapping when zooming out
- testing the new solver in stand alone mode
- external constraints (having constraints with references outside the sketch, some edge of the 3D model e.g.)
**0.13**[jriegel] - auto-constraining
**DONE**[jriegel]- auto-constraint for perpendicular
**DONE**- [mrlukeparry]

- auto-constraint for perpendicular
- visualize tangency constraints
**DONE**- [mrlukeparry] - visualize point to line distance constraints and point to point distance constraints
**DONE**- [logari81] - add indexes to the constraints symbols in 3D view in order to distinguish between constraints of the same kind
**DONE**- [mrlukeparry] - radius constraint (including visualization)
**DONE**- [logari81] - angle constraint (including visualization)
**DONE**- [logari81] - implement a fillet tool in the sketcher
**DONE**[mrlukeparry]- provide a method of setting fillet radius (Issue #437)

- implement a trim/extend tool in the sketcher
**DONE**[logari81]- implement an extend tool
**SKIPPED**[logari81] - trim support on arcs
**DONE**[mrlukeparry]

- implement an extend tool
- equal lengths constraint (including visualization)
**DONE**- [logari81] - constrainess diagnostics - degree of freedom counting
**DONE**- [logari81] - symmetry constraint (including visualization)
**DONE**- [logari81] - implement point on object constraint
**DONE**- [mrlukeparry] - Make Snap-Grid less 'greedy'
**DONE**[mrlukeparry] - Wiki page for the Sketcher Workbench
**DONE**[normandc]

**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, Linux, Windows, MacOS, 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**Unmaintained workbenches:**Plot, Robot, Ship**Deprecated workbenches:**Complete, Drawing

**Code:**Addon Manager, Addons, Macros, External workbenches

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