update constraint types to take point indexes

This commit is contained in:
Josh Holtrop committed 2011-03-28 16:40:07 -04:00
1 parent cc3831e235
commit c8d2f9a82a
5 files changed
+30 -14

No files matched your search

+9
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
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
-10
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
+5 -2
View File
@@ -2,5 +2,8 @@
from Constraint import Constraint from Constraint import Constraint
class Horizontal(Constraint): class Horizontal(Constraint):
def __init__(self, shape): def __init__(self, shape1, pt1, shape2, pt2):
self.shape = shape self.shape1 = shape1
self.pt1 = pt1
self.shape2 = shape2
self.pt2 = pt2
+5 -2
View File
@@ -2,5 +2,8 @@
from Constraint import Constraint from Constraint import Constraint
class Vertical(Constraint): class Vertical(Constraint):
def __init__(self, shape): def __init__(self, shape1, pt1, shape2, pt2):
self.shape = shape self.shape1 = shape1
self.pt1 = pt1
self.shape2 = shape2
self.pt2 = pt2