update constraint types to take point indexes

This commit is contained in:
Josh Holtrop 2011-03-28 16:40:07 -04:00
parent cc3831e235
commit c8d2f9a82a
5 changed files with 30 additions and 14 deletions

9
Connect.py Normal file
View File

@ -0,0 +1,9 @@
from Constraint import Constraint
class Connect(Constraint):
def __init__(self, shape1, pt1, shape2, pt2):
self.shape1 = shape1
self.pt1 = pt1
self.shape2 = shape2
self.pt2 = pt2

11
Distance.py Normal file
View File

@ -0,0 +1,11 @@
from Constraint import Constraint
class Distance(Constraint):
def __init__(self, shape1, pt1, shape2, pt2, direction, dist):
self.shape1 = shape1
self.pt1 = pt1
self.shape2 = shape2
self.pt2 = pt2
self.dist = dist
self.direction = direction

View File

@ -1,10 +0,0 @@
from Constraint import Constraint
class DistanceConstraint(Constraint):
def __init__(self, shape1, attr1, shape2, attr2, dist):
self.shape1 = shape1
self.shape2 = shape2
self.attr1 = attr1
self.attr2 = attr2
self.dist = dist

View File

@ -2,5 +2,8 @@
from Constraint import Constraint
class Horizontal(Constraint):
def __init__(self, shape):
self.shape = shape
def __init__(self, shape1, pt1, shape2, pt2):
self.shape1 = shape1
self.pt1 = pt1
self.shape2 = shape2
self.pt2 = pt2

View File

@ -2,5 +2,8 @@
from Constraint import Constraint
class Vertical(Constraint):
def __init__(self, shape):
self.shape = shape
def __init__(self, shape1, pt1, shape2, pt2):
self.shape1 = shape1
self.pt1 = pt1
self.shape2 = shape2
self.pt2 = pt2