[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Geometry.java,1.8,1.9
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2005-12-22 11:20:10
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14045/src/net/sourceforge/bprocessor/model Modified Files: Geometry.java Log Message: Splitting bug Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Geometry.java 20 Dec 2005 12:23:14 -0000 1.8 --- Geometry.java 22 Dec 2005 11:19:57 -0000 1.9 *************** *** 161,169 **** Set fromSurfaces = from.getSurfaces(); Set toSurfaces = to.getSurfaces(); Iterator it = fromSurfaces.iterator(); while (it.hasNext()) { Surface current = (Surface) it.next(); if (toSurfaces.contains(current)) { ! exterior = current; } } --- 161,197 ---- Set fromSurfaces = from.getSurfaces(); Set toSurfaces = to.getSurfaces(); + Set shared = new HashSet(); Iterator it = fromSurfaces.iterator(); while (it.hasNext()) { Surface current = (Surface) it.next(); if (toSurfaces.contains(current)) { ! shared.add(current); ! } ! } ! if (shared.size() == 1) { ! exterior = (Surface) shared.iterator().next(); ! } else { ! Iterator iter = shared.iterator(); ! while (iter.hasNext() && (exterior == null)) { ! Surface currentSurface = (Surface) iter.next(); ! if (edges.size() > 1) { ! Vertex currentVertex = first.otherVertex(from); ! int currentIndex = 1; ! Edge currentEdge = (Edge) edges.get(currentIndex); ! boolean outside = false; ! while ((currentVertex != to) && !outside) { ! outside = !currentSurface.surrounds(currentVertex); ! currentVertex = currentEdge.otherVertex(currentVertex); ! currentIndex++; ! if (currentIndex < edges.size()) { ! currentEdge = (Edge) edges.get(currentIndex); ! } else { ! currentEdge = null; ! } ! } ! if (!outside) { ! exterior = currentSurface; ! } ! } } } |