TechDraw Hatch: Difference between revisions

From FreeCAD Documentation
(relink module to workbench)
mNo edit summary
(15 intermediate revisions by 3 users not shown)
Line 4: Line 4:
<!--T:19-->
<!--T:19-->
{{Docnav
{{Docnav
|[[TechDraw_ClipGroupRemove|ClipGroupRemove]]
|[[TechDraw_ExportPageDXF|ExportPageDXF]]
|[[TechDraw_GeometricHatch|GeometricHatch]]
|[[TechDraw_GeometricHatch|GeometricHatch]]
|[[TechDraw_Workbench|TechDraw]]
|[[TechDraw_Workbench|TechDraw]]
|IconL=TechDraw_ExportPageDXF.svg
|IconL=TechDraw_ClipGroupRemove.svg
|IconR=TechDraw_GeometricHatch.svg
|IconR=TechDraw_GeometricHatch.svg
|IconC=Workbench_TechDraw.svg
|IconC=Workbench_TechDraw.svg
Line 15: Line 15:
{{GuiCommand
{{GuiCommand
|Name=TechDraw Hatch
|Name=TechDraw Hatch
|MenuLocation=TechDraw → Hatch a Face using Image File
|MenuLocation=TechDraw → Hatching → Hatch a Face using Image File
|Workbenches=[[TechDraw_Workbench|TechDraw]]
|Workbenches=[[TechDraw_Workbench|TechDraw]]
|SeeAlso=[[TechDraw_GeometricHatch|TechDraw Geometric Hatch]], [[TechDraw_Hatching|TechDraw Hatching]]
|SeeAlso=[[TechDraw_GeometricHatch|TechDraw Geometric Hatch]], [[TechDraw_Hatching|TechDraw Hatching]]
Line 23: Line 23:


<!--T:8-->
<!--T:8-->
The Hatch tool fills a closed region in a View with a hatch pattern, which can be [[SVG|SVG]] or [[bitmap|bitmap]] files. In contrary the [[Image:TechDraw_GeometricHatch.svg|24px]] [[TechDraw_GeometricHatch|Geometric Hatch]] tool uses a specific PAT pattern file, see [[TechDraw_Hatching|Hatching]] for details.
The '''TechDraw Hatch''' tool fills a closed region in a View with a tiled [[SVG|SVG]] or bitmap ({{Version|0.21}}) 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 35: Line 35:


<!--T:10-->
<!--T:10-->
# Select an closed region in a View.
# Select a closed region in a View.
# There are several ways to invoke the tool:
# Press the {{Button|[[Image:TechDraw_Hatch.svg|16px]] [[TechDraw_Hatch|Hatch a Face using Image File]]}} button
#* Press the {{Button|[[Image:TechDraw_Hatch.svg|16px]] [[TechDraw_Hatch|TechDraw Hatch]]}} button.
# A dialog will open where you can select the pattern file, the scale and color.
#* Select the {{MenuCommand|TechDraw → Hatching → [[Image:TechDraw_Hatch.svg|16px]] Hatch a Face using Image File}} option from the menu.
# The {{MenuCommand|Apply Hatch to Face}} task panel opens.
# 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.


== Notes == <!--T:7-->
== Notes == <!--T:7-->


<!--T:11-->
<!--T:11-->
* For a solid color fill select {{FileName|solid.svg}} as the '''Pattern File'''.
* Hatching objects are vulnerable to "[[Topological_naming_problem|topological naming]]" issues. See the information in the [[TechDraw_Dimension_Length|TechDraw Dimension Length]] tool 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-->
Line 70: Line 76:


<!--T:15-->
<!--T:15-->
{{Emphasis|See also:}} [[TechDraw_API|TechDraw API]] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD_Scripting_Basics|FreeCAD Scripting Basics]].


<!--T:16-->
<!--T:16-->
The Hatch tool can be used in [[Macros|macros]] and from the [[Python|Python]] console by using the following functions:
A Hatch can be created with [[Macros|macros]] and from the [[Python|Python]] console by using the following functions:


</translate>
</translate>
{{Code|code=
{{Code|code=
hatch = FreeCAD.ActiveDocument.addObject('TechDraw::DrawHatch','Hatch')
hatch = FreeCAD.ActiveDocument.addObject("TechDraw::DrawHatch", "Hatch")
hatch.Source = (view1,["Face0"])
hatch.Source = (view1, ["Face0"])
hatch.HatchPattern = hatchFileSpec
hatch.HatchPattern = hatchFileSpec
rc = page.addView(hatch)
page.addView(hatch)
}}
}}
<translate>
<translate>
Line 87: Line 93:
<!--T:20-->
<!--T:20-->
{{Docnav
{{Docnav
|[[TechDraw_ClipGroupRemove|ClipGroupRemove]]
|[[TechDraw_ExportPageDXF|ExportPageDXF]]
|[[TechDraw_GeometricHatch|GeometricHatch]]
|[[TechDraw_GeometricHatch|GeometricHatch]]
|[[TechDraw_Workbench|TechDraw]]
|[[TechDraw_Workbench|TechDraw]]
|IconL=TechDraw_ExportPageDXF.svg
|IconL=TechDraw_ClipGroupRemove.svg
|IconR=TechDraw_GeometricHatch.svg
|IconR=TechDraw_GeometricHatch.svg
|IconC=Workbench_TechDraw.svg
|IconC=Workbench_TechDraw.svg

Revision as of 07:52, 1 August 2023

TechDraw Hatch

Menu location
TechDraw → Hatching → 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 0.21) 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 → Hatching → 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

  • For a solid color fill select solid.svg as the Pattern File.
  • Hatching objects are vulnerable to the "topological naming problem". See TechDraw LengthDimension for more information. It is recommended that hatching be one of the last steps in your drawing process.
  • Sample SVG patterns are available locally in:
$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: Autogenerated API documentation and FreeCAD Scripting Basics.

A Hatch can be created with 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
page.addView(hatch)