Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30563/src/net/sourceforge/bprocessor/gl/tool
Modified Files:
OffsetTool.java
Log Message:
Fixed error ocurring in offset when a surface was flipped. Should now work in some more cases.
Index: OffsetTool.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/OffsetTool.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** OffsetTool.java 10 Oct 2006 15:02:25 -0000 1.11
--- OffsetTool.java 16 Oct 2006 15:07:00 -0000 1.12
***************
*** 103,111 ****
feedback(contour);
outNormal = startEdge.getDirection().cross(surface.normal());
if (current.vertex().minus(start.vertex()).dot(outNormal) > 0) {
outNormal.scale(1 / outNormal.length());
} else {
outNormal.scale(-1 / outNormal.length());
! }
}
lastOffsetPoint = current.vertex().copy();
--- 103,112 ----
feedback(contour);
outNormal = startEdge.getDirection().cross(surface.normal());
+ outNormal.scale(1 / outNormal.length());
if (current.vertex().minus(start.vertex()).dot(outNormal) > 0) {
outNormal.scale(1 / outNormal.length());
} else {
outNormal.scale(-1 / outNormal.length());
! }
}
lastOffsetPoint = current.vertex().copy();
***************
*** 144,148 ****
Direction d = (Direction)it.next();
Vertex dir;
! dir = d.getDirection().copy(1);
dir.scale(length);
d.getVertex().move(dir.getX(), dir.getY(), dir.getZ());
--- 145,149 ----
Direction d = (Direction)it.next();
Vertex dir;
! dir = d.getDirection().copy();
dir.scale(length);
d.getVertex().move(dir.getX(), dir.getY(), dir.getZ());
|