split Fix into XFix/YFix constraints
This commit is contained in:
parent
5dd89c2cc9
commit
2200460b56
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
from Constraint import Constraint
|
from Constraint import Constraint
|
||||||
|
|
||||||
class Fix(Constraint):
|
class XFix(Constraint):
|
||||||
def __init__(self, shape, pt, val):
|
def __init__(self, shape, pt, val):
|
||||||
self.shape = shape
|
self.shape = shape
|
||||||
self.pt = pt
|
self.pt = pt
|
15
YFix.py
Normal file
15
YFix.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
from Constraint import Constraint
|
||||||
|
|
||||||
|
class YFix(Constraint):
|
||||||
|
def __init__(self, shape, pt, val):
|
||||||
|
self.shape = shape
|
||||||
|
self.pt = pt
|
||||||
|
self.val = val
|
||||||
|
|
||||||
|
def toEqu(self):
|
||||||
|
varrefs1 = self.shape.toEqu(self.pt)[1]
|
||||||
|
coeffs = []
|
||||||
|
for i in range(len(varrefs1)):
|
||||||
|
coeffs.append((varrefs1[i], (self.shape, i)))
|
||||||
|
return [(coeffs, -self.val)]
|
Loading…
x
Reference in New Issue
Block a user