[Bprocessor-commit] facade/src/net/sourceforge/bprocessor/facade/modellor NetFacadeModellor.java,
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Nordholt <nor...@us...> - 2007-03-29 14:01:53
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32449/src/net/sourceforge/bprocessor/facade/modellor Modified Files: NetFacadeModellor.java Log Message: now uses the geometry simplifying of the Geometry class Index: NetFacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/NetFacadeModellor.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** NetFacadeModellor.java 19 Mar 2007 12:39:45 -0000 1.23 --- NetFacadeModellor.java 29 Mar 2007 14:01:52 -0000 1.24 *************** *** 318,323 **** */ private void regenerate() { ! space.clear(); ! frame = null; space.add(getNet()); prepareNet(getNet()); --- 318,326 ---- */ private void regenerate() { ! if (frame != null) { ! frame.clear(); ! frame = null; ! } ! space.clear(); space.add(getNet()); prepareNet(getNet()); *************** *** 406,411 **** frame.removeSurface(cut1); frame.removeSurface(cut2); ! space.addAll(frame1); ! space.addAll(frame2); } } --- 409,422 ---- frame.removeSurface(cut1); frame.removeSurface(cut2); ! frame1.addAll(frame2); ! space.addAll(frame1); ! frame1.removeAll(Geometry.deleteRedundantSurfaces(frame1)); ! Geometry.allPossibleCollapses(Geometry.collect(frame1)); ! space.addAll(Geometry.mergeAllPossibleSurfaces(frame1)); ! Set<Edge> edges = new HashSet<Edge>(); ! for (Surface s : frame1) { ! edges.addAll(s.getEdges()); ! } ! Geometry.extendAllPossibleEdges(edges); } } *************** *** 436,440 **** Surface frameSurface = new Surface(outlineCopies); frameSurface = space.insert(frameSurface); ! assignSame(front, frameSurface, space, frame); Set sides1 = new HashSet(); Surface frameSurfEx = extrudeIntoSpace(frameSurface, depth, sides1); --- 447,451 ---- Surface frameSurface = new Surface(outlineCopies); frameSurface = space.insert(frameSurface); ! Geometry.assignSame(front, frameSurface, space, frame); Set sides1 = new HashSet(); Surface frameSurfEx = extrudeIntoSpace(frameSurface, depth, sides1); *************** *** 466,470 **** true); space.add(holeSpace); ! assignSame(front, hole, space, holeSpace); Geometry.holeAnalysis(hole); --- 477,481 ---- true); space.add(holeSpace); ! Geometry.assignSame(front, hole, space, holeSpace); Geometry.holeAnalysis(hole); *************** *** 518,523 **** space.add(g); space.add(f); ! assignSame(front, in, space, f); ! assignSame(front, out, space, g); hole.getExterior().removeHole(hole); --- 529,534 ---- space.add(g); space.add(f); ! Geometry.assignSame(front, in, space, f); ! Geometry.assignSame(front, out, space, g); hole.getExterior().removeHole(hole); *************** *** 533,537 **** Surface inEx = extrudeIntoSpace(in, FRAME_DEPTH, sides); space.add(inEx); ! assignSame(front, inEx, space, frame); Geometry.holeAnalysis(inEx); --- 544,548 ---- Surface inEx = extrudeIntoSpace(in, FRAME_DEPTH, sides); space.add(inEx); ! Geometry.assignSame(front, inEx, space, frame); Geometry.holeAnalysis(inEx); *************** *** 714,740 **** /** - * Assign space sp2 to the same side of s2 as space sp1 is assigned to s1 - * @param s1 first surface - * @param s2 second surface - * @param sp1 first space - * @param sp2 second space - */ - private void assignSame(Surface s1, Surface s2, Space sp1, Space sp2) { - if (s1.getFrontDomain() == sp1) { - if (s1.normal().dot(s2.normal()) > 0) { - s2.setFrontDomain(sp2); - } else { - s2.setBackDomain(sp2); - } - } else if (s1.getBackDomain() == sp1) { - if (s1.normal().dot(s2.normal()) > 0) { - s2.setBackDomain(sp2); - } else { - s2.setFrontDomain(sp2); - } - } - } - - /** * Assign space sp2 to the opposite side of s2 as space sp1 is assigned to s1 * @param s1 first surface --- 725,728 ---- *************** *** 746,750 **** Space back = s2.getBackDomain(); Space front = s2.getFrontDomain(); ! assignSame(s1, s2, sp1, sp2); if (s2.getBackDomain() == sp2) { s2.setBackDomain(back); --- 734,738 ---- Space back = s2.getBackDomain(); Space front = s2.getFrontDomain(); ! Geometry.assignSame(s1, s2, sp1, sp2); if (s2.getBackDomain() == sp2) { s2.setBackDomain(back); *************** *** 945,951 **** new Vertex(0 , 0, -length / 2)); Set surfaces = new HashSet(); surfaces.add(copy); ! copy.extrusionAllOnto(topPlane, surfaces, surfaces); ! copy.extrusionAllOnto(bottomPlane, surfaces, surfaces); Set<Vertex> verts = Geometry.collect(surfaces); for (Vertex v : verts) { --- 933,947 ---- new Vertex(0 , 0, -length / 2)); Set surfaces = new HashSet(); + Set tops = new HashSet(); surfaces.add(copy); ! copy.extrusionAllOnto(topPlane, surfaces, tops); ! copy.extrusionAllOnto(bottomPlane, surfaces, tops); ! Iterator it = tops.iterator(); ! while (it.hasNext()) { ! Surface top = (Surface)it.next(); ! top.setFrontDomain(cut.getFrontDomain()); ! top.setBackDomain(cut.getBackDomain()); ! } ! surfaces.addAll(tops); Set<Vertex> verts = Geometry.collect(surfaces); for (Vertex v : verts) { |