Thread: [Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Surface.java,1.23,1.24
Status: Pre-Alpha
Brought to you by:
henryml
From: Nordholt <nor...@us...> - 2005-09-20 18:22:57
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21843 Modified Files: Surface.java Log Message: fixed stackoverflow i move method Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Surface.java 20 Sep 2005 12:34:52 -0000 1.23 --- Surface.java 20 Sep 2005 18:22:49 -0000 1.24 *************** *** 249,253 **** */ public void move(double dx, double dy, double dz) { ! { List vertices = getVertices(); Vertex v0 = (Vertex) vertices.get(0); --- 249,253 ---- */ public void move(double dx, double dy, double dz) { ! { List vertices = getVertices(); Vertex v0 = (Vertex) vertices.get(0); *************** *** 261,265 **** } } ! { if (getInnerSurfaces() != null) { Iterator iter = getInnerSurfaces().iterator(); --- 261,265 ---- } } ! { if (getInnerSurfaces() != null) { Iterator iter = getInnerSurfaces().iterator(); *************** *** 283,287 **** if (innerSurf.equals(this)) { if (!containedCheck(this, surf)) { ! this.move(-dx, -dy, -dz); } } --- 283,309 ---- if (innerSurf.equals(this)) { if (!containedCheck(this, surf)) { ! //The inner surface has been moved out of its outer surface ! //this can not happen so here we move the inner surface back ! { ! List vertices = getVertices(); ! Vertex v0 = (Vertex) vertices.get(0); ! v0.move(-dx, -dy, -dz); ! Iterator iter = vertices.iterator(); ! while (iter.hasNext()) { ! Vertex vertex = (Vertex) iter.next(); ! if (vertex != v0) { ! vertex.move(-dx, -dy, -dz); ! } ! } ! } ! { ! if (getInnerSurfaces() != null) { ! Iterator iter = getInnerSurfaces().iterator(); ! while (iter.hasNext()) { ! Surface surface = (Surface) iter.next(); ! surface.move(-dx, -dy, -dz); ! } ! } ! } } } *************** *** 306,309 **** --- 328,332 ---- *at a time. */ + //log.info("contained check"); List holeEdges = hole.getEdges(); Iterator holeIt = holeEdges.iterator(); *************** *** 333,336 **** --- 356,360 ---- */ private boolean crossingNumbers(Edge edge, Surface surf) { + //log.info("crossing numbers"); List surfEdges = surf.getEdges(); Iterator surfIt = surfEdges.iterator(); *************** *** 358,362 **** --- 382,395 ---- double tHole = holeDet / denominator; double epsilon = 0.00001; + //log.info("1st ineq: " + (Math.abs((surfOr.getX() + surfDir.getX() * tSurf) - + // (holeOr.getX() + holeDir.getX() * tHole)))); + //log.info("2st ineq: " + (Math.abs((surfOr.getY() + surfDir.getY() * tSurf) - + //(holeOr.getY() + holeDir.getY() * tHole)))); + //log.info("3st ineq: " + (Math.abs((surfOr.getZ() + surfDir.getZ() * tSurf) - + // (holeOr.getZ() + holeDir.getZ() * tHole)))); //checking if there is an intersection and if it is within the line segments + //log.info("X: " + surfOr.getX() + "::" + holeOr.getX()); + //log.info("Y: " + surfOr.getY() + "::" + holeOr.getY()); + //log.info("Z: " + surfOr.getZ() + "::" + holeOr.getZ()); if ((tSurf > 0) && (tHole > 0) && (Math.abs((surfOr.getX() + surfDir.getX() * tSurf) - *************** *** 370,373 **** --- 403,407 ---- < epsilon)) { //the parameters for the "from" point on the edges + //log.info("Intersection"); double tSurfFrom = 0; double tHoleFrom = 0; *************** *** 390,396 **** log.warn("inner surface edge has a zero vector direction vector"); } ! if (tHoleFrom > tHole) { contained = false; } else if (tSurfFrom >= tSurf) { crossings++; } --- 424,432 ---- log.warn("inner surface edge has a zero vector direction vector"); } ! if (tHoleFrom > tHole && tSurfFrom >= tSurf) { ! //log.info("not count base"); contained = false; } else if (tSurfFrom >= tSurf) { + //log.info("Count: " + crossings); crossings++; } *************** *** 399,402 **** --- 435,439 ---- } if (crossings % 2 == 0) { + //log.info("count based"); contained = false; } |