bprocessor-commit Mailing List for B-processor (Page 51)
Status: Pre-Alpha
Brought to you by:
henryml
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(117) |
Aug
(151) |
Sep
(157) |
Oct
(81) |
Nov
(117) |
Dec
(119) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(183) |
Feb
(130) |
Mar
(117) |
Apr
(61) |
May
(82) |
Jun
(45) |
Jul
(149) |
Aug
(173) |
Sep
(199) |
Oct
(165) |
Nov
(107) |
Dec
(137) |
2007 |
Jan
(124) |
Feb
(58) |
Mar
(123) |
Apr
(80) |
May
(130) |
Jun
(64) |
Jul
(31) |
Aug
(42) |
Sep
(114) |
Oct
(167) |
Nov
(239) |
Dec
(200) |
2008 |
Jan
(43) |
Feb
(43) |
Mar
(4) |
Apr
(9) |
May
(5) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(9) |
Nov
(12) |
Dec
|
2009 |
Jan
|
Feb
(20) |
Mar
(7) |
Apr
(12) |
May
(34) |
Jun
(72) |
Jul
|
Aug
(3) |
Sep
(31) |
Oct
(2) |
Nov
(8) |
Dec
(4) |
2010 |
Jan
(5) |
Feb
(32) |
Mar
(8) |
Apr
(7) |
May
(36) |
Jun
|
Jul
(11) |
Aug
(15) |
Sep
(7) |
Oct
(2) |
Nov
(13) |
Dec
(80) |
2011 |
Jan
|
Feb
|
Mar
(8) |
Apr
(12) |
May
(32) |
Jun
(9) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(8) |
2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: rimestad <rim...@us...> - 2007-10-05 13:30:47
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6186/src/net/sourceforge/bprocessor/model Modified Files: CoordinateSystem.java Edge.java Log Message: Created a alternative offset that follows connected edges and (when alt is pressed) and a version that connects the edgelist if disconected and offset that, afterwards the connecting edge is removed from the extrusion. Modified isinXYplane to make use of plane and work :-) Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** Edge.java 27 Sep 2007 10:50:13 -0000 1.96 --- Edge.java 5 Oct 2007 13:30:49 -0000 1.97 *************** *** 885,889 **** */ public static List<Edge> offset(Collection<Edge> which, Surface inner, double offset) { ! return offset(which, inner.coordinateSystem(), offset, null); } --- 885,889 ---- */ public static List<Edge> offset(Collection<Edge> which, Surface inner, double offset) { ! return offset(which, inner.coordinateSystem(), offset, null, null); } *************** *** 899,903 **** */ public static List<Edge> offset(Collection<Edge> which, CoordinateSystem inner, double offset) { ! return offset(which, inner, offset, null); } --- 899,903 ---- */ public static List<Edge> offset(Collection<Edge> which, CoordinateSystem inner, double offset) { ! return offset(which, inner, offset, null, null); } *************** *** 909,916 **** * @param offset The offset size * @param directions The movement directions send a empty list to retrieve direction map * @return The generated list of Edges */ public static List<Edge> offset(Collection<Edge> which, CoordinateSystem inner, ! double offset, Map<Vertex, Direction> directions) { HashSet<Edge> edges = new HashSet<Edge>(which); ArrayList<Edge> res = new ArrayList<Edge>(); --- 909,917 ---- * @param offset The offset size * @param directions The movement directions send a empty list to retrieve direction map + * @param e2e Pass a empty map and you will get a map from old to offset edges * @return The generated list of Edges */ public static List<Edge> offset(Collection<Edge> which, CoordinateSystem inner, ! double offset, Map<Vertex, Direction> directions, Map<Edge, Edge> e2e) { HashSet<Edge> edges = new HashSet<Edge>(which); ArrayList<Edge> res = new ArrayList<Edge>(); *************** *** 918,921 **** --- 919,925 ---- directions = new HashMap<Vertex, Direction>(); } + if (e2e == null) { + e2e = new HashMap<Edge, Edge>(); + } HashMap<Vertex, Edge> to2edge = new HashMap<Vertex, Edge>(); HashMap<Vertex, Edge> from2edge = new HashMap<Vertex, Edge>(); *************** *** 944,948 **** v2v.put(to, e.getTo()); v2v.put(from, e.getFrom()); ! res.add(new Edge(from, to)); } if (prevEdge != null) { --- 948,954 ---- v2v.put(to, e.getTo()); v2v.put(from, e.getFrom()); ! Edge newE = new Edge(from, to); ! e2e.put(e, newE); ! res.add(newE); } if (prevEdge != null) { *************** *** 994,998 **** if (e2 == null) { for (Edge connected : work.getEdges()) { - Vertex newdirection = dir1; if (connected != e1 && inner.isInXYPlane(connected)) { e2 = connected; --- 1000,1003 ---- Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** CoordinateSystem.java 2 Oct 2007 12:37:56 -0000 1.57 --- CoordinateSystem.java 5 Oct 2007 13:30:49 -0000 1.58 *************** *** 81,85 **** return isInXYPlane(e.getFrom()) & isInXYPlane(e.getTo()); } else if (g instanceof Vertex) { ! return this.translate((Vertex)g).getZ() == 0.0; } else if (g instanceof Surface) { for (Vertex v : ((Surface)g).getVertices()) { --- 81,85 ---- return isInXYPlane(e.getFrom()) & isInXYPlane(e.getTo()); } else if (g instanceof Vertex) { ! return this.plane().contains((Vertex)g); } else if (g instanceof Surface) { for (Vertex v : ((Surface)g).getVertices()) { |
From: rimestad <rim...@us...> - 2007-10-05 13:30:43
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv6172/src/net/sourceforge/bprocessor/gl/tool Modified Files: OffsetTool.java Log Message: Created a alternative offset that follows connected edges and (when alt is pressed) and a version that connects the edgelist if disconected and offset that, afterwards the connecting edge is removed from the extrusion. Modified isinXYplane to make use of plane and work :-) Index: OffsetTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OffsetTool.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** OffsetTool.java 5 Oct 2007 09:08:14 -0000 1.19 --- OffsetTool.java 5 Oct 2007 13:30:43 -0000 1.20 *************** *** 67,70 **** --- 67,72 ---- private Edge guide; + private boolean altIsDown; + /** * Constructor fo OffsetTool *************** *** 83,86 **** --- 85,89 ---- edgePoint = null; edge = null; + altIsDown = false; } *************** *** 160,167 **** if (contour.isEmpty()) { if (finalEdgeList.isEmpty()) { ! contour = Edge.offset(offsetSurface.getEdges(), offsetCoord, length, directionMap); } else { ! Collection<Edge> edges = finalEdgeList; ! contour = Edge.offset(edges, offsetCoord, length, directionMap); } Collection<Edge> feedback = new ArrayList<Edge>(contour.size() + 1); --- 163,190 ---- if (contour.isEmpty()) { if (finalEdgeList.isEmpty()) { ! contour = Edge.offset(offsetSurface.getEdges(), offsetCoord, length, directionMap, null); } else { ! Collection<Edge> edges = new ArrayList<Edge>(finalEdgeList); ! Edge extraEdge = null; ! Map<Edge, Edge> e2e = null; ! if (!altIsDown) { ! // Add a invisible edge to guide the offset ! Edge first = finalEdgeList.getFirst(); ! Edge last = finalEdgeList.getLast(); ! Vertex common = Edge.commonVertex(first, last); ! ! if (common == null) { ! Vertex from = first.otherVertex(Edge.commonVertex(first, finalEdgeList.get(1))); ! Vertex to = last.otherVertex(Edge.commonVertex(last, ! finalEdgeList.get(finalEdgeList.size() - 2))); ! extraEdge = new Edge(from, to); ! edges.add(extraEdge); ! } ! e2e = new HashMap<Edge, Edge>(); ! } ! contour = Edge.offset(edges, offsetCoord, length, directionMap, e2e); ! if (extraEdge != null) { ! contour.remove(e2e.get(extraEdge)); ! } } Collection<Edge> feedback = new ArrayList<Edge>(contour.size() + 1); *************** *** 240,243 **** --- 263,271 ---- start = new Intersection(edgePoint, Intersection.EDGE, edge); setTip(secondClickTip()); + if (e.isAltDown()) { + altIsDown = true; + } else { + altIsDown = false; + } updateFeedback(); } *************** *** 254,268 **** updateFeedback(); endOffset(); - /* Vertex lengthVector = start.vertex().minus(current.vertex()); - Vertex projection = outNormal.copy(); - projection.scale(start.vertex().minus(lastOffsetPoint).dot(projection)); - double projectionLength = projection.length(); - double length = lengthVector.length(); - if (projection.dot(outNormal) < 0) { - moveContour(projectionLength - length); - } else { - moveContour(length - projectionLength); - } - endOffset();*/ } } --- 282,285 ---- |
From: rimestad <rim...@us...> - 2007-10-05 09:21:04
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28309/src/net/sourceforge/bprocessor/gl/tool Modified Files: ControlledExtrudeTool.java Log Message: Added same drag possibilities through walls as the normal extrude tool. Tried to make some clever space assignment, but as it is now it only happens when the extrusion is placed and not when it is created. This sould be fixed. Index: ControlledExtrudeTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ControlledExtrudeTool.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ControlledExtrudeTool.java 3 Oct 2007 10:03:50 -0000 1.6 --- ControlledExtrudeTool.java 5 Oct 2007 09:21:06 -0000 1.7 *************** *** 51,54 **** --- 51,56 ---- private double maxExtrude; private double minExtrude; + private Surface topSurface; + private double length; /** *************** *** 78,82 **** protected void moved(MouseEvent e) { glv.getView().makeTarget(null); ! findTarget(e, View.HANDLES); double x = e.getX(); double y = View.getHeight() - e.getY(); --- 80,86 ---- protected void moved(MouseEvent e) { glv.getView().makeTarget(null); ! ArrayList<Surface> starter = new ArrayList<Surface>(); ! starter.add(pressedSurface); ! findTarget(e, starter); double x = e.getX(); double y = View.getHeight() - e.getY(); *************** *** 101,108 **** //Find the plane to extrude to Plane p = null; ! if (target instanceof Surface && !affected.contains(target)) { Surface s = (Surface)target; ! if (Math.abs((Math.abs(s.normal().angle(normal)) - Math.PI / 2)) >= 0.05) { ! p = new Plane(normal.projectOnto(s.normal()), s.getFirstVertex()); } } --- 105,124 ---- //Find the plane to extrude to Plane p = null; ! if (target instanceof Surface) { Surface s = (Surface)target; ! if (affected.contains(s)) { ! Plane tmpP = s.plane(); ! findTarget(e, affected); ! if (target instanceof Surface) { ! Surface sur = (Surface)target; ! double dist = tmpP.distance(sur.getFirstVertex()); ! if (Math.abs(dist) < 0.001) { ! p = sur.plane(); ! } ! } ! } else { ! if (Math.abs((Math.abs(s.normal().angle(normal)) - Math.PI / 2)) >= 0.05) { ! p = new Plane(normal.projectOnto(s.normal()), s.getFirstVertex()); ! } } } *************** *** 114,123 **** // If the extrusion isn't generated generate it Vertex delta = current.vertex().minus(start.vertex()); ! double length = delta.length(); if (delta.angle(normal) > Math.PI / 2) { length *= -1; } ! Surface topSurface = pressedSurface.extrusionControlled(length, extrusion, v2dir); if (topSurface != pressedSurface) { extrusion.add(topSurface); --- 130,139 ---- // If the extrusion isn't generated generate it Vertex delta = current.vertex().minus(start.vertex()); ! length = delta.length(); if (delta.angle(normal) > Math.PI / 2) { length *= -1; } ! topSurface = pressedSurface.extrusionControlled(length, extrusion, v2dir); if (topSurface != pressedSurface) { extrusion.add(topSurface); *************** *** 208,215 **** excluded(new ArrayList()); Mesh m = new Mesh(extrusion); ! owner.insert(m); if (extrusion.isEmpty()) { owner.simplify(); } owner.changed(); Project.getInstance().checkpoint(); --- 224,260 ---- excluded(new ArrayList()); Mesh m = new Mesh(extrusion); ! m = owner.insert(m); if (extrusion.isEmpty()) { owner.simplify(); } + for (Surface s : m.surfaces()) { + if (s.equivalent(pressedSurface)) { + pressedSurface = s; + } else if (s.equivalent(topSurface)) { + topSurface = s; + } + + } + + if (pressedSurface != null) { + if (pressedSurface.getExterior() != null) { + if (length > 0) { + pressedSurface.assignFront(pressedSurface.getBackDomain()); + } else { + pressedSurface.assignBack(pressedSurface.getFrontDomain()); + } + } else { + if (length > 0) { + pressedSurface.assignFront(pressedSurface.getFrontDomain()); + } else { + pressedSurface.assignBack(pressedSurface.getBackDomain()); + } + } + } + if (topSurface != null) { + if (topSurface.getExterior() != null) { + Surface.mergeSpaceAssign(topSurface, topSurface.getExterior(), topSurface); + } + } owner.changed(); Project.getInstance().checkpoint(); *************** *** 244,250 **** --- 289,297 ---- v2dir.clear(); pressedSurface = null; + topSurface = null; dragPlane = null; normal = null; active = false; + length = 0; maxExtrude = Double.POSITIVE_INFINITY; minExtrude = Double.NEGATIVE_INFINITY; |
From: rimestad <rim...@us...> - 2007-10-05 09:15:58
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25966/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Made changes to direction so that direction can be calc. for not self connecting edgelists Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.187 retrieving revision 1.188 diff -C2 -d -r1.187 -r1.188 *** Surface.java 3 Oct 2007 10:01:19 -0000 1.187 --- Surface.java 5 Oct 2007 09:15:54 -0000 1.188 *************** *** 72,81 **** * @return turn direction of the edges with respect to the given coordinate-system */ ! public static int direction(List edges, CoordinateSystem system) { double y = Double.MAX_VALUE; Edge e1 = null; Edge e2 = null; ! Edge previous = (Edge) edges.get(edges.size() - 1); Iterator iter = edges.iterator(); while (iter.hasNext()) { Edge current = (Edge) iter.next(); --- 72,86 ---- * @return turn direction of the edges with respect to the given coordinate-system */ ! public static int direction(List<Edge> edges, CoordinateSystem system) { ! if (edges.size() < 2) { ! log.error("Could not calculate direction for edge list due to its size"); ! return PARALLEL; ! } double y = Double.MAX_VALUE; Edge e1 = null; Edge e2 = null; ! Edge previous = edges.get(0); Iterator iter = edges.iterator(); + iter.next(); while (iter.hasNext()) { Edge current = (Edge) iter.next(); *************** *** 2140,2145 **** */ public static void mergeSpaceAssign(Surface sur1, Surface sur2, Surface onto) { ! Space front = null; ! Space back = null; Vertex n1 = sur1.normal(); Vertex n2 = sur2.normal(); --- 2145,2150 ---- */ public static void mergeSpaceAssign(Surface sur1, Surface sur2, Surface onto) { ! Space front = onto.frontDomain; ! Space back = onto.backDomain; Vertex n1 = sur1.normal(); Vertex n2 = sur2.normal(); |
From: rimestad <rim...@us...> - 2007-10-05 09:08:22
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23250/src/net/sourceforge/bprocessor/gl/tool Modified Files: OffsetTool.java Log Message: Made offsetTool offset the right way... Relies on the fact that a surface can tell if the press point is inside it or not, which can fail Index: OffsetTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OffsetTool.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** OffsetTool.java 27 Sep 2007 10:50:16 -0000 1.18 --- OffsetTool.java 5 Oct 2007 09:08:14 -0000 1.19 *************** *** 14,17 **** --- 14,18 ---- import java.util.ArrayList; import java.util.Collection; + import java.util.Collections; import java.util.HashSet; import java.util.List; *************** *** 110,121 **** outNormal = dir.cross(offsetCoord.getN()); outNormal.normalize(); ! if (offsetSurface != null && current != null) { ! if (offsetSurface.surrounds(current.vertex())) { ! if (outNormal.dot(current.vertex().minus(edgePoint)) > 0) { ! outNormal.scale(-1); } } else { ! if (outNormal.dot(current.vertex().minus(edgePoint)) < 0) { ! outNormal.scale(-1); } } --- 111,142 ---- outNormal = dir.cross(offsetCoord.getN()); outNormal.normalize(); ! if (current != null) { ! if (offsetSurface != null) { ! if (offsetSurface.surrounds(current.vertex())) { ! if (outNormal.dot(current.vertex().minus(edgePoint)) > 0) { ! outNormal.scale(-1); ! } ! } else { ! if (outNormal.dot(current.vertex().minus(edgePoint)) < 0) { ! outNormal.scale(-1); ! } } } else { ! List<Edge> edges = new ArrayList<Edge>(); ! edges.addAll(finalEdgeList); ! Vertex first = Edge.commonVertex(finalEdgeList.get(0), finalEdgeList.get(1)); ! Vertex last = Edge.commonVertex(finalEdgeList.getLast(), ! finalEdgeList.get(finalEdgeList.size() - 2)); ! //edges.add(new Edge(first, last)); ! Surface s = new Surface(edges); ! if (s.surrounds(current.vertex())) { ! if (outNormal.dot(current.vertex().minus(edgePoint)) > 0) { ! outNormal.scale(-1); ! } ! log.debug("Surrounds"); ! } else { ! if (outNormal.dot(current.vertex().minus(edgePoint)) < 0) { ! outNormal.scale(-1); ! } } } *************** *** 147,150 **** --- 168,174 ---- feedback.addAll(contour); feedback.add(guide); + if (log.isDebugEnabled()) { + feedback.add(new Edge(start.vertex(), start.vertex().add(outNormal))); + } feedback(feedback); } else { *************** *** 417,420 **** --- 441,447 ---- offsetCoord = new CoordinateSystem(i, j, n, first.getFrom()); } + if (Surface.direction(finalEdgeList, offsetCoord) == Surface.RIGHT) { + Collections.reverse(finalEdgeList); + } } } |
From: Michael L. <he...@us...> - 2007-10-03 11:19:02
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30221/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Display.java Log Message: glos Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Display.java 3 Oct 2007 10:14:20 -0000 1.19 --- Display.java 3 Oct 2007 11:18:56 -0000 1.20 *************** *** 23,26 **** --- 23,27 ---- import javax.media.opengl.glu.GLUtessellatorCallbackAdapter; + import net.sourceforge.bprocessor.gl.model.GlObject; import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.ClippingPlane; *************** *** 53,56 **** --- 54,58 ---- private static Geometric target; private static Collection<? extends Geometric> extras; + private static Collection<GlObject> glos; private static Grid grid; private static boolean intersecting; *************** *** 216,219 **** --- 218,229 ---- /** + * Sets the glos + * @param value glos + */ + public static void glos(Collection<GlObject> value) { + glos = value; + } + + /** * Sets the extras geometry * @param value Collection of geometrics *************** *** 497,500 **** --- 507,524 ---- } + private static void drawGlos(Collection<GlObject> glos) { + for (GlObject current : glos) { + current.draw(gl); + } + } + + private static void selectGlos(Collection<GlObject> glos) { + for (GlObject current : glos) { + push(current); + current.draw(gl); + pop(); + } + } + private static boolean transparent(Space space) { Project project = Project.getInstance(); *************** *** 769,772 **** --- 793,802 ---- if (selecting()) { + selectGlos(glos); + } else { + drawGlos(glos); + } + + if (selecting()) { selectClips(clips); } Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.241 retrieving revision 1.242 diff -C2 -d -r1.241 -r1.242 *** View.java 3 Oct 2007 10:14:20 -0000 1.241 --- View.java 3 Oct 2007 11:18:56 -0000 1.242 *************** *** 713,716 **** --- 713,717 ---- extras.addAll(tempVertices); Display.extras(extras); + Display.glos(glObjects3D); Display.draw(gld); Display.selecting(false); |
From: rimestad <rim...@us...> - 2007-10-03 11:07:52
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1203/src/net/sourceforge/bprocessor/gl/tool Modified Files: ControlledExtrudeTool.java Log Message: Minor improvement to the min max distance calc. so that it isnt possible to overextrude Index: ControlledExtrudeTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ControlledExtrudeTool.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ControlledExtrudeTool.java 28 Sep 2007 14:08:21 -0000 1.5 --- ControlledExtrudeTool.java 3 Oct 2007 10:03:50 -0000 1.6 *************** *** 132,140 **** for (Vertex v : v2dir.keySet()) { Direction d = v2dir.get(v); ! if (d.upper() < maxExtrude) { ! maxExtrude = d.upper(); } ! if (d.lower() > minExtrude) { ! minExtrude = d.lower(); } } --- 132,143 ---- for (Vertex v : v2dir.keySet()) { Direction d = v2dir.get(v); ! double scalar = d.getDirection().projectOnto(p.normal()).length(); ! double maxval = d.upper() * scalar; ! if (maxval < maxExtrude) { ! maxExtrude = maxval; } ! double minVal = d.lower() * scalar; ! if (minVal > minExtrude) { ! minExtrude = minVal; } } |
From: Michael L. <he...@us...> - 2007-10-03 10:14:18
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5578/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Display.java Log Message: clipping plane selecting Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Display.java 2 Oct 2007 13:04:21 -0000 1.18 --- Display.java 3 Oct 2007 10:14:20 -0000 1.19 *************** *** 24,27 **** --- 24,28 ---- import net.sourceforge.bprocessor.model.Camera; + import net.sourceforge.bprocessor.model.ClippingPlane; import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.CoordinateSystem; *************** *** 441,444 **** --- 442,485 ---- + private static void drawClips(Collection<ClippingPlane> clips) { + for (ClippingPlane current : clips) { + draw(current); + } + } + private static void selectClips(Collection<ClippingPlane> clips) { + for (ClippingPlane current : clips) { + push(current); + draw(current); + pop(); + } + } + + + private static void draw(ClippingPlane clipplane) { + Collection<Vertex> corners = clipplane.getCorners(); + gl.glLineWidth(3.0f); + gl.glBegin(GL.GL_LINE_LOOP); + for (Vertex current : corners) { + gl.glVertex3d(current.getX(), + current.getY(), + current.getZ()); + } + gl.glEnd(); + if (clipplane.isActive()) { + gl.glLineWidth(1.5f); + Collection<Edge> lines = clipplane.getLines(); + for (Edge current : lines) { + if (current.getStrippled()) { + gl.glEnable(GL.GL_LINE_STIPPLE); + draw(current); + gl.glDisable(GL.GL_LINE_STIPPLE); + } else { + draw(current); + } + } + } + } + + private static void selectConstructors(Collection<Constructor> constructors) { if (intersecting) { *************** *** 700,703 **** --- 741,745 ---- Collection<Constructor> constructors = new LinkedList(); Collection<Vertex> vertices = new LinkedList(); + Collection<ClippingPlane> clips = Project.getInstance().getCurrentCamera().getClipplanes(); for (Geometric current : extras) { if (current instanceof Edge) { *************** *** 726,729 **** --- 768,774 ---- } + if (selecting()) { + selectClips(clips); + } } Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.240 retrieving revision 1.241 diff -C2 -d -r1.240 -r1.241 *** View.java 3 Oct 2007 10:07:00 -0000 1.240 --- View.java 3 Oct 2007 10:14:20 -0000 1.241 *************** *** 804,813 **** */ private void disableClipplanes() { ! Iterator clipit = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); ! while (clipit.hasNext()) { ! ClippingPlane cp = (ClippingPlane)clipit.next(); ! if (cp.isActive()) { ! gl.glDisable(GL.GL_CLIP_PLANE0 + cp.getNumber()); ! if (cp.isSlice()) { gl.glDisable(GL.GL_CLIP_PLANE5); } --- 804,812 ---- */ private void disableClipplanes() { ! Collection<ClippingPlane> clips = Project.getInstance().getCurrentCamera().getClipplanes(); ! for (ClippingPlane current : clips) { ! if (current.isActive()) { ! gl.glDisable(GL.GL_CLIP_PLANE0 + current.getNumber()); ! if (current.isSlice()) { gl.glDisable(GL.GL_CLIP_PLANE5); } *************** *** 820,833 **** */ private void enableClipplanes() { ! Iterator clipit = Project.getInstance().getCurrentCamera().getClipplanes().iterator(); ! while (clipit.hasNext()) { ! ClippingPlane cp = (ClippingPlane)clipit.next(); ! if (cp.isActive()) { ! gl.glClipPlane(GL.GL_CLIP_PLANE0 + cp.getNumber(), cp.getPlane().getDoublev(), 0); ! gl.glEnable(GL.GL_CLIP_PLANE0 + cp.getNumber()); ! if (cp.isSlice()) { ! gl.glClipPlane(GL.GL_CLIP_PLANE5, cp.getPlane().negate().getDoublev(), 0); gl.glEnable(GL.GL_CLIP_PLANE5); ! cp.getPlane().negate(); } } --- 819,831 ---- */ private void enableClipplanes() { ! Collection<ClippingPlane> clips = Project.getInstance().getCurrentCamera().getClipplanes(); ! for (ClippingPlane current : clips) { ! if (current.isActive()) { ! gl.glClipPlane(GL.GL_CLIP_PLANE0 + current.getNumber(), current.getPlane().getDoublev(), 0); ! gl.glEnable(GL.GL_CLIP_PLANE0 + current.getNumber()); ! if (current.isSlice()) { ! gl.glClipPlane(GL.GL_CLIP_PLANE5, current.getPlane().negate().getDoublev(), 0); gl.glEnable(GL.GL_CLIP_PLANE5); ! current.getPlane().negate(); } } |
From: rimestad <rim...@us...> - 2007-10-03 10:07:00
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2382/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Ugly hack but makes the gl go on even on errors. If gl.glSelectBugger is called when the rendermode is different from GL_RENDER a exception is thrown. If there is a error during selection drawing the rendermode ins't set back to GL_RENDER and therefore a error can acure. This fixes it but there sould be done some analysis instead finding the error and recover Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.239 retrieving revision 1.240 diff -C2 -d -r1.239 -r1.240 *** View.java 2 Oct 2007 13:51:43 -0000 1.239 --- View.java 3 Oct 2007 10:07:00 -0000 1.240 *************** *** 674,677 **** --- 674,678 ---- if (picking > 0) { try { + gl.glRenderMode(GL.GL_RENDER); selectBuffer = BufferUtil.newIntBuffer(selectionLength); gl.glSelectBuffer(selectionLength, selectBuffer); |
From: rimestad <rim...@us...> - 2007-10-03 10:02:58
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv823/src/net/sourceforge/bprocessor/model Modified Files: Vertex.java Log Message: Log.error if written and no exception is cast when set(Vertex) is called with null Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** Vertex.java 7 Sep 2007 13:21:14 -0000 1.64 --- Vertex.java 3 Oct 2007 10:02:59 -0000 1.65 *************** *** 160,166 **** */ public void set(Vertex other) { ! setX(other.getX()); ! setY(other.getY()); ! setZ(other.getZ()); } --- 160,170 ---- */ public void set(Vertex other) { ! if (other != null) { ! setX(other.getX()); ! setY(other.getY()); ! setZ(other.getZ()); ! } else { ! log.error(this + " were set with a null vertex as argument"); ! } } |
From: rimestad <rim...@us...> - 2007-10-03 10:02:27
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv782/src/net/sourceforge/bprocessor/model Modified Files: Geometry.java Log Message: java generic add Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** Geometry.java 2 Oct 2007 06:41:57 -0000 1.61 --- Geometry.java 3 Oct 2007 10:02:18 -0000 1.62 *************** *** 55,74 **** * @return The collection of edges */ ! public static Collection getActiveEdges(Space s) { if (s.getElements().size() == 1) { ! Collection e = new ArrayList(); e.addAll(s.getEdges()); ! Iterator iter = s.getEnvelope().iterator(); ! while (iter.hasNext()) { ! e.addAll(((Surface)iter.next()).getEdges()); } return e; } else { ! ArrayList edges = new ArrayList(); ! Iterator iter = s.getElements().iterator(); ! while (iter.hasNext()) { ! Space cur = (Space)iter.next(); if (cur != s.getEmpty()) { ! Collection c = getActiveEdges(cur); edges.addAll(c); } --- 55,71 ---- * @return The collection of edges */ ! public static Collection<Edge> getActiveEdges(Space s) { if (s.getElements().size() == 1) { ! Collection<Edge> e = new ArrayList<Edge>(); e.addAll(s.getEdges()); ! for (Surface envelope : s.getEnvelope()) { ! e.addAll(envelope.getEdges()); } return e; } else { ! ArrayList<Edge> edges = new ArrayList<Edge>(); ! for (Space cur : s.getElements()) { if (cur != s.getEmpty()) { ! Collection<Edge> c = getActiveEdges(cur); edges.addAll(c); } |
From: rimestad <rim...@us...> - 2007-10-03 10:01:32
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv358/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Minor improvement to controlledExtrude to make vertexes bound by another surface follow the surface and not just the normal of the extrude surface. Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.186 retrieving revision 1.187 diff -C2 -d -r1.186 -r1.187 *** Surface.java 2 Oct 2007 06:41:57 -0000 1.186 --- Surface.java 3 Oct 2007 10:01:19 -0000 1.187 *************** *** 1061,1071 **** } if (isVertexBounded(v[i]) || (isRootExtrusion && isInner())) { if (v2dir.containsKey(v[i])) { Direction d = (Direction)v2dir.get(v[i]); vmap[i] = d.getVertex(); ! d.alterDirection(normal); } else { vmap[i] = v[i].copy(); ! v2dir.put(v[i], new Direction(vmap[i], normal, min, max)); } } else { --- 1061,1086 ---- } if (isVertexBounded(v[i]) || (isRootExtrusion && isInner())) { + Vertex tempNormal = normal; + Surface bound = null; + for (Surface s : v[i].getSurfaces()) { + if (s != this) { + double dot = s.normal().dot(normal); + if (dot > -0.9 && dot < 0.9) { + bound = s; + } + } + } + if (bound != null) { + Vertex boundNormal = bound.normal(); + Vertex along = boundNormal.cross(tempNormal); + tempNormal = along.cross(boundNormal); + } if (v2dir.containsKey(v[i])) { Direction d = (Direction)v2dir.get(v[i]); vmap[i] = d.getVertex(); ! d.alterDirection(tempNormal); } else { vmap[i] = v[i].copy(); ! v2dir.put(v[i], new Direction(vmap[i], tempNormal, min, max)); } } else { |
From: Michael L. <he...@us...> - 2007-10-02 13:51:41
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31792/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: small refactor Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.238 retrieving revision 1.239 diff -C2 -d -r1.238 -r1.239 *** View.java 2 Oct 2007 13:04:21 -0000 1.238 --- View.java 2 Oct 2007 13:51:43 -0000 1.239 *************** *** 2331,2359 **** */ private void drawClipplane(ClippingPlane clipplane) { ! Collection corners = clipplane.getCorners(); ! { ! gl.glLineWidth(3.0f); ! gl.glBegin(GL.GL_LINE_LOOP); ! Iterator it = corners.iterator(); ! while (it.hasNext()) { ! Vertex v = (Vertex)it.next(); ! gl.glVertex3d(v.getX(), ! v.getY(), ! v.getZ()); ! } ! gl.glEnd(); } ! gl.glLineWidth(1.5f); if (clipplane.isActive()) { ! Collection lines = clipplane.getLines(); ! Iterator it = lines.iterator(); ! while (it.hasNext()) { ! Edge e = (Edge)it.next(); ! if (e.getStrippled()) { gl.glEnable(GL.GL_LINE_STIPPLE); ! drawEdge(e); gl.glDisable(GL.GL_LINE_STIPPLE); } else { ! drawEdge(e); } } --- 2331,2353 ---- */ private void drawClipplane(ClippingPlane clipplane) { ! Collection<Vertex> corners = clipplane.getCorners(); ! gl.glLineWidth(3.0f); ! gl.glBegin(GL.GL_LINE_LOOP); ! for (Vertex current : corners) { ! gl.glVertex3d(current.getX(), ! current.getY(), ! current.getZ()); } ! gl.glEnd(); if (clipplane.isActive()) { ! gl.glLineWidth(1.5f); ! Collection<Edge> lines = clipplane.getLines(); ! for (Edge current : lines) { ! if (current.getStrippled()) { gl.glEnable(GL.GL_LINE_STIPPLE); ! drawEdge(current); gl.glDisable(GL.GL_LINE_STIPPLE); } else { ! drawEdge(current); } } |
From: Michael L. <he...@us...> - 2007-10-02 13:04:21
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13507/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Display.java Log Message: drawing temporary vertices Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Display.java 2 Oct 2007 12:38:01 -0000 1.17 --- Display.java 2 Oct 2007 13:04:21 -0000 1.18 *************** *** 699,702 **** --- 699,703 ---- Collection<Edge> edges = new LinkedList(); Collection<Constructor> constructors = new LinkedList(); + Collection<Vertex> vertices = new LinkedList(); for (Geometric current : extras) { if (current instanceof Edge) { *************** *** 704,707 **** --- 705,710 ---- } else if (current instanceof Constructor) { constructors.add((Constructor) current); + } else if (current instanceof Vertex) { + vertices.add((Vertex) current); } } *************** *** 717,720 **** --- 720,730 ---- } + if (selecting()) { + selectVertices(vertices); + } else { + drawVertices(vertices); + } + + } Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.237 retrieving revision 1.238 diff -C2 -d -r1.237 -r1.238 *** View.java 2 Oct 2007 12:38:01 -0000 1.237 --- View.java 2 Oct 2007 13:04:21 -0000 1.238 *************** *** 710,713 **** --- 710,714 ---- extras.addAll(tempEdges); extras.addAll(tempConstructors); + extras.addAll(tempVertices); Display.extras(extras); Display.draw(gld); |
From: Michael L. <he...@us...> - 2007-10-02 12:38:12
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2919/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Display.java Log Message: constructor drawing Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Display.java 2 Oct 2007 06:42:09 -0000 1.16 --- Display.java 2 Oct 2007 12:38:01 -0000 1.17 *************** *** 53,56 **** --- 53,57 ---- private static Collection<? extends Geometric> extras; private static Grid grid; + private static boolean intersecting; *************** *** 183,186 **** --- 184,203 ---- /** + * Returns the value of intersecting + * @return intersecting + */ + public static boolean intersecting() { + return intersecting; + } + + /** + * Sets the value of intersecting + * @param value intersecting + */ + public static void intersecting(boolean value) { + intersecting = value; + } + + /** * Sets the objects table * @param value ArrayList *************** *** 425,432 **** private static void selectConstructors(Collection<Constructor> constructors) { ! for (Constructor current : constructors) { ! push(current); ! draw(current); ! pop(); } } --- 442,456 ---- private static void selectConstructors(Collection<Constructor> constructors) { ! if (intersecting) { ! for (Constructor current : constructors) { ! Collection<Edge> guides = current.guides(grid.size()); ! selectEdges(guides); ! } ! } else { ! for (Constructor current : constructors) { ! push(current); ! draw(current); ! pop(); ! } } } *************** *** 674,680 **** --- 698,707 ---- { Collection<Edge> edges = new LinkedList(); + Collection<Constructor> constructors = new LinkedList(); for (Geometric current : extras) { if (current instanceof Edge) { edges.add((Edge) current); + } else if (current instanceof Constructor) { + constructors.add((Constructor) current); } } *************** *** 684,687 **** --- 711,720 ---- drawEdges(edges, true); } + if (selecting()) { + selectConstructors(constructors); + } else { + paintConstructors(constructors); + } + } Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.236 retrieving revision 1.237 diff -C2 -d -r1.236 -r1.237 *** View.java 25 Sep 2007 11:07:38 -0000 1.236 --- View.java 2 Oct 2007 12:38:01 -0000 1.237 *************** *** 702,708 **** Display.target(null); } ! Display.extras(tempEdges); Display.draw(gld); Display.selecting(false); } else { drawAll(hitdetection); --- 702,717 ---- Display.target(null); } ! if (selectionMode == INTERSECTIONS) { ! Display.intersecting(true); ! } else { ! Display.intersecting(false); ! } ! Collection<Geometric> extras = new LinkedList(); ! extras.addAll(tempEdges); ! extras.addAll(tempConstructors); ! Display.extras(extras); Display.draw(gld); Display.selecting(false); + Display.intersecting(false); } else { drawAll(hitdetection); |
From: Michael L. <he...@us...> - 2007-10-02 12:38:07
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2906/src/net/sourceforge/bprocessor/model Modified Files: Line.java CoordinateSystem.java Constructor.java Log Message: constructor drawing Index: Constructor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Constructor.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Constructor.java 18 Jul 2007 13:35:39 -0000 1.21 --- Constructor.java 2 Oct 2007 12:37:56 -0000 1.22 *************** *** 114,117 **** --- 114,128 ---- } + /** + * Return edges that functions as guidelines for this + * constructor. + * @param length length of guide + * @return collection of edges + */ + public Collection<Edge> guides(double length) { + Collection<Edge> guides = new LinkedList(); + return guides; + } + /** {@inheritDoc} */ @Override Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** CoordinateSystem.java 27 Sep 2007 10:41:25 -0000 1.56 --- CoordinateSystem.java 2 Oct 2007 12:37:56 -0000 1.57 *************** *** 819,822 **** --- 819,858 ---- /** + * Returns the x axis + * @return x axis + */ + public Axis xaxis() { + return new Axis(origin, i); + } + + /** + * Returns the y axis + * @return y axis + */ + public Axis yaxis() { + return new Axis(origin, j); + } + + + /** + * Returns the z axis + * @return z axis + */ + public Axis zaxis() { + return new Axis(origin, n); + } + + /** + * {@inheritDoc} + */ + public Collection<Edge> guides(double length) { + Collection<Edge> guides = super.guides(length); + guides.add(xaxis().edge(length)); + guides.add(yaxis().edge(length)); + guides.add(zaxis().edge(length)); + return guides; + } + + /** * Tip */ *************** *** 860,863 **** --- 896,917 ---- } + private class Axis extends Line { + /** + * Constructs Axis + * @param origin origin + * @param direction direction + */ + public Axis(Vertex origin, Vertex direction) { + super(origin, direction); + } + /** + * Parent + * @return This line + */ + public Geometric parent() { + return CoordinateSystem.this; + } + } + /** * Guide Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Line.java 18 Jul 2007 13:35:38 -0000 1.34 --- Line.java 2 Oct 2007 12:37:56 -0000 1.35 *************** *** 244,247 **** --- 244,256 ---- return constructor; } + + /** + * {@inheritDoc} + */ + public Collection<Edge> guides(double length) { + Collection<Edge> guides = super.guides(length); + guides.add(edge(length)); + return guides; + } /** |
From: Michael L. <he...@us...> - 2007-10-02 06:42:15
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24539/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: constructor drawing Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.114 retrieving revision 1.115 diff -C2 -d -r1.114 -r1.115 *** GenericTreeView.java 27 Sep 2007 10:44:17 -0000 1.114 --- GenericTreeView.java 2 Oct 2007 06:42:14 -0000 1.115 *************** *** 1372,1376 **** --- 1372,1378 ---- if (x <= 16) { toggle(geometric); + setSelectionPaths(new TreePath[0]); model.nodeChanged(node); + Selection.primary().clear(); } } else if (object instanceof Camera) { |
From: Michael L. <he...@us...> - 2007-10-02 06:42:07
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24295/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: constructor drawing Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Display.java 1 Oct 2007 11:07:01 -0000 1.15 --- Display.java 2 Oct 2007 06:42:09 -0000 1.16 *************** *** 24,30 **** --- 24,33 ---- import net.sourceforge.bprocessor.model.Camera; + import net.sourceforge.bprocessor.model.Constructor; + import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Defaults; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometric; + import net.sourceforge.bprocessor.model.Line; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Selection; *************** *** 40,43 **** --- 43,47 ---- private static final boolean TRUE = true; + private static boolean initialized; private static boolean selecting; *************** *** 48,51 **** --- 52,57 ---- private static Geometric target; private static Collection<? extends Geometric> extras; + private static Grid grid; + private static float[] white = new float[] {1.0f, 1.0f, 1.0f}; *************** *** 58,62 **** private static float[] babyblue = new float[] {224f / 255, 255f / 255, 255f / 255}; private static float[] middleblue = new float[] {0.11f, 0.72f, 0.67f, 0.0f}; ! private static float[] misty = new float[] {255f / 280, 228f / 280, 225f / 280}; --- 64,70 ---- private static float[] babyblue = new float[] {224f / 255, 255f / 255, 255f / 255}; private static float[] middleblue = new float[] {0.11f, 0.72f, 0.67f, 0.0f}; ! private static float[] red = new float[]{0.8f, 0.1f, 0.1f}; ! private static float[] green = new float[]{0.1f, 0.8f, 0.1f}; ! private static float[] blue = new float[]{0.1f, 0.1f, 0.8f}; private static float[] misty = new float[] {255f / 280, 228f / 280, 225f / 280}; *************** *** 101,105 **** } } ! initialized = true; } --- 109,113 ---- } } ! grid = new Grid(); initialized = true; } *************** *** 346,349 **** --- 354,435 ---- } + private static void paintConstructors(Collection<Constructor> constructors) { + for (Constructor current : constructors) { + paint(current); + } + } + + + private static void paint(Constructor constructor) { + if (constructor instanceof CoordinateSystem) { + paint((CoordinateSystem) constructor); + } else if (constructor instanceof Line) { + paint((Line) constructor); + } + } + + private static void paint(Line line) { + gl.glLineWidth(1.0f); + gl.glEnable(GL.GL_LINE_STIPPLE); + gl.glColor3fv(middleblue, 0); + draw(line); + gl.glDisable(GL.GL_LINE_STIPPLE); + } + + private static void paint(CoordinateSystem system) { + Vertex origin = system.getOrigin(); + Vertex i = system.getI(); + Vertex j = system.getJ(); + Vertex n = system.getN(); + Line xaxis = new Line(origin, i); + Line yaxis = new Line(origin, j); + Line zaxis = new Line(origin, n); + gl.glLineWidth(1.0f); + gl.glEnable(GL.GL_LINE_STIPPLE); + gl.glColor3fv(red, 0); + draw(xaxis); + gl.glColor3fv(green, 0); + draw(yaxis); + gl.glColor3fv(blue, 0); + draw(zaxis); + gl.glDisable(GL.GL_LINE_STIPPLE); + } + + private static void draw(CoordinateSystem system) { + Vertex origin = system.getOrigin(); + Vertex i = system.getI(); + Vertex j = system.getJ(); + Vertex n = system.getN(); + Line xaxis = new Line(origin, i); + Line yaxis = new Line(origin, j); + Line zaxis = new Line(origin, n); + draw(xaxis); + draw(yaxis); + draw(zaxis); + } + + + private static void draw(Constructor constructor) { + if (constructor instanceof CoordinateSystem) { + draw((CoordinateSystem) constructor); + } else if (constructor instanceof Line) { + draw((Line) constructor); + } + } + + private static void draw(Line line) { + Edge edge = line.edge(grid.size()); + draw(edge); + } + + + private static void selectConstructors(Collection<Constructor> constructors) { + for (Constructor current : constructors) { + push(current); + draw(current); + pop(); + } + } + private static boolean transparent(Space space) { Project project = Project.getInstance(); *************** *** 385,389 **** Collection<Edge> edges = new LinkedList(); Collection<Vertex> vertices = new LinkedList(); ! for (Space current : space.getElements()) { if (!hidden.contains(current)) { --- 471,476 ---- Collection<Edge> edges = new LinkedList(); Collection<Vertex> vertices = new LinkedList(); ! Collection<Constructor> constructors = new LinkedList(); ! for (Space current : space.getElements()) { if (!hidden.contains(current)) { *************** *** 461,465 **** } } ! gl.glEnable(GL.GL_DEPTH_TEST); --- 548,557 ---- } } ! ! for (Constructor current : space.getConstructors()) { ! if (!hidden.contains(current)) { ! constructors.add(current); ! } ! } gl.glEnable(GL.GL_DEPTH_TEST); *************** *** 470,473 **** --- 562,566 ---- } selectEdges(edges); + selectConstructors(constructors); } else { if (active) { *************** *** 476,480 **** if (project.getActiveSpace() == space) { gl.glDepthMask(false); ! draw(new Grid()); gl.glDepthMask(true); } --- 569,574 ---- if (project.getActiveSpace() == space) { gl.glDepthMask(false); ! draw(grid); ! paintConstructors(constructors); gl.glDepthMask(true); } *************** *** 514,517 **** --- 608,619 ---- } + gl.glEnable(GL.GL_LINE_STIPPLE); + for (Geometric current : geometrics) { + if (current instanceof Constructor) { + draw((Constructor) current); + } + } + gl.glDisable(GL.GL_LINE_STIPPLE); + gl.glDisable(GL.GL_POLYGON_STIPPLE); gl.glDisable(GL.GL_DEPTH_TEST); |
From: Michael L. <he...@us...> - 2007-10-02 06:42:07
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24295/src/net/sourceforge/bprocessor/gl/tool Modified Files: MultiExtrudeTool.java RectTool.java Log Message: constructor drawing Index: RectTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/RectTool.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** RectTool.java 19 Sep 2007 20:57:47 -0000 1.21 --- RectTool.java 2 Oct 2007 06:42:09 -0000 1.22 *************** *** 20,23 **** --- 20,24 ---- import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Selection; + import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; *************** *** 100,104 **** direction.scale((length - direction.length()) / direction.length()); movingEdge.move(direction.getX(), direction.getY(), direction.getZ()); ! Geometry.insertEdges(rectangle); cleanUp(); feedback(rectangle); --- 101,106 ---- direction.scale((length - direction.length()) / direction.length()); movingEdge.move(direction.getX(), direction.getY(), direction.getZ()); ! List surfaces = Geometry.insertEdges(rectangle); ! System.out.println("surfaces: " + surfaces); cleanUp(); feedback(rectangle); *************** *** 168,172 **** } else { if (baseEdge.getLength() > 0.0 && movingEdge.getLength() > 0.0) { ! Geometry.insertEdges(rectangle); } cleanUp(); --- 170,188 ---- } else { if (baseEdge.getLength() > 0.0 && movingEdge.getLength() > 0.0) { ! List<Surface> surfaces = Geometry.insertEdges(rectangle); ! for (Surface current : surfaces) { ! Surface exterior = current.getExterior(); ! if (exterior != null) { ! Vertex n1 = current.normal(); ! Vertex n2 = exterior.normal(); ! if (n1.dot(n2) > 0) { ! current.setFrontDomain(exterior.getFrontDomain()); ! current.setBackDomain(exterior.getBackDomain()); ! } else { ! current.setFrontDomain(exterior.getBackDomain()); ! current.setBackDomain(exterior.getFrontDomain()); ! } ! } ! } } cleanUp(); Index: MultiExtrudeTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MultiExtrudeTool.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** MultiExtrudeTool.java 1 Oct 2007 13:26:16 -0000 1.25 --- MultiExtrudeTool.java 2 Oct 2007 06:42:09 -0000 1.26 *************** *** 281,285 **** while (holes.hasNext()) { Surface hole = (Surface) holes.next(); ! creations.add(hole.extrudeControlled(-direction, true, creations, e2e, v2e, e2s, v2dir)); } } --- 281,286 ---- while (holes.hasNext()) { Surface hole = (Surface) holes.next(); ! creations.add(hole.extrudeControlled(-direction, true, creations, ! e2e, v2e, e2s, v2dir)); } } |
From: Michael L. <he...@us...> - 2007-10-02 06:42:02
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24167/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Geometry.java Log Message: constructor drawing Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.185 retrieving revision 1.186 diff -C2 -d -r1.185 -r1.186 *** Surface.java 1 Oct 2007 13:26:22 -0000 1.185 --- Surface.java 2 Oct 2007 06:41:57 -0000 1.186 *************** *** 1015,1018 **** --- 1015,1019 ---- /** * Make the new vertices, edges and surfaces for extrusion + * @param isRootExtrusion is root extrusion * @param delta the length of extrusion in meters * @param sides Will contain the sides that are created *************** *** 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(); --- 1024,1029 ---- * @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(); Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** Geometry.java 19 Jul 2007 12:23:38 -0000 1.60 --- Geometry.java 2 Oct 2007 06:41:57 -0000 1.61 *************** *** 433,437 **** * @return List of the surfaces created (empty list if none) */ ! public static List insertEdges(List<Edge> edges) { Space space = Project.getInstance().getActiveSpace(); List<Surface> result = new LinkedList(); --- 433,437 ---- * @return List of the surfaces created (empty list if none) */ ! public static List<Surface> insertEdges(List<Edge> edges) { Space space = Project.getInstance().getActiveSpace(); List<Surface> result = new LinkedList(); *************** *** 439,444 **** Collection<Vertex> vertices = Edge.vertices(edges); Mesh mesh = new Mesh(new LinkedList(), edges, vertices); ! space.insert(mesh); ! Project.getInstance().changed(Project.getInstance().getActiveSpace()); Project.getInstance().checkpoint(); --- 439,444 ---- Collection<Vertex> vertices = Edge.vertices(edges); Mesh mesh = new Mesh(new LinkedList(), edges, vertices); ! mesh = space.insert(mesh); ! result.addAll(mesh.surfaces()); Project.getInstance().changed(Project.getInstance().getActiveSpace()); Project.getInstance().checkpoint(); |
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; |
From: rimestad <rim...@us...> - 2007-10-01 13:26:20
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32437/src/net/sourceforge/bprocessor/gl/tool Modified Files: MultiExtrudeTool.java Log Message: Removed space assignment from push/pull and fixed error when trying to extrude a hole by itself. Index: MultiExtrudeTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MultiExtrudeTool.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** MultiExtrudeTool.java 5 Sep 2007 09:00:00 -0000 1.24 --- MultiExtrudeTool.java 1 Oct 2007 13:26:16 -0000 1.25 *************** *** 281,288 **** while (holes.hasNext()) { Surface hole = (Surface) holes.next(); ! creations.add(hole.extrudeControlled(-direction, creations, e2e, v2e, e2s, v2dir)); } } ! s = cur.extrudeControlled(-direction, creations, e2e, v2e, e2s, v2dir); } else { if (extrudeAll) { --- 281,288 ---- while (holes.hasNext()) { Surface hole = (Surface) holes.next(); ! creations.add(hole.extrudeControlled(-direction, true, creations, e2e, v2e, e2s, v2dir)); } } ! s = cur.extrudeControlled(-direction, true, creations, e2e, v2e, e2s, v2dir); } else { if (extrudeAll) { |
From: Michael L. <he...@us...> - 2007-10-01 11:07:11
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8340/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: Changed rules for transparency Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Display.java 29 Sep 2007 13:06:39 -0000 1.14 --- Display.java 1 Oct 2007 11:07:01 -0000 1.15 *************** *** 368,380 **** Space front = surface.getFrontDomain(); Space back = surface.getBackDomain(); ! if (front == back) { ! if (front.isContainer()) { ! return true; ! } ! } ! if (transparent(front) && transparent(back)) { ! return true; ! } ! return false; } --- 368,372 ---- Space front = surface.getFrontDomain(); Space back = surface.getBackDomain(); ! return transparent(front) && transparent(back); } |
From: Michael L. <he...@us...> - 2007-09-29 14:29:04
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29960/src/net/sourceforge/bprocessor/model Modified Files: Mesh.java Log Message: Mesh extended with elements Index: Mesh.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Mesh.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Mesh.java 27 Sep 2007 10:43:02 -0000 1.21 --- Mesh.java 29 Sep 2007 14:29:05 -0000 1.22 *************** *** 21,24 **** --- 21,25 ---- private Collection<Edge> edges; private Collection<Surface> surfaces; + private Collection<Space> elements; /** *************** *** 44,47 **** --- 45,65 ---- /** + * Constructs a Mesh. + * @param elements Collection of spaces + * @param surfaces Collection of surfaces + * @param edges Collection of edges + * @param vertices Collection of vertices + */ + public Mesh(Collection<Space> elements, + Collection<Surface> surfaces, + Collection<Edge> edges, + Collection<Vertex> vertices) { + this.elements = elements; + this.surfaces = surfaces; + this.edges = edges; + this.vertices = vertices; + } + + /** * * @param geometrics Collection of Geometric objects *************** *** 51,56 **** Collection<Edge> edges = new HashSet<Edge>(); Collection<Surface> surfaces = new HashSet<Surface>(); for (Geometric current : geometrics) { ! if (current instanceof Surface) { surfaces.add((Surface) current); } else if (current instanceof Edge) { --- 69,77 ---- Collection<Edge> edges = new HashSet<Edge>(); Collection<Surface> surfaces = new HashSet<Surface>(); + Collection<Space> elements = new HashSet<Space>(); for (Geometric current : geometrics) { ! if (current instanceof Space) { ! elements.add((Space) current); ! } else if (current instanceof Surface) { surfaces.add((Surface) current); } else if (current instanceof Edge) { *************** *** 62,65 **** --- 83,87 ---- edges.addAll(Surface.edges(surfaces)); vertices.addAll(Edge.vertices(edges)); + this.elements = elements; this.surfaces = surfaces; this.edges = edges; *************** *** 92,95 **** --- 114,125 ---- /** + * + * @return elements + */ + public Collection<Space> elements() { + return elements; + } + + /** * Returns all geometric objects in this Mesh * @return collection of geometrics objects |
From: Michael L. <he...@us...> - 2007-09-29 13:06:43
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30583/src/net/sourceforge/bprocessor/model Modified Files: SpaceAnalysis.java Log Message: drawing lonely vertices and some color adjustments Index: SpaceAnalysis.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SpaceAnalysis.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SpaceAnalysis.java 27 Sep 2007 13:22:25 -0000 1.6 --- SpaceAnalysis.java 29 Sep 2007 13:06:34 -0000 1.7 *************** *** 144,172 **** if (side < 0) { if (angle > maximum) { - selected = current; maximum = angle; } } else { if (angle < minimum) { - selected = current; minimum = angle; ! } ! } ! Surface exterior = selected.getExterior(); ! if (exterior != null) { ! if (angle > Math.PI) { ! angle = angle - Math.PI; ! } else { ! angle = angle + Math.PI; ! } ! if (side < 0) { ! if (angle > maximum) { ! selected = null; ! maximum = angle; ! } ! } else { ! if (angle < minimum) { ! selected = null; ! minimum = angle; } } --- 144,170 ---- if (side < 0) { if (angle > maximum) { maximum = angle; + selected = current; + Surface exterior = selected.getExterior(); + if (exterior != null) { + if (angle < Math.PI) { + angle = angle + Math.PI; + selected = null; + maximum = angle; + } + } } } else { if (angle < minimum) { minimum = angle; ! selected = current; ! selected = current; ! Surface exterior = selected.getExterior(); ! if (exterior != null) { ! if (angle > Math.PI) { ! angle = angle - Math.PI; ! selected = null; ! minimum = angle; ! } } } |