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 ----
|