From f908d1695096c9708b9750e4b1f310f2211eb71f Mon Sep 17 00:00:00 2001 From: Andrew Lawson Date: Wed, 10 Dec 2014 14:05:24 -0500 Subject: [PATCH] Some fixes. --- geometric_separators.pde | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/geometric_separators.pde b/geometric_separators.pde index 8b142b9..da78d7e 100644 --- a/geometric_separators.pde +++ b/geometric_separators.pde @@ -72,7 +72,6 @@ PVector getRadonPoint(ArrayList points) { PVector radonPoint = null; radonPoint = inTetrahedron(points); if (radonPoint == null) { - System.out.println("Intersect"); radonPoint = intersectTri(points); } return radonPoint; @@ -182,7 +181,6 @@ PVector testIntersect(PVector t1, PVector t2, PVector t3, PVector r1, PVector r2 float r = x / y; // No intersection if (r < 0) { - System.out.println("No intersect."); return null; } rayDir.mult(r); @@ -201,15 +199,12 @@ PVector testIntersect(PVector t1, PVector t2, PVector t3, PVector r1, PVector r2 float t = ((abDot * waDot) - (aDot * wbDot)) / d; // Check if the point is outside if (s < 0 || s > 1) { - System.out.println("Outside."); return null; } else if (t < 0 || (s + t) > 1) { - System.out.println("Outside."); return null; } // Otherwise it's inside we can return it - System.out.println("Inside"); return point; } @@ -329,6 +324,20 @@ PVector approxCenterpoint(ArrayList input) { // Draw void draw() { background(255); + // Draw center point + if (centerPoint != null) { + stroke(255, 0, 0); + strokeWeight(6); + point(centerPoint.x, centerPoint.y); + stroke(0); + System.out.println("x-coordinate: " + Float.toString(centerPoint.x)); + System.out.println("y-coordinate: " + Float.toString(centerPoint.y)); + } + // Draw separator sphere projected to 2D + if (sphere != null) { + strokeWeight(6); + shape(sphere); + } shape(reset); shape(calculate); fill(50); @@ -343,16 +352,4 @@ void draw() { point(point.x, point.y); strokeWeight(2); } - // Draw center point - if (centerPoint != null) { - strokeWeight(6); - point(centerPoint.x, centerPoint.y); - System.out.println("x-coordinate: " + Float.toString(centerPoint.x)); - System.out.println("y-coordinate: " + Float.toString(centerPoint.y)); - } - // Draw separator sphere projected to 2D - if (sphere != null) { - strokeWeight(6); - shape(sphere); - } }