filled out Horizontal and Vertical toEqu() methods
This commit is contained in:
parent
c8d2f9a82a
commit
c13fc5ad93
@ -7,3 +7,13 @@ class Horizontal(Constraint):
|
||||
self.pt1 = pt1
|
||||
self.shape2 = shape2
|
||||
self.pt2 = pt2
|
||||
|
||||
def toEqu(self):
|
||||
varrefs1 = self.shape1.toEqu(pt1)[1]
|
||||
varrefs2 = self.shape2.toEqu(pt2)[1]
|
||||
coeffs = []
|
||||
for i in range(len(varrefs1)):
|
||||
coeffs.append((1 * varrefs1[i], (self.shape1, i)))
|
||||
for i in range(len(varrefs2)):
|
||||
coeffs.append((-1 * varrefs2[i], (self.shape2, i))
|
||||
return [(coeffs, 0)]
|
||||
|
10
Vertical.py
10
Vertical.py
@ -7,3 +7,13 @@ class Vertical(Constraint):
|
||||
self.pt1 = pt1
|
||||
self.shape2 = shape2
|
||||
self.pt2 = pt2
|
||||
|
||||
def toEqu(self):
|
||||
varrefs1 = self.shape1.toEqu(pt1)[0]
|
||||
varrefs2 = self.shape2.toEqu(pt2)[0]
|
||||
coeffs = []
|
||||
for i in range(len(varrefs1)):
|
||||
coeffs.append((1 * varrefs1[i], (self.shape1, i)))
|
||||
for i in range(len(varrefs2)):
|
||||
coeffs.append((-1 * varrefs2[i], (self.shape2, i))
|
||||
return [(coeffs, 0)]
|
||||
|
Loading…
x
Reference in New Issue
Block a user