Thread: [Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Surface.java, 1.184, 1.185
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2007-10-01 13:26:31
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32445/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Removed space assignment from push/pull and fixed error when trying to extrude a hole by itself. Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.184 retrieving revision 1.185 diff -C2 -d -r1.184 -r1.185 *** Surface.java 28 Sep 2007 14:09:00 -0000 1.184 --- Surface.java 1 Oct 2007 13:26:22 -0000 1.185 *************** *** 713,732 **** for (int i = 0; i < n; i++) { if (delta < 0) { ! facemap[i].setBackDomain(getBackDomain()); if (exterior != null && inside) { if (flip) { ! facemap[i].setFrontDomain(exterior.getFrontDomain()); } else { ! facemap[i].setFrontDomain(exterior.getBackDomain()); } } } else { ! facemap[i].setFrontDomain(getFrontDomain()); if (exterior != null && inside) { if (flip) { ! facemap[i].setBackDomain(exterior.getBackDomain()); } else { ! facemap[i].setBackDomain(exterior.getFrontDomain()); } } --- 713,736 ---- for (int i = 0; i < n; i++) { + Surface s = facemap[i]; + if (s == null) { + continue; + } if (delta < 0) { ! s.setBackDomain(getBackDomain()); if (exterior != null && inside) { if (flip) { ! s.setFrontDomain(exterior.getFrontDomain()); } else { ! s.setFrontDomain(exterior.getBackDomain()); } } } else { ! s.setFrontDomain(getFrontDomain()); if (exterior != null && inside) { if (flip) { ! s.setBackDomain(exterior.getBackDomain()); } else { ! s.setBackDomain(exterior.getFrontDomain()); } } *************** *** 865,881 **** /** - * A method for controlled extrusion (like a push/pull tool) - * @param delta The distance to extrude - * @param sides Pass a list for the created surfaces - * @param v2dir Pass a vertex to direction map for the extrusion - * @return The resulting top surface - */ - public Surface extrusionControlled(double delta, Set<Surface> sides, - Map<Vertex, Direction> v2dir) { - return extrudeControlled(delta, sides, new HashMap<Edge, Edge>(), - new HashMap<Vertex, Edge>(), new HashMap<Edge, Surface>(), v2dir); - } - - /** * @param p the plane to extrude onto * @param sides the collection of all resulting side surfaces --- 869,872 ---- *************** *** 1008,1012 **** return top; } ! /** * Make the new vertices, edges and surfaces for extrusion --- 999,1016 ---- return top; } ! ! /** ! * A method for controlled extrusion (like a push/pull tool) ! * @param delta The distance to extrude ! * @param sides Pass a list for the created surfaces ! * @param v2dir Pass a vertex to direction map for the extrusion ! * @return The resulting top surface ! */ ! public Surface extrusionControlled(double delta, Set<Surface> sides, ! Map<Vertex, Direction> v2dir) { ! return extrudeControlled(delta, true, sides, new HashMap<Edge, Edge>(), ! new HashMap<Vertex, Edge>(), new HashMap<Edge, Surface>(), v2dir); ! } ! /** * Make the new vertices, edges and surfaces for extrusion *************** *** 1019,1023 **** * @return The top in the extruded surface */ ! public Surface extrudeControlled(double delta, Set<Surface> sides, Map<Edge, Edge> e2e, Map<Vertex, Edge> v2e, Map<Edge, Surface> e2s, Map<Vertex, Direction> v2dir) { Vertex normal = normal(); --- 1023,1027 ---- * @return The top in the extruded surface */ ! public Surface extrudeControlled(double delta, boolean isRootExtrusion, Set<Surface> sides, Map<Edge, Edge> e2e, Map<Vertex, Edge> v2e, Map<Edge, Surface> e2s, Map<Vertex, Direction> v2dir) { Vertex normal = normal(); *************** *** 1045,1049 **** for (Surface hole : getHoles()) { ! sides.add(hole.extrudeControlled(delta, sides, e2e, v2e, e2s, v2dir)); } --- 1049,1053 ---- for (Surface hole : getHoles()) { ! sides.add(hole.extrudeControlled(delta, false, sides, e2e, v2e, e2s, v2dir)); } *************** *** 1054,1058 **** max = 0; } ! if (isVertexBounded(v[i])) { if (v2dir.containsKey(v[i])) { Direction d = (Direction)v2dir.get(v[i]); --- 1058,1062 ---- max = 0; } ! if (isVertexBounded(v[i]) || (isRootExtrusion && isInner())) { if (v2dir.containsKey(v[i])) { Direction d = (Direction)v2dir.get(v[i]); *************** *** 1064,1068 **** } } else { ! // We just have to move the existing surface makeNewTop = false; Collection<Edge> connected = v[i].getEdges(); --- 1068,1072 ---- } } else { ! // We just have to move the existing point makeNewTop = false; Collection<Edge> connected = v[i].getEdges(); *************** *** 1209,1213 **** top = this; } ! // FIXME should return the sides instead of assigning // spaces here. --- 1213,1220 ---- top = this; } ! if (AUTOMATIC) { ! assignSpaceForExtrusion(delta, n, facemap, top); ! } ! /* // FIXME should return the sides instead of assigning // spaces here. *************** *** 1256,1260 **** top.setFrontDomain(getFrontDomain()); } ! } return top; --- 1263,1267 ---- top.setFrontDomain(getFrontDomain()); } ! }*/ return top; |