|
Menu location |
---|
TechDraw → Hatching → Apply Geometric Hatch to Face |
Workbenches |
TechDraw |
Default shortcut |
None |
Introduced in version |
- |
See also |
TechDraw Hatch, TechDraw Hatching |
The TechDraw GeometricHatch tool fills a closed region in a View with a pattern based on an AutoDesk PAT hatching specification. Alternatively the TechDraw Hatch tool uses SVG based hatch patterns. See Hatching for details.
Geometric hatch pattern on a face
$INSTALL_DIR/data/Mod/TechDraw/PAT/FCPAT.pat
$INSTALL_DIR
is the directory where FreeCAD was installed, for example:/usr/share/freecad/data/Mod/TechDraw/PAT/FCPAT.pat
See also: Autogenerated API documentation and FreeCAD Scripting Basics.
A GeometricHatch can be created with macros and from the Python console by using the following functions:
hatch = FreeCAD.ActiveDocument.addObject("TechDraw::DrawGeomHatch", "GeomHatch")
hatch.Source = (view1, ["Face0"])
hatch.FilePattern = "path/to/myPATfile.pat"
hatch.NamePattern = "Diamond"
page.addView(hatch)
It is also possible to use TechDraw's geometric hatch engine to produce a compound object in the 3D space. One must take care that the base face lies on the XY plane, as the algorithm is not tailored yet for other cases:
import TechDraw
face = Part.makePlane(10, 10)
patfile = "path/to/myPATfile.pat"
pattern = "Diamond"
scale = 10
hatch = TechDraw.makeGeomHatch(face, scale, pattern, patfile)
Part.show(hatch)