[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Surface.java,1.17,1.18
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2005-09-01 13:16:19
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23320/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Implemented Surface.coordinateSystem() Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Surface.java 1 Sep 2005 12:44:01 -0000 1.17 --- Surface.java 1 Sep 2005 13:16:12 -0000 1.18 *************** *** 228,231 **** --- 228,232 ---- } + /** * Returns the normal to this *************** *** 234,262 **** public Vertex normal() { if (edges.size() > 1) { ! EdgeFacade ef = EdgeFacade.getInstance(); ! Edge e1 = ef.findById(((Edge)edges.get(0)).getId()); ! Edge e2 = ef.findById(((Edge)edges.get(1)).getId()); ! Vertex v1 = e1.getFrom(); ! Vertex v2 = e1.getTo(); ! Vertex v3 = null; ! ! if (e2.otherVertex(v1) == null) { ! v3 = e2.otherVertex(v2); ! // v2 is the center ! Vertex v2v1 = v2.minus(v1); ! Vertex v2v3 = v2.minus(v3); ! return v2v3.cross(v2v1); ! } else if (e2.otherVertex(v2) == null) { ! // v1 is the center ! v3 = e2.otherVertex(v1); ! Vertex v1v2 = v1.minus(v2); ! Vertex v1v3 = v1.minus(v3); ! return v1v3.cross(v1v2); ! } return null; } - return null; } - /** * Returns the Plane that this Surface lies in --- 235,247 ---- public Vertex normal() { if (edges.size() > 1) { ! Edge e0 = (Edge) edges.get(0); ! Edge e1 = (Edge) edges.get(1); ! Vertex v0 = e0.getTo().minus(e0.getFrom()); ! Vertex v1 = e1.getTo().minus(e1.getFrom()); ! return v0.cross(v1); ! } else { return null; } } /** * Returns the Plane that this Surface lies in *************** *** 289,297 **** Edge e1 = (Edge) edges.get(1); origin = e0.getFrom(); ! Vertex p = e0.getTo(); ! Vertex q = e1.otherVertex(p); ! i = p.minus(origin); i.scale(1 / i.length()); ! Vertex v = q.minus(p); n = i.cross(v); n.scale(1 / n.length()); --- 274,280 ---- Edge e1 = (Edge) edges.get(1); origin = e0.getFrom(); ! i = e0.getTo().minus(origin);; i.scale(1 / i.length()); ! Vertex v = e1.getTo().minus(e1.getFrom()); n = i.cross(v); n.scale(1 / n.length()); |