add Fix constraint to fix a coordinate to a value
This commit is contained in:
parent
9c2bb94603
commit
5dd89c2cc9
15
Fix.py
Normal file
15
Fix.py
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
from Constraint import Constraint
|
||||
|
||||
class Fix(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)[0]
|
||||
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