From c8d2f9a82aaa0433e9db8ceb2b31ee15eeb4e033 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Mon, 28 Mar 2011 16:40:07 -0400 Subject: [PATCH] update constraint types to take point indexes --- Connect.py | 9 +++++++++ Distance.py | 11 +++++++++++ DistanceConstraint.py | 10 ---------- Horizontal.py | 7 +++++-- Vertical.py | 7 +++++-- 5 files changed, 30 insertions(+), 14 deletions(-) create mode 100644 Connect.py create mode 100644 Distance.py delete mode 100644 DistanceConstraint.py diff --git a/Connect.py b/Connect.py new file mode 100644 index 0000000..50104d9 --- /dev/null +++ b/Connect.py @@ -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 diff --git a/Distance.py b/Distance.py new file mode 100644 index 0000000..7a26173 --- /dev/null +++ b/Distance.py @@ -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 diff --git a/DistanceConstraint.py b/DistanceConstraint.py deleted file mode 100644 index 3854d6e..0000000 --- a/DistanceConstraint.py +++ /dev/null @@ -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 diff --git a/Horizontal.py b/Horizontal.py index 4bd47f5..d8a9ae6 100644 --- a/Horizontal.py +++ b/Horizontal.py @@ -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 diff --git a/Vertical.py b/Vertical.py index 42a1d65..58b8d34 100644 --- a/Vertical.py +++ b/Vertical.py @@ -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