Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16357/src/net/sourceforge/bprocessor/model
Modified Files:
Edge.java Space.java Entity.java
Log Message:
Fixed error in geometry insertion that caused empty edges to be inserted
Index: Space.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v
retrieving revision 1.131
retrieving revision 1.132
diff -C2 -d -r1.131 -r1.132
*** Space.java 10 Apr 2007 20:53:16 -0000 1.131
--- Space.java 11 Apr 2007 08:44:58 -0000 1.132
***************
*** 2730,2734 ****
}
for (Edge edge : mesh.edges()) {
! edges.add(insert(edge));
}
for (Surface surface : mesh.surfaces()) {
--- 2730,2742 ----
}
for (Edge edge : mesh.edges()) {
! try {
! edge.check();
! edges.add(insert(edge));
! } catch (Exception e) {
! System.out.println("inconsistent: " + edge);
! System.out.println(" " + edge.getFrom());
! System.out.println(" " + edge.getTo());
! }
!
}
for (Surface surface : mesh.surfaces()) {
***************
*** 2740,2743 ****
--- 2748,2752 ----
}
}
+
SurfaceAnalysis analysis = new SurfaceAnalysis();
surfaces.addAll(analysis.surfaceAnalysis(this, edges));
Index: Edge.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v
retrieving revision 1.81
retrieving revision 1.82
diff -C2 -d -r1.81 -r1.82
*** Edge.java 10 Apr 2007 07:56:01 -0000 1.81
--- Edge.java 11 Apr 2007 08:44:58 -0000 1.82
***************
*** 515,522 ****
--- 515,531 ----
Vertex p0 = getFrom();
Vertex p1 = getTo();
+
+ if (p0.equalEps(vertex)) {
+ return false;
+ }
+ if (p1.equalEps(vertex)) {
+ return false;
+ }
+
Vertex r = p1.minus(p0);
Vertex q = vertex;
double t = 0.0;
+
if (Math.abs(r.getX()) > 0.0000001) {
t = (q.getX() - p0.getX()) / r.getX();
***************
*** 1079,1096 ****
/**
* Check consistency
* @return true if ok
*/
! public boolean check() {
if (from == null) {
! throw new Error("from null");
}
if (to == null) {
! throw new Error ("to null");
}
if (from == to) {
! throw new Error ("from == to");
}
if (from.equalEps(to)) {
! throw new Error ("from overlaps to");
}
return true;
--- 1088,1106 ----
/**
* Check consistency
+ * @throws Exception when not consistent
* @return true if ok
*/
! public boolean check() throws Exception {
if (from == null) {
! throw new Exception("from null");
}
if (to == null) {
! throw new Exception ("to null");
}
if (from == to) {
! throw new Exception ("from == to");
}
if (from.equalEps(to)) {
! throw new Exception ("from overlaps to");
}
return true;
Index: Entity.java
===================================================================
RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Entity.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Entity.java 10 Apr 2007 20:54:26 -0000 1.15
--- Entity.java 11 Apr 2007 08:44:58 -0000 1.16
***************
*** 67,71 ****
* @param entities List of entities to be sorted
*/
! public static void sort(List<?> entities) {
final Comparator<Object> comparator =
new Comparator<Object>() {
--- 67,71 ----
* @param entities List of entities to be sorted
*/
! public static void sort(List< ? > entities) {
final Comparator<Object> comparator =
new Comparator<Object>() {
|