Skip to content
Permalink
Browse files

Draft: Fixed wrong Placement of Draft Wire - fixes #3558

  • Loading branch information...
yorikvanhavre committed Nov 1, 2018
1 parent e4b1cfc commit 684b4ab03a27231e0cc603ca815bf9ea367fd0b9
Showing with 11 additions and 5 deletions.
  1. +5 −2 src/Mod/Draft/Draft.py
  2. +6 −3 src/Mod/Draft/DraftTools.py
@@ -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
@@ -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:

0 comments on commit 684b4ab

Please sign in to comment.
You can’t perform that action at this time.