bprocessor-commit Mailing List for B-processor (Page 85)
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: Michael L. <he...@us...> - 2006-12-11 10:44:55
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24171/src/net/sourceforge/bprocessor/model Modified Files: CoordinateSystem.java Log Message: Progress on incremental version of pencil algo Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** CoordinateSystem.java 8 Dec 2006 13:37:09 -0000 1.31 --- CoordinateSystem.java 11 Dec 2006 10:44:47 -0000 1.32 *************** *** 170,174 **** if (n.length() > 0) { n.scale(1 / n.length()); ! Vertex j = i.cross(n); j.scale(1 / j.length()); return new CoordinateSystem(i, j, n, origin); --- 170,174 ---- if (n.length() > 0) { n.scale(1 / n.length()); ! Vertex j = n.cross(i); j.scale(1 / j.length()); return new CoordinateSystem(i, j, n, origin); |
|
From: Michael L. <he...@us...> - 2006-12-11 10:04:52
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8445/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Surface.direction() implemented Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.125 retrieving revision 1.126 diff -C2 -d -r1.125 -r1.126 *** Surface.java 8 Dec 2006 13:37:09 -0000 1.125 --- Surface.java 11 Dec 2006 10:04:43 -0000 1.126 *************** *** 266,270 **** /** ! * Return the first vertex, which is the vertex from * first edge that is NOT shared between first and * second edge. --- 266,270 ---- /** ! * Returns the first vertex, which is the vertex from * first edge that is NOT shared between first and * second edge. *************** *** 277,280 **** --- 277,293 ---- /** + * Returns the turn direction of this Surface with respect to the + * given coordinate-system. + * @param system a coordinate-system in which the turn direction + * of this Surface should be calculated + * @return the turn direction of this Surface in the given + * coordinate-system. LEFT means counter-clockwise and RIGHT + * means clockwise. + */ + public int direction(CoordinateSystem system) { + return direction(edges, system); + } + + /** * Delete surface * |
|
From: Michael L. <he...@us...> - 2006-12-09 16:33:13
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3218/src/net/sourceforge/bprocessor/gl/tool Modified Files: PencilTool.java Log Message: Started work on incremental version of pencil algo Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** PencilTool.java 7 Dec 2006 23:06:02 -0000 1.70 --- PencilTool.java 9 Dec 2006 16:33:09 -0000 1.71 *************** *** 111,115 **** public void actionPerformed(ActionEvent arg0) { Space space = Project.getInstance().getActiveSpace(); ! clearSurfaces(space); surfaceAnalysis(space); Project.getInstance().changed(space); --- 111,115 ---- public void actionPerformed(ActionEvent arg0) { Space space = Project.getInstance().getActiveSpace(); ! //clearSurfaces(space); surfaceAnalysis(space); Project.getInstance().changed(space); *************** *** 385,388 **** --- 385,422 ---- } { + Set keys = emap.keySet(); + Collection surfaces = space.getSurfaces(); + Iterator iter = surfaces.iterator(); + while (iter.hasNext()) { + Surface current = (Surface) iter.next(); + if (keys.containsAll(current.getEdges())) { + SurfaceNode surfacenode = new SurfaceNode(current); + int direction = Surface.direction(current.getEdges(), system); + if (direction == Surface.RIGHT) { + Iterator eit = current.getEdges().iterator(); + VertexNode from = (VertexNode) vmap.get(current.getFirstVertex()); + while (eit.hasNext()) { + Edge edge = (Edge) eit.next(); + EdgeNode node = (EdgeNode) emap.get(edge); + VertexNode to = node.other(from); + node.setRight(to, surfacenode); + from = to; + } + } + if (direction == Surface.LEFT) { + Iterator eit = current.getEdges().iterator(); + VertexNode from = (VertexNode) vmap.get(current.getFirstVertex()); + while (eit.hasNext()) { + Edge edge = (Edge) eit.next(); + EdgeNode node = (EdgeNode) emap.get(edge); + VertexNode to = node.other(from); + node.setLeft(to, surfacenode); + from = to; + } + } + } + } + } + { Iterator iter = emap.values().iterator(); System.out.println("-- analysis --"); *************** *** 429,432 **** --- 463,467 ---- System.out.println(current); nodes.add(current); + s.consume(current.getLeft(to)); current.setLeft(to, s); current = current.pred(to); *************** *** 439,442 **** --- 474,478 ---- if (turn == Surface.LEFT) { System.out.println("turns left"); + System.out.println("consumes " + s.surfaces); Surface surface = new Surface(edges); Project.getInstance().getActiveSpace().add(surface); *************** *** 456,459 **** --- 492,496 ---- System.out.println(current); nodes.add(current); + s.consume(current.getRight(to)); current.setRight(to, s); current = current.succ(to); *************** *** 469,472 **** --- 506,510 ---- if (turn == Surface.RIGHT) { System.out.println("turns right"); + System.out.println("consumes " + s.surfaces); Surface surface = new Surface(edges); Project.getInstance().getActiveSpace().add(surface); *************** *** 771,774 **** --- 809,853 ---- */ public class SurfaceNode { + /** + * The set of surfaces is the surfaces is in the model prior to + * surface analysis. Newly created surfaces inherit properties from + * the existing surfaces that are later deleted. + * + * Unless the geometry was malformed, there is only one surface related + * to this SurfaceNode. More than one surface means that an edge is part + * of more than two surfaces in a plane. This can happen easily with + * the current geometric tools. + */ + private Set surfaces; + + /** + * Constructs this SurfaceNode with an empty set of surfaces + */ + public SurfaceNode() { + super(); + surfaces = new HashSet(); + } + /** + * Constructs this SurfaceNode with the given surface in the set + * of surfaces + * @param surface a surface related to this SurfaceNode + */ + public SurfaceNode(Surface surface) { + super(); + surfaces = new HashSet(); + surfaces.add(surface); + } + + /** + * Adds the surfaces from another SurfaceNode to the set of + * surfaces of this SurfaceNode. The other SurfaceNode may + * be null. + * @param other possibly null SurfaceNode from wich to add surfaces + */ + public void consume(SurfaceNode other) { + if (other != null) { + surfaces.addAll(other.surfaces); + } + } } } |
|
From: Michael L. <he...@us...> - 2006-12-08 16:43:34
|
Update of /cvsroot/bprocessor/test/reference In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27829/reference Modified Files: directions.out Log Message: reference output of directions test updated to reflect change in algorithm Index: directions.out =================================================================== RCS file: /cvsroot/bprocessor/test/reference/directions.out,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** directions.out 8 Dec 2006 11:13:23 -0000 1.2 --- directions.out 8 Dec 2006 16:43:20 -0000 1.3 *************** *** 15,31 **** S6 direction: LEFT in [i = V[0.0, 1.0, 0.0] j = V[1.0, 0.0, 0.0] n = V[0.0, 0.0, 1.0] o = V[0.0, 0.0, 0.0]]: ! S1 direction: LEFT S2 direction: PARALLEL S3 direction: PARALLEL S4 direction: PARALLEL S5 direction: PARALLEL ! S6 direction: RIGHT in [i = V[1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, -1.0] o = V[0.0, 0.0, 0.0]]: ! S1 direction: RIGHT S2 direction: PARALLEL S3 direction: PARALLEL S4 direction: PARALLEL S5 direction: PARALLEL ! S6 direction: LEFT in [i = V[0.0, 1.0, 0.0] j = V[0.0, 0.0, 1.0] n = V[1.0, 0.0, 0.0] o = V[0.0, 0.0, 0.0]]: S1 direction: PARALLEL --- 15,31 ---- S6 direction: LEFT in [i = V[0.0, 1.0, 0.0] j = V[1.0, 0.0, 0.0] n = V[0.0, 0.0, 1.0] o = V[0.0, 0.0, 0.0]]: ! S1 direction: RIGHT S2 direction: PARALLEL S3 direction: PARALLEL S4 direction: PARALLEL S5 direction: PARALLEL ! S6 direction: LEFT in [i = V[1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, -1.0] o = V[0.0, 0.0, 0.0]]: ! S1 direction: LEFT S2 direction: PARALLEL S3 direction: PARALLEL S4 direction: PARALLEL S5 direction: PARALLEL ! S6 direction: RIGHT in [i = V[0.0, 1.0, 0.0] j = V[0.0, 0.0, 1.0] n = V[1.0, 0.0, 0.0] o = V[0.0, 0.0, 0.0]]: S1 direction: PARALLEL *************** *** 58,74 **** S6 direction: LEFT in [i = V[0.0, 1.0, 0.0] j = V[1.0, 0.0, 0.0] n = V[0.0, 0.0, 1.0] o = V[0.0, 0.0, 0.0]]: ! S1 direction: LEFT S2 direction: PARALLEL S3 direction: PARALLEL S4 direction: PARALLEL S5 direction: PARALLEL ! S6 direction: RIGHT in [i = V[1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, -1.0] o = V[0.0, 0.0, 0.0]]: ! S1 direction: RIGHT S2 direction: PARALLEL S3 direction: PARALLEL S4 direction: PARALLEL S5 direction: PARALLEL ! S6 direction: LEFT in [i = V[0.0, 1.0, 0.0] j = V[0.0, 0.0, 1.0] n = V[1.0, 0.0, 0.0] o = V[0.0, 0.0, 0.0]]: S1 direction: PARALLEL --- 58,74 ---- S6 direction: LEFT in [i = V[0.0, 1.0, 0.0] j = V[1.0, 0.0, 0.0] n = V[0.0, 0.0, 1.0] o = V[0.0, 0.0, 0.0]]: ! S1 direction: RIGHT S2 direction: PARALLEL S3 direction: PARALLEL S4 direction: PARALLEL S5 direction: PARALLEL ! S6 direction: LEFT in [i = V[1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, -1.0] o = V[0.0, 0.0, 0.0]]: ! S1 direction: LEFT S2 direction: PARALLEL S3 direction: PARALLEL S4 direction: PARALLEL S5 direction: PARALLEL ! S6 direction: RIGHT in [i = V[0.0, 1.0, 0.0] j = V[0.0, 0.0, 1.0] n = V[1.0, 0.0, 0.0] o = V[0.0, 0.0, 0.0]]: S1 direction: PARALLEL *************** *** 97,109 **** S4 direction: LEFT in [i = V[0.0, 1.0, 0.0] j = V[1.0, 0.0, 0.0] n = V[0.0, 0.0, 1.0] o = V[0.0, 0.0, 0.0]]: - S1 direction: LEFT - S2 direction: LEFT - S3 direction: RIGHT - S4 direction: RIGHT - in [i = V[1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, -1.0] o = V[0.0, 0.0, 0.0]]: S1 direction: RIGHT S2 direction: RIGHT S3 direction: LEFT S4 direction: LEFT in [i = V[0.0, 1.0, 0.0] j = V[0.0, 0.0, 1.0] n = V[1.0, 0.0, 0.0] o = V[0.0, 0.0, 0.0]]: S1 direction: PARALLEL --- 97,109 ---- S4 direction: LEFT in [i = V[0.0, 1.0, 0.0] j = V[1.0, 0.0, 0.0] n = V[0.0, 0.0, 1.0] o = V[0.0, 0.0, 0.0]]: S1 direction: RIGHT S2 direction: RIGHT S3 direction: LEFT S4 direction: LEFT + in [i = V[1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, -1.0] o = V[0.0, 0.0, 0.0]]: + S1 direction: LEFT + S2 direction: LEFT + S3 direction: RIGHT + S4 direction: RIGHT in [i = V[0.0, 1.0, 0.0] j = V[0.0, 0.0, 1.0] n = V[1.0, 0.0, 0.0] o = V[0.0, 0.0, 0.0]]: S1 direction: PARALLEL |
|
From: Michael L. <he...@us...> - 2006-12-08 13:37:11
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14599/src/net/sourceforge/bprocessor/model Modified Files: Surface.java CoordinateSystem.java Log Message: The turn direction of edges with respect to a coordinate-system now takes the orientation of the coordinatesystem into account. The sign of the determinant of a coordinatesystem determines the orientation of the coordinatesystem. The reference output of the directions test has been updated to reflect the above changes. Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.124 retrieving revision 1.125 diff -C2 -d -r1.124 -r1.125 *** Surface.java 8 Dec 2006 11:13:27 -0000 1.124 --- Surface.java 8 Dec 2006 13:37:09 -0000 1.125 *************** *** 64,71 **** /** ! * Find the turn direction of the edges ! * @param edges list of Edge ! * @param system CoordinateSystem ! * @return direction (LEFT or RIGHT) */ public static int direction(List edges, CoordinateSystem system) { --- 64,74 ---- /** ! * Returns the turn direction of a list of edges with respect to ! * a given coordinatesystem. LEFT means the edges runs counterclockwise ! * and RIGHT means clockwise when translated to the given coordinate-system. ! * The orientation of the coordinate-system is taken into account. ! * @param edges list of edges whose turn direction are to be calculated ! * @param system the reference coordinatesystem for calculating the turn direction. ! * @return turn direction of the edges with respect to the given coordinate-system */ public static int direction(List edges, CoordinateSystem system) { *************** *** 95,99 **** Vertex v = to.minus(common); Vertex cross = u.cross(v); ! double determinant = cross.getZ(); // if the cross points into the screen (along the negative z), // the vectors are doing a right turn. Otherwise they are doing --- 98,104 ---- Vertex v = to.minus(common); Vertex cross = u.cross(v); ! double determinant = system.determinant(); ! ! // if the cross points into the screen (along the negative z), // the vectors are doing a right turn. Otherwise they are doing *************** *** 101,112 **** // above code should ensure that does not happen assuming the // edges has a nonzero area. ! // Note the direction of the z-axis are not taken into account. ! // The coordinatesystem is treated as right-handed. ! ! if (determinant < 0) { return RIGHT; } ! if (determinant > 0) { return LEFT; } --- 106,117 ---- // above code should ensure that does not happen assuming the // edges has a nonzero area. + // The sign of the determinant of the coordinate-system determines + // the orientation of the coordinate-system: positive means right-handed + // and negative means left-handed. ! if (cross.getZ() * determinant < 0) { return RIGHT; } ! if (cross.getZ() * determinant > 0) { return LEFT; } Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** CoordinateSystem.java 30 Oct 2006 10:42:17 -0000 1.30 --- CoordinateSystem.java 8 Dec 2006 13:37:09 -0000 1.31 *************** *** 87,90 **** --- 87,103 ---- /** + * Computes the box-product of the vectors of this CoordinateSystem: + * box(i, j, n) = i * (j X n). + * The sign of the box-product determines the orientation: positive + * means right-handed and negative means left-handed. + * Zero means the vectors are linearly dependent in which case they + * do not really define a CoordinateSystem. + * @return the box product of the three vectors defining + * this CoordinateSystem (i * (j X n)) + */ + public double determinant() { + return i.dot(j.cross(n)); + } + /** * normalize vectors */ |
|
From: Michael L. <he...@us...> - 2006-12-08 13:37:10
|
Update of /cvsroot/bprocessor/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14544 Added Files: handedness.sh Log Message: The turn direction of edges with respect to a coordinate-system now takes the orientation of the coordinatesystem into account. The sign of the determinant of a coordinatesystem determines the orientation of the coordinatesystem. The reference output of the directions test has been updated to reflect the above changes. --- NEW FILE: handedness.sh --- #!/bin/sh CLASSPATH="dist/test.jar:lib/model.jar:lib/jaxb.jar:lib/log4j.jar" CLASS="net.sourceforge.bprocessor.test.HandedNess" echo '-- normal1 --' java -cp ${CLASSPATH} ${CLASS} input/normal1.xml echo '-- normal2 --' java -cp ${CLASSPATH} ${CLASS} input/normal2.xml echo '-- normal3 --' java -cp ${CLASSPATH} ${CLASS} input/normal3.xml |
|
From: Michael L. <he...@us...> - 2006-12-08 13:37:10
|
Update of /cvsroot/bprocessor/test/src/net/sourceforge/bprocessor/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14544/src/net/sourceforge/bprocessor/test Added Files: HandedNess.java Log Message: The turn direction of edges with respect to a coordinate-system now takes the orientation of the coordinatesystem into account. The sign of the determinant of a coordinatesystem determines the orientation of the coordinatesystem. The reference output of the directions test has been updated to reflect the above changes. --- NEW FILE: HandedNess.java --- //--------------------------------------------------------------------------------- // $Id: HandedNess.java,v 1.1 2006/12/08 13:37:05 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.test; import java.io.File; import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Persistence; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; /** * */ public class HandedNess { /** * Runs this test on the file named by args[0] * @param args arguments are filename */ public static void main(String[] args) { File input = new File(args[0]); try { Persistence.load(input); test(Project.getInstance().world().getSurfaces()); } catch (Exception e) { e.printStackTrace(); } } private static void test(Collection surfaces) { List sorted = new LinkedList(surfaces); Entity.sort(sorted); Vertex origin = new Vertex(0, 0, 0); Vertex i = new Vertex(1, 0, 0); Vertex j = new Vertex(0, 1, 0); Vertex k = new Vertex(0, 0, 1); System.out.println(" basics:"); System.out.println(" i * j X k = " + box(i, j, k)); System.out.println(" i * j X -k = " + box(i, j, origin.minus(k))); CoordinateSystem xy = new CoordinateSystem(i, j, k, origin); CoordinateSystem yx = new CoordinateSystem(j, i, k, origin); CoordinateSystem xynegz = new CoordinateSystem(i, j, origin.minus(k), origin); CoordinateSystem yz = new CoordinateSystem(j, k, i, origin); CoordinateSystem zx = new CoordinateSystem(k, i, j, origin); print(xy); print(yx); print(xynegz); print(yz); print(zx); print(sorted); } private static double box(Vertex i, Vertex j, Vertex k) { return i.dot(j.cross(k)); } private static double box(CoordinateSystem system) { return system.determinant(); } private static void print(CoordinateSystem system) { System.out.println(" " + system + " box = " + box(system)); } private static void print(List surfaces) { System.out.println(" surfaces own coordinate-systems:"); Iterator iter = surfaces.iterator(); while (iter.hasNext()) { Surface current = (Surface) iter.next(); CoordinateSystem system = current.coordinateSystem(); System.out.println(" " + current.getName() + ": " + system + " box = " + box(system)); } } } |
|
From: Michael L. <he...@us...> - 2006-12-08 11:13:28
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20421/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Surface.coordinateSystem() now returns a righthanded coordinate-system and the test set has been updated. Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.123 retrieving revision 1.124 diff -C2 -d -r1.123 -r1.124 *** Surface.java 8 Dec 2006 10:53:31 -0000 1.123 --- Surface.java 8 Dec 2006 11:13:27 -0000 1.124 *************** *** 1433,1437 **** i = e0.otherVertex(origin).minus(origin); i.scale(1 / i.length()); ! j = i.cross(n); if (j != null) { j.scale(1 / j.length()); --- 1433,1437 ---- i = e0.otherVertex(origin).minus(origin); i.scale(1 / i.length()); ! j = n.cross(i); if (j != null) { j.scale(1 / j.length()); |
|
From: Michael L. <he...@us...> - 2006-12-08 11:13:25
|
Update of /cvsroot/bprocessor/test/reference In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20413/reference Modified Files: directions.out Log Message: Surface.coordinateSystem() now returns a righthanded coordinate-system and the test set has been updated. Index: directions.out =================================================================== RCS file: /cvsroot/bprocessor/test/reference/directions.out,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** directions.out 8 Dec 2006 10:55:21 -0000 1.1 --- directions.out 8 Dec 2006 11:13:23 -0000 1.2 *************** *** 1,10 **** -- normal1 -- in own coordinate system: ! S1 direction: RIGHT in [i = V[0.0, 1.0, 0.0] j = V[-1.0, 0.0, 0.0] n = V[0.0, 0.0, -1.0] o = V1[1.0, 1.0, 0.0]] ! S2 direction: RIGHT in [i = V[0.0, 0.0, 1.0] j = V[0.0, -1.0, 0.0] n = V[-1.0, 0.0, 0.0] o = V1[1.0, 1.0, 0.0]] ! S3 direction: RIGHT in [i = V[0.0, 0.0, 1.0] j = V[-1.0, 0.0, 0.0] n = V[0.0, 1.0, 0.0] o = V2[1.0, 6.0, 0.0]] ! S4 direction: RIGHT in [i = V[0.0, 0.0, 1.0] j = V[-0.0, 1.0, 0.0] n = V[1.0, 0.0, -0.0] o = V3[6.0, 6.0, 0.0]] ! S5 direction: RIGHT in [i = V[0.0, 0.0, 1.0] j = V[1.0, 0.0, -0.0] n = V[0.0, -1.0, 0.0] o = V4[6.0, 1.0, 0.0]] ! S6 direction: RIGHT in [i = V[1.0, 0.0, 0.0] j = V[0.0, -1.0, 0.0] n = V[0.0, 0.0, 1.0] o = V5[1.0, 1.0, 5.0]] in [i = V[1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, 1.0] o = V[0.0, 0.0, 0.0]]: S1 direction: RIGHT --- 1,10 ---- -- normal1 -- in own coordinate system: ! S1 direction: LEFT in [i = V[0.0, 1.0, 0.0] j = V[1.0, -0.0, 0.0] n = V[0.0, 0.0, -1.0] o = V1[1.0, 1.0, 0.0]] ! S2 direction: LEFT in [i = V[0.0, 0.0, 1.0] j = V[0.0, 1.0, -0.0] n = V[-1.0, 0.0, 0.0] o = V1[1.0, 1.0, 0.0]] ! S3 direction: LEFT in [i = V[0.0, 0.0, 1.0] j = V[1.0, 0.0, 0.0] n = V[0.0, 1.0, 0.0] o = V2[1.0, 6.0, 0.0]] ! S4 direction: LEFT in [i = V[0.0, 0.0, 1.0] j = V[0.0, -1.0, 0.0] n = V[1.0, 0.0, -0.0] o = V3[6.0, 6.0, 0.0]] ! S5 direction: LEFT in [i = V[0.0, 0.0, 1.0] j = V[-1.0, 0.0, 0.0] n = V[0.0, -1.0, 0.0] o = V4[6.0, 1.0, 0.0]] ! S6 direction: LEFT in [i = V[1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, 1.0] o = V5[1.0, 1.0, 5.0]] in [i = V[1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, 1.0] o = V[0.0, 0.0, 0.0]]: S1 direction: RIGHT *************** *** 44,53 **** -- normal2 -- in own coordinate system: ! S1 direction: RIGHT in [i = V[0.0, 1.0, 0.0] j = V[-1.0, 0.0, 0.0] n = V[0.0, 0.0, -1.0] o = V2[1.0, 1.0, 5.0]] ! S2 direction: RIGHT in [i = V[0.0, 0.0, -1.0] j = V[0.0, -1.0, -0.0] n = V[1.0, -0.0, 0.0] o = V2[1.0, 1.0, 5.0]] ! S3 direction: RIGHT in [i = V[0.0, 0.0, -1.0] j = V[-1.0, -0.0, -0.0] n = V[0.0, -1.0, 0.0] o = V3[1.0, 6.0, 5.0]] ! S4 direction: RIGHT in [i = V[0.0, 0.0, -1.0] j = V[-0.0, 1.0, 0.0] n = V[-1.0, -0.0, -0.0] o = V4[6.0, 6.0, 5.0]] ! S5 direction: RIGHT in [i = V[0.0, 0.0, -1.0] j = V[1.0, -0.0, 0.0] n = V[0.0, 1.0, 0.0] o = V5[6.0, 1.0, 5.0]] ! S6 direction: RIGHT in [i = V[1.0, 0.0, 0.0] j = V[0.0, -1.0, 0.0] n = V[0.0, 0.0, 1.0] o = V6[1.0, 1.0, 0.0]] in [i = V[1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, 1.0] o = V[0.0, 0.0, 0.0]]: S1 direction: RIGHT --- 44,53 ---- -- normal2 -- in own coordinate system: ! S1 direction: LEFT in [i = V[0.0, 1.0, 0.0] j = V[1.0, -0.0, 0.0] n = V[0.0, 0.0, -1.0] o = V2[1.0, 1.0, 5.0]] ! S2 direction: LEFT in [i = V[0.0, 0.0, -1.0] j = V[0.0, 1.0, 0.0] n = V[1.0, -0.0, 0.0] o = V2[1.0, 1.0, 5.0]] ! S3 direction: LEFT in [i = V[0.0, 0.0, -1.0] j = V[1.0, 0.0, 0.0] n = V[0.0, -1.0, 0.0] o = V3[1.0, 6.0, 5.0]] ! S4 direction: LEFT in [i = V[0.0, 0.0, -1.0] j = V[0.0, -1.0, 0.0] n = V[-1.0, -0.0, -0.0] o = V4[6.0, 6.0, 5.0]] ! S5 direction: LEFT in [i = V[0.0, 0.0, -1.0] j = V[-1.0, 0.0, 0.0] n = V[0.0, 1.0, 0.0] o = V5[6.0, 1.0, 5.0]] ! S6 direction: LEFT in [i = V[1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, 1.0] o = V6[1.0, 1.0, 0.0]] in [i = V[1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, 1.0] o = V[0.0, 0.0, 0.0]]: S1 direction: RIGHT *************** *** 87,94 **** -- normal3 -- in own coordinate system: ! S1 direction: RIGHT in [i = V[-1.0, 0.0, 0.0] j = V[-0.0, -1.0, -0.0] n = V[0.0, 0.0, -1.0] o = V4[5.0, 1.0, 0.0]] ! S2 direction: RIGHT in [i = V[-1.0, 0.0, 0.0] j = V[-0.0, -1.0, -0.0] n = V[0.0, 0.0, -1.0] o = V10[10.0, 1.0, 0.0]] ! S3 direction: RIGHT in [i = V[0.0, -1.0, 0.0] j = V[-1.0, -0.0, 0.0] n = V[-0.0, 0.0, 1.0] o = V14[11.0, 5.0, 0.0]] ! S4 direction: RIGHT in [i = V[1.0, 0.0, 0.0] j = V[0.0, -1.0, 0.0] n = V[0.0, 0.0, 1.0] o = V20[16.0, 1.0, 0.0]] in [i = V[1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, 1.0] o = V[0.0, 0.0, 0.0]]: S1 direction: RIGHT --- 87,94 ---- -- normal3 -- in own coordinate system: ! S1 direction: LEFT in [i = V[-1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, -1.0] o = V4[5.0, 1.0, 0.0]] ! S2 direction: LEFT in [i = V[-1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, -1.0] o = V10[10.0, 1.0, 0.0]] ! S3 direction: LEFT in [i = V[0.0, -1.0, 0.0] j = V[1.0, 0.0, 0.0] n = V[-0.0, 0.0, 1.0] o = V14[11.0, 5.0, 0.0]] ! S4 direction: LEFT in [i = V[1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, 1.0] o = V20[16.0, 1.0, 0.0]] in [i = V[1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, 1.0] o = V[0.0, 0.0, 0.0]]: S1 direction: RIGHT |
|
From: Michael L. <he...@us...> - 2006-12-08 10:55:30
|
Update of /cvsroot/bprocessor/test/src/net/sourceforge/bprocessor/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13233/src/net/sourceforge/bprocessor/test Added Files: SurfaceDirection.java SurfaceNormal.java Removed Files: SurfaceAngle.java Log Message: Test for directions added (direction in wich edges are traversed around the boundary of a surface). --- NEW FILE: SurfaceNormal.java --- //--------------------------------------------------------------------------------- // $Id: SurfaceNormal.java,v 1.1 2006/12/08 10:55:20 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.test; import java.io.File; import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Persistence; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; /** * */ public class SurfaceNormal { /** * @param args args */ public static void main(String[] args) { File input = new File(args[0]); try { Persistence.load(input); printNormals(Project.getInstance().world().getSurfaces()); } catch (Exception e) { e.printStackTrace(); } } /** * Prints the normals of the surfaces * @param surfaces collection of Surface whose normals are to be printed */ private static void printNormals(Collection surfaces) { List sorted = new LinkedList(surfaces); Entity.sort(sorted); Iterator iter = sorted.iterator(); while (iter.hasNext()) { Surface current = (Surface) iter.next(); Vertex normal = current.normal(); System.out.println(current.getName() + " normal: " + normal); } } } --- SurfaceAngle.java DELETED --- --- NEW FILE: SurfaceDirection.java --- //--------------------------------------------------------------------------------- // $Id: SurfaceDirection.java,v 1.1 2006/12/08 10:55:20 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.test; import java.io.File; import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Persistence; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; /** * */ public class SurfaceDirection { /** * Runs this test on the file named by args[0] * @param args arguments are filename */ public static void main(String[] args) { File input = new File(args[0]); try { Persistence.load(input); test(Project.getInstance().world().getSurfaces()); } catch (Exception e) { e.printStackTrace(); } } private static void test(Collection surfaces) { List sorted = new LinkedList(surfaces); Entity.sort(sorted); Vertex origin = new Vertex(0, 0, 0); Vertex i = new Vertex(1, 0, 0); Vertex j = new Vertex(0, 1, 0); Vertex k = new Vertex(0, 0, 1); CoordinateSystem xy = new CoordinateSystem(i, j, k, origin); CoordinateSystem yx = new CoordinateSystem(j, i, k, origin); CoordinateSystem xynegz = new CoordinateSystem(i, j, origin.minus(k), origin); CoordinateSystem yz = new CoordinateSystem(j, k, i, origin); CoordinateSystem zx = new CoordinateSystem(k, i, j, origin); printDirections(sorted); printDirections(sorted, xy); printDirections(sorted, yx); printDirections(sorted, xynegz); printDirections(sorted, yz); printDirections(sorted, zx); } /** * Prints the direction of all surfaces in a list * translated to the CoordinateSystem * @param surfaces the list of surfaces whose directions are to be printed * @param system the CoordinateSystem to translate the surface to */ private static void printDirections(List surfaces, CoordinateSystem system) { System.out.println(" in " + system + ":"); Iterator iter = surfaces.iterator(); while (iter.hasNext()) { Surface current = (Surface) iter.next(); int direction = Surface.direction(current.getEdges(), system); if (direction == Surface.LEFT) { System.out.println(" " + current.getName() + " direction: LEFT"); } else if (direction == Surface.RIGHT) { System.out.println(" " + current.getName() + " direction: RIGHT"); } else if (direction == Surface.PARALLEL) { System.out.println(" " + current.getName() + " direction: PARALLEL"); } } } private static void printDirections(List surfaces) { System.out.println(" in own coordinate system:"); Iterator iter = surfaces.iterator(); while (iter.hasNext()) { Surface current = (Surface) iter.next(); CoordinateSystem system = current.coordinateSystem(); int direction = Surface.direction(current.getEdges(), system); if (direction == Surface.LEFT) { System.out.println(" " + current.getName() + " direction: LEFT in " + system); } else if (direction == Surface.RIGHT) { System.out.println(" " + current.getName() + " direction: RIGHT in " + system); } else if (direction == Surface.PARALLEL) { System.out.println(" " + current.getName() + " direction: PARALLEL in " + system); } } } } |
|
From: Michael L. <he...@us...> - 2006-12-08 10:55:30
|
Update of /cvsroot/bprocessor/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13233 Modified Files: normals.sh test.sh Added Files: directions.sh Log Message: Test for directions added (direction in wich edges are traversed around the boundary of a surface). Index: test.sh =================================================================== RCS file: /cvsroot/bprocessor/test/test.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test.sh 7 Dec 2006 00:24:45 -0000 1.3 --- test.sh 8 Dec 2006 10:55:21 -0000 1.4 *************** *** 14,17 **** ./normals.sh > output/normals.out - diff reference/normals.out output/normals.out --- 14,23 ---- ./normals.sh > output/normals.out diff reference/normals.out output/normals.out + + + echo ' * directions' + + ./directions.sh > output/directions.out + diff reference/directions.out output/directions.out + Index: normals.sh =================================================================== RCS file: /cvsroot/bprocessor/test/normals.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** normals.sh 7 Dec 2006 00:24:45 -0000 1.1 --- normals.sh 8 Dec 2006 10:55:21 -0000 1.2 *************** *** 2,6 **** CLASSPATH="dist/test.jar:lib/model.jar:lib/jaxb.jar:lib/log4j.jar" ! CLASS="net.sourceforge.bprocessor.test.SurfaceAngle" echo '-- normal1 --' --- 2,6 ---- CLASSPATH="dist/test.jar:lib/model.jar:lib/jaxb.jar:lib/log4j.jar" ! CLASS="net.sourceforge.bprocessor.test.SurfaceNormal" echo '-- normal1 --' --- NEW FILE: directions.sh --- #!/bin/sh CLASSPATH="dist/test.jar:lib/model.jar:lib/jaxb.jar:lib/log4j.jar" CLASS="net.sourceforge.bprocessor.test.SurfaceDirection" echo '-- normal1 --' java -cp ${CLASSPATH} ${CLASS} input/normal1.xml echo '-- normal2 --' java -cp ${CLASSPATH} ${CLASS} input/normal2.xml echo '-- normal3 --' java -cp ${CLASSPATH} ${CLASS} input/normal3.xml |
|
From: Michael L. <he...@us...> - 2006-12-08 10:55:30
|
Update of /cvsroot/bprocessor/test/input In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13233/input Added Files: words.txt Log Message: Test for directions added (direction in wich edges are traversed around the boundary of a surface). --- NEW FILE: words.txt --- Aarhus Aaron Ababa aback abaft abandon abandoned abandoning abandonment abandons abase abased abasement abasements abases abash abashed abashes abashing [...45365 lines suppressed...] Zoe Zomba zonal zonally zone zoned zones zoning zoo zoological zoologically zoom zooms zoos Zorn Zoroaster Zoroastrian Zulu Zulus Zurich |
|
From: Michael L. <he...@us...> - 2006-12-08 10:55:26
|
Update of /cvsroot/bprocessor/test/reference In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13233/reference Modified Files: normals.out Added Files: directions.out Log Message: Test for directions added (direction in wich edges are traversed around the boundary of a surface). Index: normals.out =================================================================== RCS file: /cvsroot/bprocessor/test/reference/normals.out,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** normals.out 7 Dec 2006 00:24:45 -0000 1.1 --- normals.out 8 Dec 2006 10:55:21 -0000 1.2 *************** *** 1,19 **** -- normal1 -- ! S1 normal: None[0.0, 0.0, -1.0] ! S2 normal: None[-1.0, 0.0, 0.0] ! S3 normal: None[0.0, 1.0, 0.0] ! S4 normal: None[1.0, 0.0, -0.0] ! S5 normal: None[0.0, -1.0, 0.0] ! S6 normal: None[0.0, 0.0, 1.0] -- normal2 -- ! S1 normal: None[0.0, 0.0, -1.0] ! S2 normal: None[1.0, -0.0, 0.0] ! S3 normal: None[0.0, -1.0, 0.0] ! S4 normal: None[-1.0, -0.0, -0.0] ! S5 normal: None[0.0, 1.0, 0.0] ! S6 normal: None[0.0, 0.0, 1.0] -- normal3 -- ! S1 normal: None[0.0, 0.0, -1.0] ! S2 normal: None[0.0, 0.0, -1.0] ! S3 normal: None[-0.0, 0.0, 1.0] ! S4 normal: None[0.0, 0.0, 1.0] --- 1,19 ---- -- normal1 -- ! S1 normal: V[0.0, 0.0, -1.0] ! S2 normal: V[-1.0, 0.0, 0.0] ! S3 normal: V[0.0, 1.0, 0.0] ! S4 normal: V[1.0, 0.0, -0.0] ! S5 normal: V[0.0, -1.0, 0.0] ! S6 normal: V[0.0, 0.0, 1.0] -- normal2 -- ! S1 normal: V[0.0, 0.0, -1.0] ! S2 normal: V[1.0, -0.0, 0.0] ! S3 normal: V[0.0, -1.0, 0.0] ! S4 normal: V[-1.0, -0.0, -0.0] ! S5 normal: V[0.0, 1.0, 0.0] ! S6 normal: V[0.0, 0.0, 1.0] -- normal3 -- ! S1 normal: V[0.0, 0.0, -1.0] ! S2 normal: V[0.0, 0.0, -1.0] ! S3 normal: V[-0.0, 0.0, 1.0] ! S4 normal: V[0.0, 0.0, 1.0] --- NEW FILE: directions.out --- -- normal1 -- in own coordinate system: S1 direction: RIGHT in [i = V[0.0, 1.0, 0.0] j = V[-1.0, 0.0, 0.0] n = V[0.0, 0.0, -1.0] o = V1[1.0, 1.0, 0.0]] S2 direction: RIGHT in [i = V[0.0, 0.0, 1.0] j = V[0.0, -1.0, 0.0] n = V[-1.0, 0.0, 0.0] o = V1[1.0, 1.0, 0.0]] S3 direction: RIGHT in [i = V[0.0, 0.0, 1.0] j = V[-1.0, 0.0, 0.0] n = V[0.0, 1.0, 0.0] o = V2[1.0, 6.0, 0.0]] S4 direction: RIGHT in [i = V[0.0, 0.0, 1.0] j = V[-0.0, 1.0, 0.0] n = V[1.0, 0.0, -0.0] o = V3[6.0, 6.0, 0.0]] S5 direction: RIGHT in [i = V[0.0, 0.0, 1.0] j = V[1.0, 0.0, -0.0] n = V[0.0, -1.0, 0.0] o = V4[6.0, 1.0, 0.0]] S6 direction: RIGHT in [i = V[1.0, 0.0, 0.0] j = V[0.0, -1.0, 0.0] n = V[0.0, 0.0, 1.0] o = V5[1.0, 1.0, 5.0]] in [i = V[1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, 1.0] o = V[0.0, 0.0, 0.0]]: S1 direction: RIGHT S2 direction: PARALLEL S3 direction: PARALLEL S4 direction: PARALLEL S5 direction: PARALLEL S6 direction: LEFT in [i = V[0.0, 1.0, 0.0] j = V[1.0, 0.0, 0.0] n = V[0.0, 0.0, 1.0] o = V[0.0, 0.0, 0.0]]: S1 direction: LEFT S2 direction: PARALLEL S3 direction: PARALLEL S4 direction: PARALLEL S5 direction: PARALLEL S6 direction: RIGHT in [i = V[1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, -1.0] o = V[0.0, 0.0, 0.0]]: S1 direction: RIGHT S2 direction: PARALLEL S3 direction: PARALLEL S4 direction: PARALLEL S5 direction: PARALLEL S6 direction: LEFT in [i = V[0.0, 1.0, 0.0] j = V[0.0, 0.0, 1.0] n = V[1.0, 0.0, 0.0] o = V[0.0, 0.0, 0.0]]: S1 direction: PARALLEL S2 direction: RIGHT S3 direction: PARALLEL S4 direction: LEFT S5 direction: PARALLEL S6 direction: PARALLEL in [i = V[0.0, 0.0, 1.0] j = V[1.0, 0.0, 0.0] n = V[0.0, 1.0, 0.0] o = V[0.0, 0.0, 0.0]]: S1 direction: PARALLEL S2 direction: PARALLEL S3 direction: LEFT S4 direction: PARALLEL S5 direction: RIGHT S6 direction: PARALLEL -- normal2 -- in own coordinate system: S1 direction: RIGHT in [i = V[0.0, 1.0, 0.0] j = V[-1.0, 0.0, 0.0] n = V[0.0, 0.0, -1.0] o = V2[1.0, 1.0, 5.0]] S2 direction: RIGHT in [i = V[0.0, 0.0, -1.0] j = V[0.0, -1.0, -0.0] n = V[1.0, -0.0, 0.0] o = V2[1.0, 1.0, 5.0]] S3 direction: RIGHT in [i = V[0.0, 0.0, -1.0] j = V[-1.0, -0.0, -0.0] n = V[0.0, -1.0, 0.0] o = V3[1.0, 6.0, 5.0]] S4 direction: RIGHT in [i = V[0.0, 0.0, -1.0] j = V[-0.0, 1.0, 0.0] n = V[-1.0, -0.0, -0.0] o = V4[6.0, 6.0, 5.0]] S5 direction: RIGHT in [i = V[0.0, 0.0, -1.0] j = V[1.0, -0.0, 0.0] n = V[0.0, 1.0, 0.0] o = V5[6.0, 1.0, 5.0]] S6 direction: RIGHT in [i = V[1.0, 0.0, 0.0] j = V[0.0, -1.0, 0.0] n = V[0.0, 0.0, 1.0] o = V6[1.0, 1.0, 0.0]] in [i = V[1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, 1.0] o = V[0.0, 0.0, 0.0]]: S1 direction: RIGHT S2 direction: PARALLEL S3 direction: PARALLEL S4 direction: PARALLEL S5 direction: PARALLEL S6 direction: LEFT in [i = V[0.0, 1.0, 0.0] j = V[1.0, 0.0, 0.0] n = V[0.0, 0.0, 1.0] o = V[0.0, 0.0, 0.0]]: S1 direction: LEFT S2 direction: PARALLEL S3 direction: PARALLEL S4 direction: PARALLEL S5 direction: PARALLEL S6 direction: RIGHT in [i = V[1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, -1.0] o = V[0.0, 0.0, 0.0]]: S1 direction: RIGHT S2 direction: PARALLEL S3 direction: PARALLEL S4 direction: PARALLEL S5 direction: PARALLEL S6 direction: LEFT in [i = V[0.0, 1.0, 0.0] j = V[0.0, 0.0, 1.0] n = V[1.0, 0.0, 0.0] o = V[0.0, 0.0, 0.0]]: S1 direction: PARALLEL S2 direction: LEFT S3 direction: PARALLEL S4 direction: RIGHT S5 direction: PARALLEL S6 direction: PARALLEL in [i = V[0.0, 0.0, 1.0] j = V[1.0, 0.0, 0.0] n = V[0.0, 1.0, 0.0] o = V[0.0, 0.0, 0.0]]: S1 direction: PARALLEL S2 direction: PARALLEL S3 direction: RIGHT S4 direction: PARALLEL S5 direction: LEFT S6 direction: PARALLEL -- normal3 -- in own coordinate system: S1 direction: RIGHT in [i = V[-1.0, 0.0, 0.0] j = V[-0.0, -1.0, -0.0] n = V[0.0, 0.0, -1.0] o = V4[5.0, 1.0, 0.0]] S2 direction: RIGHT in [i = V[-1.0, 0.0, 0.0] j = V[-0.0, -1.0, -0.0] n = V[0.0, 0.0, -1.0] o = V10[10.0, 1.0, 0.0]] S3 direction: RIGHT in [i = V[0.0, -1.0, 0.0] j = V[-1.0, -0.0, 0.0] n = V[-0.0, 0.0, 1.0] o = V14[11.0, 5.0, 0.0]] S4 direction: RIGHT in [i = V[1.0, 0.0, 0.0] j = V[0.0, -1.0, 0.0] n = V[0.0, 0.0, 1.0] o = V20[16.0, 1.0, 0.0]] in [i = V[1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, 1.0] o = V[0.0, 0.0, 0.0]]: S1 direction: RIGHT S2 direction: RIGHT S3 direction: LEFT S4 direction: LEFT in [i = V[0.0, 1.0, 0.0] j = V[1.0, 0.0, 0.0] n = V[0.0, 0.0, 1.0] o = V[0.0, 0.0, 0.0]]: S1 direction: LEFT S2 direction: LEFT S3 direction: RIGHT S4 direction: RIGHT in [i = V[1.0, 0.0, 0.0] j = V[0.0, 1.0, 0.0] n = V[0.0, 0.0, -1.0] o = V[0.0, 0.0, 0.0]]: S1 direction: RIGHT S2 direction: RIGHT S3 direction: LEFT S4 direction: LEFT in [i = V[0.0, 1.0, 0.0] j = V[0.0, 0.0, 1.0] n = V[1.0, 0.0, 0.0] o = V[0.0, 0.0, 0.0]]: S1 direction: PARALLEL S2 direction: PARALLEL S3 direction: PARALLEL S4 direction: PARALLEL in [i = V[0.0, 0.0, 1.0] j = V[1.0, 0.0, 0.0] n = V[0.0, 1.0, 0.0] o = V[0.0, 0.0, 0.0]]: S1 direction: PARALLEL S2 direction: PARALLEL S3 direction: PARALLEL S4 direction: PARALLEL |
|
From: Michael L. <he...@us...> - 2006-12-08 10:55:22
|
Update of /cvsroot/bprocessor/test/.settings In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13233/.settings Added Files: org.eclipse.core.resources.prefs Log Message: Test for directions added (direction in wich edges are traversed around the boundary of a surface). --- NEW FILE: org.eclipse.core.resources.prefs --- #Wed Dec 06 11:17:41 CET 2006 eclipse.preferences.version=1 encoding//input/words.txt=ISO-8859-1 |
|
From: Michael L. <he...@us...> - 2006-12-08 10:55:17
|
Update of /cvsroot/bprocessor/test/.settings In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13218/.settings Log Message: Directory /cvsroot/bprocessor/test/.settings added to the repository |
|
From: Michael L. <he...@us...> - 2006-12-08 10:53:33
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12402/src/net/sourceforge/bprocessor/model Modified Files: Vertex.java Surface.java Log Message: Name of vertex change to V instead of None when id is null Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.122 retrieving revision 1.123 diff -C2 -d -r1.122 -r1.123 *** Surface.java 7 Dec 2006 23:05:58 -0000 1.122 --- Surface.java 8 Dec 2006 10:53:31 -0000 1.123 *************** *** 101,104 **** --- 101,108 ---- // above code should ensure that does not happen assuming the // edges has a nonzero area. + + // Note the direction of the z-axis are not taken into account. + // The coordinatesystem is treated as right-handed. + if (determinant < 0) { return RIGHT; Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** Vertex.java 5 Dec 2006 09:06:17 -0000 1.51 --- Vertex.java 8 Dec 2006 10:53:31 -0000 1.52 *************** *** 101,105 **** String name; if (id == null) { ! name = "None"; } else { name = "V" + id; --- 101,105 ---- String name; if (id == null) { ! name = "V"; } else { name = "V" + id; |
|
From: Michael L. <he...@us...> - 2006-12-07 23:06:04
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29685/src/net/sourceforge/bprocessor/gl/tool Modified Files: PencilTool.java Log Message: Moved direction(edges, system) from PencilTool to Surface Index: PencilTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/PencilTool.java,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** PencilTool.java 5 Dec 2006 15:21:13 -0000 1.69 --- PencilTool.java 7 Dec 2006 23:06:02 -0000 1.70 *************** *** 436,446 **** if (edges.size() > 2) { System.out.println("left surface:" + edges); ! int turn = direction(edges, system); ! if (turn == LEFT) { System.out.println("turns left"); Surface surface = new Surface(edges); Project.getInstance().getActiveSpace().add(surface); } ! if (turn == RIGHT) { System.out.println("turns right"); } --- 436,446 ---- if (edges.size() > 2) { System.out.println("left surface:" + edges); ! int turn = Surface.direction(edges, system); ! if (turn == Surface.LEFT) { System.out.println("turns left"); Surface surface = new Surface(edges); Project.getInstance().getActiveSpace().add(surface); } ! if (turn == Surface.RIGHT) { System.out.println("turns right"); } *************** *** 463,471 **** if (edges.size() > 2) { System.out.println("right surface:" + edges); ! int turn = direction(edges, system); ! if (turn == LEFT) { System.out.println("turns left"); } ! if (turn == RIGHT) { System.out.println("turns right"); Surface surface = new Surface(edges); --- 463,471 ---- if (edges.size() > 2) { System.out.println("right surface:" + edges); ! int turn = Surface.direction(edges, system); ! if (turn == Surface.LEFT) { System.out.println("turns left"); } ! if (turn == Surface.RIGHT) { System.out.println("turns right"); Surface surface = new Surface(edges); *************** *** 476,533 **** } - /** LEFT means counterclockwise */ - public static final int LEFT = 1; - /** RIGHT means clockwise */ - public static final int RIGHT = 2; - /** PARALLEL means not turning */ - public static final int PARALLEL = 3; - - /** - * Find the turn direction of the edges - * @param edges list of Edge - * @param system CoordinateSystem - * @return direction (LEFT or RIGHT) - */ - public 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(); - Vertex v = Edge.commonVertex(previous, current); - v = system.translate(v); - if (v.getY() <= y) { - y = v.getY(); - e1 = previous; - e2 = current; - } - previous = current; - } - Vertex common = Edge.commonVertex(e1, e2); - Vertex from = e1.otherVertex(common); - Vertex to = e2.otherVertex(common); - from = system.translate(from); - common = system.translate(common); - to = system.translate(to); - Vertex u = common.minus(from); - Vertex v = to.minus(common); - Vertex cross = u.cross(v); - double determinant = cross.getZ(); - // if the cross points into the screen (along the negative z), - // the vectors are doing a right turn. Otherwise they are doing - // a left turn. If the cross are zero, they er parallel, but the - // above code should ensure that does not happen assuming the - // edges has a nonzero area. - if (determinant < 0) { - return RIGHT; - } - if (determinant > 0) { - return LEFT; - } - return PARALLEL; - } - /** * VertexNode --- 476,479 ---- |
|
From: Michael L. <he...@us...> - 2006-12-07 23:05:59
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29674/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Moved direction(edges, system) from PencilTool to Surface Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** Surface.java 7 Dec 2006 00:24:50 -0000 1.121 --- Surface.java 7 Dec 2006 23:05:58 -0000 1.122 *************** *** 22,62 **** /** ! * The surface ! * @hibernate.class ! * table="SURFACE" ! * lazy="false" ! * @hibernate.cache ! * usage="read-write" */ public class Surface extends Geometric implements Parametric { - /** Default */ private static final long serialVersionUID = 1L; ! ! /** The logger */ private static Logger log = Logger.getLogger(Surface.class); ! ! /** Constructor */ private boolean constructor; ! ! /** The edges relationship */ private List edges; ! /** The holes of this surface */ private Set holes; - /** The domain in front of the surface */ private Space frontDomain; - /** The domain behind the surface */ private Space backDomain; - /** The material on the frontside of the surface */ private Material frontMaterial; - /** The material on the backside of the surface */ private Material backMaterial; ! /** The exterior surface if this is a hole */ ! private Surface exterior; /** --- 22,112 ---- /** ! * Surface is defined by its list of boundary edges, and are related ! * to other surfaces through a hole-exterior relationship. ! * ! * The front and back spaces are the spaces on each side of the surface. ! * The front is defined as the space at the side the normal points into. ! * When viewing the surface from the side of the normal, the edges runs ! * counterclockwise around the surface. ! * ! * The front and back material specifies the color front and back side ! * of the surface (and possibly texture etc. ! * in a future version). */ public class Surface extends Geometric implements Parametric { private static final long serialVersionUID = 1L; ! private static Logger log = Logger.getLogger(Surface.class); ! private boolean constructor; ! private List edges; ! private Surface exterior; ! private Set holes; private Space frontDomain; private Space backDomain; private Material frontMaterial; private Material backMaterial; ! ! /** LEFT means counterclockwise */ ! public static final int LEFT = 1; ! /** RIGHT means clockwise */ ! public static final int RIGHT = 2; ! /** PARALLEL means not turning */ ! public static final int PARALLEL = 3; ! ! /** ! * Find the turn direction of the edges ! * @param edges list of Edge ! * @param system CoordinateSystem ! * @return direction (LEFT or RIGHT) ! */ ! 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(); ! Vertex v = Edge.commonVertex(previous, current); ! v = system.translate(v); ! if (v.getY() <= y) { ! y = v.getY(); ! e1 = previous; ! e2 = current; ! } ! previous = current; ! } ! Vertex common = Edge.commonVertex(e1, e2); ! Vertex from = e1.otherVertex(common); ! Vertex to = e2.otherVertex(common); ! from = system.translate(from); ! common = system.translate(common); ! to = system.translate(to); ! Vertex u = common.minus(from); ! Vertex v = to.minus(common); ! Vertex cross = u.cross(v); ! double determinant = cross.getZ(); ! // if the cross points into the screen (along the negative z), ! // the vectors are doing a right turn. Otherwise they are doing ! // a left turn. If the cross are zero, they er parallel, but the ! // above code should ensure that does not happen assuming the ! // edges has a nonzero area. ! if (determinant < 0) { ! return RIGHT; ! } ! if (determinant > 0) { ! return LEFT; ! } ! return PARALLEL; ! } /** |
|
From: Michael L. <he...@us...> - 2006-12-07 13:48:14
|
Update of /cvsroot/bprocessor/tools/checkstyle In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20868/checkstyle Modified Files: checkstyle.xml Log Message: Relaxes the style policy on javadoc comments Ð they are now only enforced on public types, fields and methods. Note: use /** {@inheritDoc} */ on overriding methods. Index: checkstyle.xml =================================================================== RCS file: /cvsroot/bprocessor/tools/checkstyle/checkstyle.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** checkstyle.xml 9 Aug 2006 13:46:14 -0000 1.4 --- checkstyle.xml 7 Dec 2006 13:48:03 -0000 1.5 *************** *** 56,66 **** <!-- JavaDoc guidelines --> <module name="JavadocMethod"> ! <property name="scope" value="private"/> </module> <module name="JavadocVariable"> ! <property name="scope" value="private"/> </module> <module name="JavadocType"> ! <property name="scope" value="private"/> </module> --- 56,66 ---- <!-- JavaDoc guidelines --> <module name="JavadocMethod"> ! <property name="scope" value="public"/> </module> <module name="JavadocVariable"> ! <property name="scope" value="public"/> </module> <module name="JavadocType"> ! <property name="scope" value="public"/> </module> |
|
From: Michael L. <he...@us...> - 2006-12-07 12:27:53
|
Update of /cvsroot/bprocessor/build In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20430 Modified Files: nightly.sh Log Message: Updates test as well Index: nightly.sh =================================================================== RCS file: /cvsroot/bprocessor/build/nightly.sh,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** nightly.sh 6 Dec 2006 00:08:45 -0000 1.6 --- nightly.sh 7 Dec 2006 12:27:51 -0000 1.7 *************** *** 40,43 **** --- 40,45 ---- cd ${root}/tools cvs -q update -dP + cd ${root}/test + cvs -q update -dP cd ${root}/build |
|
From: Michael L. <he...@us...> - 2006-12-07 00:24:58
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26167/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Preserves ordering of created surfaces in extrusion Added test of normal calculations as preperation for improved version Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.120 retrieving revision 1.121 diff -C2 -d -r1.120 -r1.121 *** Surface.java 2 Nov 2006 14:45:38 -0000 1.120 --- Surface.java 7 Dec 2006 00:24:50 -0000 1.121 *************** *** 490,494 **** * @return Extruded top */ ! public Surface extrusionall(double delta, Set sides, Set tops) { Surface top = extrusion(delta, sides); tops.add(top); --- 490,494 ---- * @return Extruded top */ ! public Surface extrusionall(double delta, Collection sides, Set tops) { Surface top = extrusion(delta, sides); tops.add(top); *************** *** 508,512 **** * @return Top */ ! public Surface extrusion(double delta, Set sides) { Vertex normal = normal(); normal.scale(delta); --- 508,512 ---- * @return Top */ ! public Surface extrusion(double delta, Collection sides) { Vertex normal = normal(); normal.scale(delta); |
|
From: Michael L. <he...@us...> - 2006-12-07 00:24:55
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26181/src/net/sourceforge/bprocessor/gl/tool Modified Files: ExtrusionTool.java Log Message: Preserves ordering of created surfaces in extrusion Added test of normal calculations as preperation for improved version Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** ExtrusionTool.java 15 Nov 2006 09:53:17 -0000 1.43 --- ExtrusionTool.java 7 Dec 2006 00:24:53 -0000 1.44 *************** *** 94,98 **** } extrusion = new LinkedList(); ! Set sides = new HashSet(); Set tops = new HashSet(); if (all) { --- 94,98 ---- } extrusion = new LinkedList(); ! Collection sides = new LinkedList(); Set tops = new HashSet(); if (all) { |
|
From: Michael L. <he...@us...> - 2006-12-07 00:24:54
|
Update of /cvsroot/bprocessor/test/reference In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26131/reference Added Files: normals.out Log Message: Preserves ordering of created surfaces in extrusion Added test of normal calculations as preperation for improved version --- NEW FILE: normals.out --- -- normal1 -- S1 normal: None[0.0, 0.0, -1.0] S2 normal: None[-1.0, 0.0, 0.0] S3 normal: None[0.0, 1.0, 0.0] S4 normal: None[1.0, 0.0, -0.0] S5 normal: None[0.0, -1.0, 0.0] S6 normal: None[0.0, 0.0, 1.0] -- normal2 -- S1 normal: None[0.0, 0.0, -1.0] S2 normal: None[1.0, -0.0, 0.0] S3 normal: None[0.0, -1.0, 0.0] S4 normal: None[-1.0, -0.0, -0.0] S5 normal: None[0.0, 1.0, 0.0] S6 normal: None[0.0, 0.0, 1.0] -- normal3 -- S1 normal: None[0.0, 0.0, -1.0] S2 normal: None[0.0, 0.0, -1.0] S3 normal: None[-0.0, 0.0, 1.0] S4 normal: None[0.0, 0.0, 1.0] |
|
From: Michael L. <he...@us...> - 2006-12-07 00:24:53
|
Update of /cvsroot/bprocessor/test/src/net/sourceforge/bprocessor/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26131/src/net/sourceforge/bprocessor/test Added Files: SurfaceAngle.java Log Message: Preserves ordering of created surfaces in extrusion Added test of normal calculations as preperation for improved version --- NEW FILE: SurfaceAngle.java --- //--------------------------------------------------------------------------------- // $Id: SurfaceAngle.java,v 1.1 2006/12/07 00:24:45 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.test; import java.io.File; import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Persistence; import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; /** * */ public class SurfaceAngle { /** * @param args args */ public static void main(String[] args) { File input = new File(args[0]); try { Persistence.load(input); printNormals(Project.getInstance().world().getSurfaces()); } catch (Exception e) { e.printStackTrace(); } } /** * Prints the normals of the surfaces * @param surfaces collection of Surface whose normals are to be printed */ private static void printNormals(Collection surfaces) { List sorted = new LinkedList(surfaces); Entity.sort(sorted); Iterator iter = sorted.iterator(); while (iter.hasNext()) { Surface current = (Surface) iter.next(); Vertex normal = current.normal(); System.out.println(current.getName() + " normal: " + normal); } } } |
|
From: Michael L. <he...@us...> - 2006-12-07 00:24:53
|
Update of /cvsroot/bprocessor/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv26131 Modified Files: test.sh Added Files: normals.sh Log Message: Preserves ordering of created surfaces in extrusion Added test of normal calculations as preperation for improved version Index: test.sh =================================================================== RCS file: /cvsroot/bprocessor/test/test.sh,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test.sh 5 Dec 2006 20:42:01 -0000 1.2 --- test.sh 7 Dec 2006 00:24:45 -0000 1.3 *************** *** 4,7 **** --- 4,9 ---- CLASS="net.sourceforge.bprocessor.test.LoadSave" + echo ' * load/save' + java -cp ${CLASSPATH} ${CLASS} input/model1.xml output/output1.xml java -cp ${CLASSPATH} ${CLASS} output/output1.xml output/output2.xml *************** *** 9,11 **** --- 11,17 ---- diff output/output1.xml output/output2.xml + echo ' * normals' + + ./normals.sh > output/normals.out + diff reference/normals.out output/normals.out --- NEW FILE: normals.sh --- #!/bin/sh CLASSPATH="dist/test.jar:lib/model.jar:lib/jaxb.jar:lib/log4j.jar" CLASS="net.sourceforge.bprocessor.test.SurfaceAngle" echo '-- normal1 --' java -cp ${CLASSPATH} ${CLASS} input/normal1.xml echo '-- normal2 --' java -cp ${CLASSPATH} ${CLASS} input/normal2.xml echo '-- normal3 --' java -cp ${CLASSPATH} ${CLASS} input/normal3.xml |