Draft: Tratteggio

From FreeCAD Documentation
Revision as of 22:40, 17 February 2023 by Marco T (talk | contribs) (Created page with "* Premere il pulsante {{Button|...}} per selezionare un {{MenuCommand|file PAT}}. Vedere Note. * Selezionare un {{MenuCommand|Motivo}} dal file. Attualmente è consigliabile evitare modelli con linee tratteggiate. * Specificare un {{MenuCommand|Scala}} per il modello. * Specificare un {{MenuCommand|Rotazione}} per il modello. * Premere {{KEY|Esc}} o il pulsante {{Button|Annulla}} per interrompere il comando.")
Other languages:

Tratteggio

Posizione nel menu
Drafting → Tratteggio
Ambiente
Draft, Arch
Avvio veloce
H A
Introdotto nella versione
0.20
Vedere anche
Campitura

Descrizione

Il comando Tratteggio crea dei tratteggi sulle facce piane di un oggetto selezionato.

Utilizzo

  1. Selezionare un oggetto con facce. Verranno tratteggiate solo le facce piane dell'oggetto.
  2. Esistono diversi modi per invocare il comando:
    • Premere il pulsante Tratteggio.
    • Selezionare l'opzione Drafting → Tratteggio dal menu.
    • Usare la scorciatoia da tastiera: H poi A.
  3. Si apre il pannello attività Tratteggio. Vedere Opzioni per maggiori informazioni.
  4. Premere il pulsante OK per terminare il comando.

Opzioni

  • Premere il pulsante ... per selezionare un file PAT. Vedere Note.
  • Selezionare un Motivo dal file. Attualmente è consigliabile evitare modelli con linee tratteggiate.
  • Specificare un Scala per il modello.
  • Specificare un Rotazione per il modello.
  • Premere Esc o il pulsante Annulla per interrompere il comando.

Pattern alignment

When the hatch pattern for a face is calculated it is temporarily translated to the global XY plane by default. For a face with straight edged the first straight edge determines how this happens. The first point of that edge is put on the origin, and the edge itself is aligned with the X-axis. If you create Draft Wires with that in mind you can control how the hatch pattern is aligned with the outline of the face.

If all faces of the selected object are on the global XY plane you can switch off this default behavior by setting the DatiTranslate property of the Draft Hatch to false. The hatch pattern is then aligned with the origin and the X axis of the global coordinate system. For faces on the XY plane with straight edges the DatiTranslate property can be used to switch between absolute (on the left in the image) and relative (on the right in the image) patterns.

Two Draft Wires with hatches.
The wires were created in a CCW direction starting from the bottom left point.
For the Draft Hatch on the left the Translate property is set to false.
For the Draft Hatch on the right it is set to true.

Notes

  • For now the advice is to download a PAT file. Many can be found online. You can for example do a web search for acad.pat or acadiso.pat.
  • A small PAT file is installed with FreeCAD: <program_folder>/data/Mod/TechDraw/PAT/FCPAT.pat, where <program_folder> is the FreeCAD program folder:
    • On Linux it is usually /usr/share/freecad.
    • On Windows it is usually C:\Program Files\FreeCAD.
    • On macOS it is usually /Applications/FreeCAD.

Preferences

See also: Preferences Editor and Draft Preferences.

The following preferences are involved:

  • PAT file: Tools → Edit parameters... → BaseApp → Preferences → Mod → TechDraw → PAT → FilePattern.
  • Pattern: Tools → Edit parameters... → BaseApp → Preferences → Mod → TechDraw → PAT → NamePattern.
  • Scale: Tools → Edit parameters... → BaseApp → Preferences → Mod → Draft → HatchPatternScale.
  • Rotation: Tools → Edit parameters... → BaseApp → Preferences → Mod → Draft → HatchPatternRotation.

Properties

See also: Property editor.

A Draft Hatch object is derived from a Part Feature object and inherits all its properties. It also has the following additional properties:

Data

Hatch

  • DatiBase (Link): specifies the object whose faces are hatched.
  • DatiFile (File): specifies the PAT file.
  • DatiPattern (String): specifies the pattern name.
  • DatiRotation (Angle): specifies the rotation of the pattern.
  • DatiScale (Float): specifies the scale of the pattern.
  • DatiTranslate (Bool): specifies if the faces are temporarily translated to the global XY plane during the hatching process. Setting it to false may give wrong results for non-XY faces.

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

To create a Draft Hatch use the make_hatch method of the Draft module.

hatch = make_hatch(baseobject, filename, pattern, scale, rotation)

Example:

import FreeCAD as App
import Draft

doc = App.newDocument()

rectangle = Draft.make_rectangle(4000, 1000)
rectangle.MakeFace = True
filename = App.getHomePath() + "data/Mod/TechDraw/PAT/FCPAT.pat"
pattern = "Horizontal5"
hatch = Draft.make_hatch(rectangle, filename, pattern, scale=50, rotation=45)

doc.recompute()