Fixes to PathArray
- missing refresh() in DraftTools - handle case where Base obj has non-trivial Placement - copy Base obj format to PathArray object
This commit is contained in:
parent
08d2121334
commit
d68ea73879
|
@ -1049,6 +1049,7 @@ def makePathArray(baseobject,pathobject,count,xlate=None,align=False,pathobjsubs
|
||||||
if gui:
|
if gui:
|
||||||
_ViewProviderDraftArray(obj.ViewObject)
|
_ViewProviderDraftArray(obj.ViewObject)
|
||||||
baseobject.ViewObject.hide()
|
baseobject.ViewObject.hide()
|
||||||
|
formatObject(obj,obj.Base)
|
||||||
select(obj)
|
select(obj)
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
|
@ -4412,7 +4413,7 @@ class _PathArray(_DraftObject):
|
||||||
return(edge.getParameterByLength(length))
|
return(edge.getParameterByLength(length))
|
||||||
|
|
||||||
def orientShape(self,shape,edge,offset,RefPt,xlate,align):
|
def orientShape(self,shape,edge,offset,RefPt,xlate,align):
|
||||||
'''Orient shape to edge tangent at offset.'''
|
'''Orient shape to tangent at parm offset along edge.'''
|
||||||
import Part
|
import Part
|
||||||
import DraftGeomUtils
|
import DraftGeomUtils
|
||||||
import math
|
import math
|
||||||
|
@ -4420,7 +4421,9 @@ class _PathArray(_DraftObject):
|
||||||
y = FreeCAD.Vector(0,1,0) # unit +Y
|
y = FreeCAD.Vector(0,1,0) # unit +Y
|
||||||
x = FreeCAD.Vector(1,0,0) # unit +X
|
x = FreeCAD.Vector(1,0,0) # unit +X
|
||||||
nullv = FreeCAD.Vector(0,0,0)
|
nullv = FreeCAD.Vector(0,0,0)
|
||||||
|
nullPlace =FreeCAD.Placement()
|
||||||
ns = shape.copy()
|
ns = shape.copy()
|
||||||
|
ns.Placement = nullPlace # reset Placement so translate goes to right place.
|
||||||
ns.translate(RefPt+xlate)
|
ns.translate(RefPt+xlate)
|
||||||
if not align:
|
if not align:
|
||||||
return ns
|
return ns
|
||||||
|
|
|
@ -4012,6 +4012,7 @@ class PathArray(Modifier):
|
||||||
FreeCAD.ActiveDocument.openTransaction("PathArray")
|
FreeCAD.ActiveDocument.openTransaction("PathArray")
|
||||||
Draft.makePathArray(base,path,defCount,defXlate,defAlign,pathsubs)
|
Draft.makePathArray(base,path,defCount,defXlate,defAlign,pathsubs)
|
||||||
FreeCAD.ActiveDocument.commitTransaction()
|
FreeCAD.ActiveDocument.commitTransaction()
|
||||||
|
FreeCAD.ActiveDocument.recompute() # feature won't appear until recompute.
|
||||||
self.finish()
|
self.finish()
|
||||||
|
|
||||||
class Point(Creator):
|
class Point(Creator):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user