TechDraw Hatch: Difference between revisions

From FreeCAD Documentation
No edit summary
(Bitmap hatching was fixed. See https://github.com/FreeCAD/FreeCAD/pull/7121.)
Line 23: Line 23:


<!--T:8-->
<!--T:8-->
The [[Image:TechDraw_Hatch.svg|24px]] '''TechDraw Hatch''' tool fills a closed region in a View with an [[SVG|SVG]] based hatch pattern. Alternatively the [[Image:TechDraw_GeometricHatch.svg|16px]] [[TechDraw_GeometricHatch|TechDraw GeometricHatch]] tool uses PAT based hatch patterns. See [[TechDraw_Hatching|Hatching]] for details.
The [[Image:TechDraw_Hatch.svg|24px]] '''TechDraw Hatch''' tool fills a closed region in a View with a tiled [[SVG|SVG]] or bitmap ({{Version|1.0}}) based hatch pattern. Alternatively the [[Image:TechDraw_GeometricHatch.svg|16px]] [[TechDraw_GeometricHatch|TechDraw GeometricHatch]] tool uses PAT based hatch patterns. See [[TechDraw_Hatching|Hatching]] for details.


</translate>
</translate>
Line 40: Line 40:
#* Select the {{MenuCommand|TechDraw → [[Image:TechDraw_Hatch.svg|16px]] Hatch a Face using Image File}} option from the menu.
#* Select the {{MenuCommand|TechDraw → [[Image:TechDraw_Hatch.svg|16px]] Hatch a Face using Image File}} option from the menu.
# The {{MenuCommand|Apply Hatch to Face}} task panel opens.
# The {{MenuCommand|Apply Hatch to Face}} task panel opens.
# Optionally change the {{MenuCommand|Pattern File}}, the {{MenuCommand|Pattern Scale}} and the {{MenuCommand|Line Color}}.
# Optionally change the {{MenuCommand|Pattern File}}.
# Optionally change the {{MenuCommand|Pattern Scale}} and the {{MenuCommand|Line Color}}. These settings are ignored for bitmap patterns.
# Press the {{Button|OK}} button.
# Press the {{Button|OK}} button.


Line 47: Line 48:
<!--T:11-->
<!--T:11-->
* Hatching objects are vulnerable to the "[[Topological_naming_problem|topological naming problem]]". See [[TechDraw_LengthDimension|TechDraw LengthDimension]] for more information. It is recommended that hatching be one of the last steps in your drawing process.
* Hatching objects are vulnerable to the "[[Topological_naming_problem|topological naming problem]]". See [[TechDraw_LengthDimension|TechDraw LengthDimension]] for more information. It is recommended that hatching be one of the last steps in your drawing process.
* Sample [[SVG|SVG]] patterns are available locally in
* Sample [[SVG|SVG]] patterns are available locally in:
</translate>
</translate>
{{Code|code=
: {{Code|code=
$INSTALL_DIR/data/Mod/TechDraw/Patterns
$INSTALL_DIR/data/Mod/TechDraw/Patterns
}}
}}
<translate>
<translate>
<!--T:21-->
<!--T:21-->
where {{incode|$INSTALL_DIR}} is the directory where FreeCAD was installed, for example
: Where {{incode|$INSTALL_DIR}} is the directory where FreeCAD was installed, for example:
</translate>
</translate>
{{Code|code=
: {{Code|code=
/usr/share/freecad/data/Mod/TechDraw/Patterns
/usr/share/freecad/data/Mod/TechDraw/Patterns
}}
}}
<translate>
<translate>
<!--T:22-->
<!--T:22-->
and also on [https://github.com/FreeCAD/FreeCAD/tree/master/src/Mod/TechDraw/Patterns GitHub].
: They are also available on [https://github.com/FreeCAD/FreeCAD/tree/master/src/Mod/TechDraw/Patterns GitHub].


==Properties== <!--T:5-->
==Properties== <!--T:5-->

Revision as of 16:57, 31 October 2022

TechDraw Hatch

Menu location
TechDraw → Hatch a Face using Image File
Workbenches
TechDraw
Default shortcut
None
Introduced in version
-
See also
TechDraw Geometric Hatch, TechDraw Hatching

Description

The TechDraw Hatch tool fills a closed region in a View with a tiled SVG or bitmap (introduced in version 1.0) based hatch pattern. Alternatively the TechDraw GeometricHatch tool uses PAT based hatch patterns. See Hatching for details.

SVG hatch pattern on a face

Usage

  1. Select a closed region in a View.
  2. There are several ways to invoke the tool:
    • Press the TechDraw Hatch button.
    • Select the TechDraw → Hatch a Face using Image File option from the menu.
  3. The Apply Hatch to Face task panel opens.
  4. Optionally change the Pattern File.
  5. Optionally change the Pattern Scale and the Line Color. These settings are ignored for bitmap patterns.
  6. Press the OK button.

Notes

$INSTALL_DIR/data/Mod/TechDraw/Patterns
Where $INSTALL_DIR is the directory where FreeCAD was installed, for example:
/usr/share/freecad/data/Mod/TechDraw/Patterns
They are also available on GitHub.

Properties

  • DataSource: The View and Face to receive the hatch pattern.
  • DataHatch Pattern: Full path and filename to an SVG pattern file.
  • ViewHatch Color: Hatch pattern will be displayed in this color.
  • ViewHatch Scale: Hatch pattern size modifier.

Scripting

See also: TechDraw API and FreeCAD Scripting Basics.

The Hatch tool can be used in macros and from the Python console by using the following functions:

hatch = FreeCAD.ActiveDocument.addObject('TechDraw::DrawHatch','Hatch')
hatch.Source = (view1,["Face0"])
hatch.HatchPattern = hatchFileSpec
rc = page.addView(hatch)