Skip to content

Commit

Permalink
Fix the Draft Array polar type. Rotate first global and then object o…
Browse files Browse the repository at this point in the history
…wn rotation(spin) of placement.
  • Loading branch information
ageeye committed Dec 24, 2019
1 parent 7dbc309 commit 3ea6583
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Mod/Draft/Draft.py
Expand Up @@ -5902,10 +5902,13 @@ def circArray(self,pl,rdist,tdist,axis,center,cnum,sym):
base.append(npl)
return base

def polarArray(self,pl,center,angle,num,axis,axisvector):
def polarArray(self,spl,center,angle,num,axis,axisvector):
#print("angle ",angle," num ",num)
import Part
base = [pl.copy()]
spin = FreeCAD.Placement(Vector(), spl.Rotation)
pl = FreeCAD.Placement(spl.Base, FreeCAD.Rotation())
center = center.sub(spl.Base)
base = [spl.copy()]
if angle == 360:
fraction = float(angle)/num
else:
Expand All @@ -5916,6 +5919,7 @@ def polarArray(self,pl,center,angle,num,axis,axisvector):
currangle = fraction + (i*fraction)
npl = pl.copy()
npl.rotate(DraftVecUtils.tup(center), DraftVecUtils.tup(axis), currangle)
npl = npl.multiply(spin)
if axisvector:
if not DraftVecUtils.isNull(axisvector):
npl.translate(FreeCAD.Vector(axisvector).multiply(i+1))
Expand Down

0 comments on commit 3ea6583

Please sign in to comment.