Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23409/src/net/sourceforge/bprocessor/gl/tool
Modified Files:
AbstractPencil.java
Log Message:
Implemented locking to plane in AbstractPencil
Index: AbstractPencil.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -d -r1.48 -r1.49
*** AbstractPencil.java 20 Jul 2006 14:21:39 -0000 1.48
--- AbstractPencil.java 21 Jul 2006 08:06:59 -0000 1.49
***************
*** 132,139 ****
Surface surface = (Surface) current.object();
lockingPlane = surface.plane();
- Project.info("lock to surface");
}
if (current.type() == Intersection.PLANE_INTERSECTION) {
- Project.info("lock to plane");
lockingPlane = (Plane) current.object();
}
--- 132,137 ----
***************
*** 152,166 ****
ray = transformation.unProject(ray);
!
! if (constrain && lockingEdge != null) {
! Vertex v1 = lockingEdge.getDirection();
! Vertex v2 = ray.getDirection();
! Vertex v3 = v1.cross(v2);
! Vertex normal = v1.cross(v3);
! normal.normalize();
! double d = -(lockingEdge.center().dot(normal));
! work = new Plane(normal.getX(), normal.getY(), normal.getZ(), d);
}
Collection unwanted = new HashSet();
unwanted.addAll(elements);
--- 150,169 ----
ray = transformation.unProject(ray);
! if (constrain) {
! if (lockingEdge != null) {
! Vertex v1 = lockingEdge.getDirection();
! Vertex v2 = ray.getDirection();
! Vertex v3 = v1.cross(v2);
! Vertex normal = v1.cross(v3);
! normal.normalize();
! double d = -(lockingEdge.center().dot(normal));
! work = new Plane(normal.getX(), normal.getY(), normal.getZ(), d);
! }
! if (lockingPlane != null) {
! work = lockingPlane;
! }
}
+
Collection unwanted = new HashSet();
unwanted.addAll(elements);
***************
*** 175,178 ****
--- 178,188 ----
intersection = new Intersection(vertex, Intersection.EDGE, lockingEdge);
}
+
+ if (lockingPlane != null) {
+ if (!lockingPlane.contains(intersection.vertex())) {
+ Vertex vertex = lockingPlane.projection(intersection.vertex());
+ intersection = new Intersection(vertex, Intersection.PLANE_INTERSECTION, lockingPlane);
+ }
+ }
}
***************
*** 846,849 ****
--- 856,860 ----
lock = false;
lockingEdge = null;
+ lockingPlane = null;
constructors(new LinkedList());
feedback(new LinkedList());
|