Draft: removed unnecessary uses of DraftVecUtils

This commit is contained in:
Yorik van Havre
2013-07-30 16:48:28 -03:00
parent 8b75c6a206
commit b3f79881c5
11 changed files with 98 additions and 95 deletions

View File

@@ -362,9 +362,9 @@ def getCutVolume(cutplane,shapes):
wm1 = DraftVecUtils.project(dv,ax).Length
wm = max(wm,wm1)
vu = DraftVecUtils.scaleTo(u,um)
vui = DraftVecUtils.neg(vu)
vui = vu.negative()
vv = DraftVecUtils.scaleTo(v,vm)
vvi = DraftVecUtils.neg(vv)
vvi = vv.negative()
p1 = ce.add(vu.add(vvi))
p2 = ce.add(vu.add(vv))
p3 = ce.add(vui.add(vv))
@@ -373,7 +373,7 @@ def getCutVolume(cutplane,shapes):
cutface = Part.Face(cutface)
cutnormal = DraftVecUtils.scaleTo(ax,wm)
cutvolume = cutface.extrude(cutnormal)
cutnormal = DraftVecUtils.neg(cutnormal)
cutnormal = cutnormal.negative()
invcutvolume = cutface.extrude(cutnormal)
return cutface,cutvolume,invcutvolume
@@ -459,7 +459,7 @@ def removeShape(objs,mark=True):
length = dims[1]
width = dims[2]
v1 = Vector(length/2,0,0)
v2 = DraftVecUtils.neg(v1)
v2 = v1.negative()
v1 = dims[0].multVec(v1)
v2 = dims[0].multVec(v2)
line = Draft.makeLine(v1,v2)

View File

@@ -308,8 +308,8 @@ class Component:
n = f.normalAt(0,0)
v1 = DraftVecUtils.scaleTo(n,width*1.1) # we extrude a little more to avoid face-on-face
f.translate(v1)
v2 = DraftVecUtils.neg(v1)
v2 = DraftVecUtils.scale(v1,-2)
v2 = v1.negative()
v2 = v1.multiply(-2)
f = f.extrude(v2)
if plac:
f.Placement = plac

View File

@@ -227,7 +227,7 @@ class _CommandWall:
elif self.Align == "Left":
self.tracker.update([b.add(dv),point.add(dv)])
else:
dv = DraftVecUtils.neg(dv)
dv = dv.negative()
self.tracker.update([b.add(dv),point.add(dv)])
if self.Length:
self.Length.setValue(bv.Length)
@@ -417,14 +417,14 @@ class _Wall(ArchComponent.Component):
sh = DraftGeomUtils.bind(w1,w2)
elif obj.Align == "Right":
dvec = dvec.multiply(width)
dvec = DraftVecUtils.neg(dvec)
dvec = dvec.negative()
w2 = DraftGeomUtils.offsetWire(wire,dvec)
w1 = Part.Wire(DraftGeomUtils.sortEdges(wire.Edges))
sh = DraftGeomUtils.bind(w1,w2)
elif obj.Align == "Center":
dvec = dvec.multiply(width/2)
w1 = DraftGeomUtils.offsetWire(wire,dvec)
dvec = DraftVecUtils.neg(dvec)
dvec = dvec.negative()
w2 = DraftGeomUtils.offsetWire(wire,dvec)
sh = DraftGeomUtils.bind(w1,w2)
# fixing self-intersections