TechDraw Hatch: Difference between revisions

From FreeCAD Documentation
No edit summary
(Marked this version for translation)
Line 11: Line 11:
==Description== <!--T:2-->
==Description== <!--T:2-->


<!--T:8-->
The Hatch tool fills a closed region in a [[TechDraw NewView]] with a hatch pattern, which can be [[SVG]] or [[bitmap]] files.
The Hatch tool fills a closed region in a [[TechDraw NewView]] with a hatch pattern, which can be [[SVG]] or [[bitmap]] files.


Line 16: Line 17:
[[Image:TechDraw_Hatch_example.png]]
[[Image:TechDraw_Hatch_example.png]]
<translate>
<translate>
<!--T:9-->
{{Caption|SVG hatch pattern on a face}}
{{Caption|SVG hatch pattern on a face}}


==How to use== <!--T:3-->
==How to use== <!--T:3-->


<!--T:10-->
# Select an closed region in a View. The region will turn green.
# Select an closed region in a View. The region will turn green.
# Press the {{Button|[[Image:TechDraw_Hatch.png|16px]] [[TechDraw Hatch|Hatch]]}} button
# Press the {{Button|[[Image:TechDraw_Hatch.png|16px]] [[TechDraw Hatch|Hatch]]}} button
Line 26: Line 29:
== Notes == <!--T:7-->
== Notes == <!--T:7-->


<!--T:11-->
* Hatching objects are vulnerable to "topological naming" issues. See the information in the [[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 "topological naming" issues. See the information in the [[TechDraw Dimension Length]] tool for more information. It is recommended that hatching be one of the last steps in your drawing process.
* Note that [[SVG]] hatch patterns are not included when a drawing page is saved as an [[SVG]] file.
* Note that [[SVG]] hatch patterns are not included when a drawing page is saved as an [[SVG]] file.


<!--T:12-->
Sample [[SVG]] patterns are available in
Sample [[SVG]] patterns are available in
{{Code|code=
{{Code|code=
Line 34: Line 39:
}}
}}


<!--T:13-->
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
{{Code|code=
{{Code|code=
Line 41: Line 47:
==Properties== <!--T:5-->
==Properties== <!--T:5-->


<!--T:14-->
* {{PropertyData|Source}}: The View and Face to receive the hatch pattern.
* {{PropertyData|Source}}: The View and Face to receive the hatch pattern.
* {{PropertyData|Hatch Pattern}}: Full path and filename to an SVG pattern file.
* {{PropertyData|Hatch Pattern}}: Full path and filename to an SVG pattern file.
Line 48: Line 55:
==Scripting== <!--T:6-->
==Scripting== <!--T:6-->


<!--T:15-->
{{Emphasis|See also:}} [[TechDraw API]] and [[FreeCAD Scripting Basics]].
{{Emphasis|See also:}} [[TechDraw API]] and [[FreeCAD Scripting Basics]].


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


Line 61: Line 70:
<translate>
<translate>


<!--T:17-->
{{TechDraw Tools navi}}
{{TechDraw Tools navi}}


<!--T:18-->
{{Userdocnavi}}
{{Userdocnavi}}
</translate>
</translate>

Revision as of 20:20, 3 January 2019

TechDraw Hatch

Menu location
TechDraw → Hatch
Workbenches
TechDraw
Default shortcut
None
Introduced in version
-
See also
TechDraw GeomHatch, TechDraw Hatching

Description

The Hatch tool fills a closed region in a TechDraw NewView with a hatch pattern, which can be SVG or bitmap files.

SVG hatch pattern on a face

How to use

  1. Select an closed region in a View. The region will turn green.
  2. Press the Hatch button
  3. You may need to press recompute .

Notes

  • Hatching objects are vulnerable to "topological naming" issues. See the information in the TechDraw Dimension Length tool for more information. It is recommended that hatching be one of the last steps in your drawing process.
  • Note that SVG hatch patterns are not included when a drawing page is saved as an SVG file.

Sample SVG patterns are available in

$INSTALL_DIR/Mod/Draft/Resources/patterns

where $INSTALL_DIR is the directory where FreeCAD was installed, for example

/usr/share/freecad/Mod/Draft/Resources/patterns

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)