Draft: Fixed wrong Placement of Draft Wire - fixes #3558
This commit is contained in:
@@ -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 @@ class Line(Creator):
|
||||
# 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:
|
||||
|
||||
Reference in New Issue
Block a user