Skip to content

Commit

Permalink
Draft: Fixed wrong Placement of Draft Wire - fixes #3558
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Nov 1, 2018
1 parent e4b1cfc commit 684b4ab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/Mod/Draft/Draft.py
Expand Up @@ -878,9 +878,12 @@ def makeWire(pointslist,closed=False,placement=None,face=None,support=None):
print("Invalid input points: ",pointslist)
#print(pointslist)
#print(closed)
if placement: typecheck([(placement,FreeCAD.Placement)], "makeWire")
if placement:
typecheck([(placement,FreeCAD.Placement)], "makeWire")
ipl = placement.inverse()
pointslist = [ipl.multVec(p) for p in pointslist]
if len(pointslist) == 2: fname = "Line"
else: fname = "DWire"
else: fname = "Wire"
obj = FreeCAD.ActiveDocument.addObject("Part::Part2DObjectPython",fname)
_Wire(obj)
obj.Points = pointslist
Expand Down
9 changes: 6 additions & 3 deletions src/Mod/Draft/DraftTools.py
Expand Up @@ -605,9 +605,12 @@ def finish(self,closed=False,cont=False):
# building command string
rot,sup,pts,fil = self.getStrings()
FreeCADGui.addModule("Draft")
self.commit(translate("draft","Create DWire"),
['points='+pts,
'line = Draft.makeWire(points,closed='+str(closed)+',face='+fil+',support='+sup+')',
self.commit(translate("draft","Create Wire"),
['pl = FreeCAD.Placement()',
'pl.Rotation.Q = '+rot,
'pl.Base = '+DraftVecUtils.toString(self.node[0]),
'points = '+pts,
'line = Draft.makeWire(points,placement=pl,closed='+str(closed)+',face='+fil+',support='+sup+')',
'Draft.autogroup(line)'])
Creator.finish(self)
if self.ui:
Expand Down

0 comments on commit 684b4ab

Please sign in to comment.