diff options
author | pmoxhay <pmoxhay@earthlink.net> | 2009-03-03 12:42:43 (GMT) |
---|---|---|
committer | pmoxhay <pmoxhay@earthlink.net> | 2009-03-03 12:42:43 (GMT) |
commit | cd1665e5cb7d434893fb4de9315addd20a0b028f (patch) | |
tree | 2dd9ff6014a66852fa260663ab53918e8322a3e3 /shapeobject.py | |
parent | 4684498585d38d95bbc97fd2ffc2e279fef87bfd (diff) |
First working example of comparing areas by cutting.
Diffstat (limited to 'shapeobject.py')
-rw-r--r-- | shapeobject.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/shapeobject.py b/shapeobject.py index 5c7322f..4093c40 100644 --- a/shapeobject.py +++ b/shapeobject.py @@ -72,6 +72,9 @@ class ShapeObject(MovableObject): p1 = self.points[i]
p2 = self.points[(i+1) % len(self.points)]
self.area += (p1.x*p2.y - p2.x*p1.y)/2
+
+ # Need to take absolute value?
+ #self.area = abs(self.area)
# Calculate the centroid (center of mass).
self.centroid = Vector(1, 1)
@@ -247,5 +250,4 @@ class ShapeObject(MovableObject): self.calculate_bounds()
self.container.queue_draw()
-
-
+
\ No newline at end of file |