Draft: more coherent rectangle creation
This commit is contained in:
parent
700ed333d9
commit
93262e98b4
|
@ -919,8 +919,6 @@ class Rectangle(Creator):
|
||||||
try:
|
try:
|
||||||
# building command string
|
# building command string
|
||||||
rot,sup,pts,fil = self.getStrings()
|
rot,sup,pts,fil = self.getStrings()
|
||||||
if Draft.getParam("UsePartPrimitives",False):
|
|
||||||
# Use Part Primitive
|
|
||||||
base = p1
|
base = p1
|
||||||
if length < 0:
|
if length < 0:
|
||||||
length = -length
|
length = -length
|
||||||
|
@ -928,6 +926,8 @@ class Rectangle(Creator):
|
||||||
if height < 0:
|
if height < 0:
|
||||||
height = -height
|
height = -height
|
||||||
base = base.add((p1.sub(p2)).negative())
|
base = base.add((p1.sub(p2)).negative())
|
||||||
|
if Draft.getParam("UsePartPrimitives",False):
|
||||||
|
# Use Part Primitive
|
||||||
self.commit(translate("draft","Create Plane"),
|
self.commit(translate("draft","Create Plane"),
|
||||||
['plane = FreeCAD.ActiveDocument.addObject("Part::Plane","Plane")',
|
['plane = FreeCAD.ActiveDocument.addObject("Part::Plane","Plane")',
|
||||||
'plane.Length = '+str(length),
|
'plane.Length = '+str(length),
|
||||||
|
@ -941,7 +941,7 @@ class Rectangle(Creator):
|
||||||
self.commit(translate("draft","Create Rectangle"),
|
self.commit(translate("draft","Create Rectangle"),
|
||||||
['pl = FreeCAD.Placement()',
|
['pl = FreeCAD.Placement()',
|
||||||
'pl.Rotation.Q = '+rot,
|
'pl.Rotation.Q = '+rot,
|
||||||
'pl.Base = '+DraftVecUtils.toString(p1),
|
'pl.Base = '+DraftVecUtils.toString(base),
|
||||||
'Draft.makeRectangle(length='+str(length)+',height='+str(height)+',placement=pl,face='+fil+',support='+sup+')'])
|
'Draft.makeRectangle(length='+str(length)+',height='+str(height)+',placement=pl,face='+fil+',support='+sup+')'])
|
||||||
except:
|
except:
|
||||||
print("Draft: error delaying commit")
|
print("Draft: error delaying commit")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user