Com a Bancada de Trabalho Sketcher, é possível criar esboços 2D destinados ao uso em outras bancadas de trabalho. Os esboços 2D são o ponto de partida para muitos modelos CAD. Eles geralmente definem os perfis e trajetórias para operações de criação de formas 3D. Um modelo pode depender de vários esboços para sua forma final.
Juntamente com as operações booleanas definidas na Bancada de Trabalho Part, a Bancada de Trabalho Sketcher — ou simplesmente "Sketcher" — forma a base do método de geometria sólida construtiva (CSG) para a criação de sólidos. Em conjunto com as operações da
Bancada de Trabalho PartDesign, ela também constitui a base da metodologia de edição de recursos para a criação de sólidos. No entanto, muitas outras bancadas de trabalho também utilizam esboços.
A bancada de trabalho Sketcher dispõe de restrições, permitindo que formas 2D sigam definições geométricas precisas em termos de comprimento, ângulos e relações (horizontalidade, verticalidade, perpendicularidade, etc.). Um solucionador de restrições calcula a geometria 2D restrita e permite a exploração interativa dos graus de liberdade do esboço.
O ambiente de esboço (Sketcher) não se destina à produção de desenhos técnicos 2D. Assim que os esboços são utilizados para gerar uma operação de sólido, eles são ocultados automaticamente, e as restrições ficam visíveis apenas no modo de edição do esboço. Se você precisa apenas produzir vistas 2D para impressão e não deseja criar modelos 3D, consulte a bancada de trabalho Draft.
Um esboço básico totalmente restrito
Restrições são utilizadas para limitar os graus de liberdade de um objeto. Por exemplo, uma linha sem restrições possui 4 graus de liberdade (abreviados como "DoF"): ela pode ser movida horizontal ou verticalmente, pode ser esticada e pode ser rotacionada.
Aplicar uma restrição horizontal ou vertical, ou uma restrição angular (em relação a outra linha ou a um dos eixos), limitará sua capacidade de rotação, deixando-a com 3 graus de liberdade. Travar um de seus pontos em relação à origem removerá outros 2 graus de liberdade, e a aplicação de uma restrição de tamanho (dimensão) removerá o último grau de liberdade. A linha é então considerada totalmente restrita.
Objetos podem ter restrições aplicadas em relação uns aos outros. Duas linhas podem ser unidas em um de seus pontos por meio de uma restrição de coincidência. É possível definir um ângulo entre elas ou torná-las perpendiculares. Uma linha pode ser tangente a um arco ou a um círculo, e assim por diante. Um esboço pode admitir diversas soluções; torná-lo totalmente restrito pode significar que apenas uma dessas soluções possíveis foi alcançada com base nas restrições aplicadas. Veja também: Inversão (Flipping).
Existem dois tipos de restrições: geométricas e dimensionais. Elas estão detalhadas na seção Ferramentas abaixo.
introduced in 1.1: The label of dimensional constraints in the sketch identifies their state: reference dimensions are enclosed in parentheses, dimensions controlled by an expression have a (ƒ𝑥) suffix, and deactivated dimensions are struck through.
Quando uma restrição dimensional de condução é criada e a preferência Solicitar valor após criar uma restrição dimensional está selecionada (padrão), uma caixa de diálogo é aberta para editar o seu valor.
Você pode inserir um valor numérico ou uma expressão, e é possível nomear a restrição para facilitar seu uso em outras expressões. Você também pode marcar a caixa de seleção Reference para alternar a restrição para o modo de referência.
introduced in 26.3: When a dimensional constraint whose value is controlled by an expression, is hovered in the sketch or the Constraints section of the Sketcher Dialog, and no sketcher tool is active, a tooltip displays that expression.
To edit the value of an existing dimensional constraint do one of the following:
As restrições dimensionais podem ser reposicionadas na Vista 3D ao serem arrastadas. Mantenha pressionado o botão esquerdo do mouse sobre o valor da restrição e mova o mouse. Os símbolos das restrições geométricas são posicionados automaticamente e não podem ser movidos.
Dimension and constraint tools running in Continue Mode can directly reference edges and vertices outside the sketch. If not yet available, projected external geometry is created automatically, and this is used as the dimension or constraint operand. The external geometry is created as construction geometry. The referenced object(s) must belong to the same geometric parent (for example the same Std Part or PartDesign Body) as the sketch, or sketch and object(s) must all be in the global space.
When a sketch has only one dimension that defines its scale, entering a new numerical value for that dimension can scale the entire sketch about its origin. This preserves the overall proportions when you first size a roughly drawn sketch. For example, changing a rectangle's only length dimension from 10 mm to 20 mm doubles both its width and height. Angle constraints do not count as scale-defining dimensions. The view is adjusted along with the geometry, so the sketch can appear to keep the same size on screen. The Scale upon first constraint preference controls this behavior.
Para criar um esboço que possa ser utilizado como perfil para a geração de sólidos, certas regras devem ser seguidas:
Invalid sketches:
1. Open contour (free endpoints highlighted by the Validate Sketch tool)
2. Intersecting contours
3. Duplicate edges (endpoints of overlapping edges highlighted by the Validate Sketch tool)
4. T-connections
These rules do not apply to construction geometry (default color blue), which is not shown outside edit mode, or if the sketch is used for a different purpose. Depending on the workbench and the tool that will use the profile sketch, additional restrictions may apply.
Se a propriedade DadosMake Internals de um esboço estiver definida como true, são geradas faces internas com base nas arestas do esboço. Essas faces podem ser selecionadas como perfis fechados para operações. Contornos que se cruzam e conexões em T são permitidos; eles apenas resultam em faces adicionais.
As ferramentas do Sketcher Workbench estão localizadas no menu Sketch e/ou em diversas barras de ferramentas. Quase todas as barras de ferramentas do Sketcher só são exibidas enquanto um esboço está no modo de edição. A única exceção é a Barra de ferramentas do Sketcher que só é exibida se nenhum esboço estiver no modo de edição.
Some tools are also available from the 3D View context menu while a sketch is in edit mode, or from the context menus of the Sketcher Dialog.
introduzido na versão 0.21: Se um esboço estiver no modo de edição, a barra de ferramentas Estrutura ficará oculta, pois nenhuma de suas ferramentas poderá ser usada.
Estas são ferramentas para criar objetos.
Estas são ferramentas para criar restrições. Algumas restrições exigem o uso de restrições auxiliares.
The Sketcher Workbench has several drawing aids and other features that can help when creating geometry and applying constraints.
There are two continue modes: Geometry creation "Continue Mode" and Constraint creation "Continue Mode". If these are checked (default) in the preferences, related tools will restart after finishing. To exit a continuous tool press Esc or the right mouse button. This must be repeated if a continuous geometry tool has already received input. You can also exit a continuous tool by starting another geometry or constraint creation tool. Note that pressing Esc if no tool is active will exit sketch edit mode. Uncheck the Esc key can leave sketch edit mode preference if you often inadvertently press Esc too many times.
In sketches that have Auto constraints checked (default) several constraints are applied automatically when creating geometry or (introduced in 26.3) dragging existing points. The icon of a proposed automatic constraint is shown next to the cursor when it is placed correctly. Left-clicking, or ending the drag operation by releasing the Left mouse button, will then apply that constraint. This is a per-sketch setting that can be changed in the Sketcher Dialog or by changing the VistaAutoconstraints property of the sketch.
There is a fine-tuning parameter to control the auto constraint delay when dragging geometry.
The following constraints are applied automatically:
To create auto constraints along extended arcs circular helpers can be shown.
Lines are automatically extended with helper lines if the cursor is positioned correctly. This allows creating point-on-object auto constraints along the line.
Using a directional helper line to create a perpendicular auto constraint
If the Show directional autoconstraint helpers preference is selected (default), tangential, or perpendicular and parallel helper lines referencing a target edge can be shown while using the Polyline tool (only when creating line segments) and
Line tool.
Note that straight target edges that are horizontal or vertical are ignored.
It is possible to snap to grid lines and grid intersection, and to snap to edges of geometry and midpoints of lines and arcs, and to certain angles. Please note that snapping does not produce constraints in and of itself. For example, only if Auto constraints is switched on will snapping to an edge produce a point-on-object constraint. But just picking a point on the edge would then have the same result.
Depending on the selected option in the preferences only the dimensional On-View-Parameters or both the dimensional and the positional On-View-Parameters can be enabled. Positional parameters allow the input of exact coordinates, for example the center of a circle, or the start point of a line. Dimensional parameters allow the input of exact dimensions, for example the radius of a circle, or the length and angle of a line. On-View-Parameters are not available for all tools.
Determining the center point of a circle with the positional parameters enabled
Determining the radius of a circle with the dimensional parameters enabled
If values are entered and confirmed by pressing Enter or Tab, related constraints are added automatically. If two parameters are displayed at the same time, for example the X- and Y-coordinate of a point, it is possible to enter one value and pick a point to define the other. Depending on the object additional constraints may be required to fully constrain it. Constraints resulting from On-View-Parameters take precedence over those that may result from Auto constraints.
introduced in 26.3 If an OVP input has the focus you can hold down Alt to send key strokes to the 3D View instead.
Arc created by entering all On-View-Parameters with resulting automatically created constraints
If the Show coordinates next to the cursor while editing preference is checked (default), the parameters of the current geometry tool (coordinates, radius, or length and angle) are displayed next to the cursor. This is deactivated while On-View-Parameters are shown.
While a sketch is in edit mode several selection methods can be used. introduced in 26.3: For all methods selection filters are taken into account.
As elsewhere in FreeCAD, an element can be selected in the 3D View with a single left mouse click. But there is no need to hold down the Ctrl key when selecting multiple elements. Holding down that key is possible though and has the advantage that you can miss-click without losing the selection. Edges, points and constraints can be selected in this manner.
Box selection in the 3D View works without using Std BoxSelection or Std BoxElementSelection:
You can box-select edges and points, constraints cannot be box-selected.
Double-clicking an edge in the 3D View will select all edges directly and indirectly connected with that edge via endpoints. There is no need for the edges to be connected with coincident constraints, endpoints need only have the same coordinates.
Edges and points can also be selected from the Elements section of the Sketcher Dialog, and constraints from the Constraints section of that dialog.
To select everything within a sketch, use the standard keyboard shortcut Ctrl+A or the Edit → Select All option from the menu.
introduced in 1.1: To drag several elements together, select them using any selection method, hold down the left mouse button over one of the selected elements, move the mouse, then release the button to finish the drag. Existing constraints remain in effect and can limit or prevent the movement. Fully constrained geometry cannot be dragged. Any selected external geometry is excluded from the drag.
The standard keyboard shortcuts, Ctrl+C, Ctrl+X and Ctrl+V, can be used to copy, cut and paste selected Sketcher geometry including related constraints. But these tools are also available from the Sketch → Sketcher Tools menu. They can be used within the same sketch but also between different sketches or separate instances of FreeCAD. Since the data is copied to the clipboard in the form of Python code, it can be used in other ways too (e.g. shared on the forum).
Geometry created by External Projection and External Intersection can be used with Offset, Move / Array Transform, Rotate / Polar Transform, Scale and Mirror. Both external construction geometry and external defining geometry are accepted.
If the operation changes or removes the original geometry, its external reference is removed from the sketch. Removing a face reference removes all external edges created from that face. The source object remains unchanged. To retain a reference alongside the result, use a tool option that keeps the originals.
Cada usuário CAD desenvolve sua própria maneira de trabalhar ao longo do tempo, mas existem alguns princípios gerais úteis a seguir.
The phenomenon that a fully constrained sketch, usually after a major change to one of its dimensions, reaches an unintended new state is known as "flipping". In the example below, changing one dimension completely changes the shape of the sketch. Note that the sketch with the new shape is still fully constrained.
Original sketch (left), and the same sketch after increasing the 20mm value to 1000mm (right)
This is not always practical, but changing dimension values in smaller increments can work.
The LevenbergMarquardt solver, which is not the default solver, is known to be less prone to flipping. See Sketcher Dialog for more information.
Using horizontal and vertical dimensions instead of distance dimensions or equal constraints can prevent flipping. Points constrained by these dimensions will only switch places if the sign of their value is changed. In the image above the added (orange) dimensional constraints are linked to the original dimensions via expressions.
Using angle dimensions instead of horizontal and vertical constraints can also work. The angle between edges constrained by angle dimensions will not change. 180° will not become 0°, 90° will not become 270°, etc. In the image all horizontal and vertical constraints have been replaced, but just replacing two is already effective here.
A página Sketcher scripting contém exemplos de como criar restrições a partir de scripts Python.
For some ideas of what can be achieved with Sketcher tools, have a look at: Sketcher Examples.