[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Surface.java,1.70,1.71 Geometry.java,
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2006-02-02 14:18:44
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29701/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Geometry.java Log Message: Surface.normal() is normalized Ð length() = 1 Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** Surface.java 2 Feb 2006 12:15:09 -0000 1.70 --- Surface.java 2 Feb 2006 14:18:35 -0000 1.71 *************** *** 357,362 **** public Surface extrude(double delta, Set sides) { Vertex normal = normal(); - normal.scale(delta / normal.length()); List vertices = getVertices(); --- 357,362 ---- public Surface extrude(double delta, Set sides) { Vertex normal = normal(); + normal.scale(delta); List vertices = getVertices(); *************** *** 425,431 **** if (exterior != null) { Vertex n0 = normal(); - n0.scale(1 / n0.length()); Vertex n1 = exterior.normal(); - n1.scale(1 / n1.length()); Vertex o = n0.add(n1); if (o.isZero()) { --- 425,429 ---- *************** *** 726,731 **** double d = 0; Vertex n = normal(); - double l = n.length(); - n.scale(1 / l); double a = n.getX(); double b = n.getY(); --- 724,727 ---- Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Geometry.java 2 Feb 2006 12:15:09 -0000 1.13 --- Geometry.java 2 Feb 2006 14:18:35 -0000 1.14 *************** *** 41,44 **** --- 41,45 ---- normal.scale(-1); } + normal.scale(1 / normal.length()); return normal; } *************** *** 280,288 **** Iterator iter = surfaces.iterator(); Vertex normal = exterior.normal(); - normal.scale(1 / normal.length()); while (iter.hasNext()) { Surface current = (Surface) iter.next(); Vertex n = current.normal(); - n.scale(1 / n.length()); Vertex o = n.add(normal); if (o.isZero()) { --- 281,287 ---- |