Draft: Implementation of 'Align to face' checkbox in Hatch task panel (#21332)
This commit is contained in:
@@ -27,11 +27,11 @@ from draftobjects.hatch import Hatch
|
||||
if FreeCAD.GuiUp:
|
||||
from draftviewproviders.view_hatch import ViewProviderDraftHatch
|
||||
|
||||
def make_hatch(baseobject, filename, pattern, scale, rotation):
|
||||
def make_hatch(baseobject, filename, pattern, scale, rotation, translate=True):
|
||||
|
||||
"""make_hatch(baseobject, filename, pattern, scale, rotation): Creates and returns a
|
||||
"""make_hatch(baseobject, filename, pattern, scale, rotation, translate): Creates and returns a
|
||||
hatch object made by applying the given pattern of the given PAT file to the faces of
|
||||
the given base object. Given scale and rotation factors are applied to the hatch object.
|
||||
the given base object. Given scale, rotation and translate factors are applied to the hatch object.
|
||||
The result is a Part-based object created in the active document."""
|
||||
|
||||
if not FreeCAD.ActiveDocument:
|
||||
@@ -43,6 +43,7 @@ def make_hatch(baseobject, filename, pattern, scale, rotation):
|
||||
obj.Pattern = pattern
|
||||
obj.Scale = scale
|
||||
obj.Rotation = rotation
|
||||
obj.Translate = translate
|
||||
if FreeCAD.GuiUp:
|
||||
ViewProviderDraftHatch(obj.ViewObject)
|
||||
return obj
|
||||
|
||||
Reference in New Issue
Block a user