[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Surface.java, 1.186, 1.187
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2007-10-03 10:01:32
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv358/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Minor improvement to controlledExtrude to make vertexes bound by another surface follow the surface and not just the normal of the extrude surface. Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.186 retrieving revision 1.187 diff -C2 -d -r1.186 -r1.187 *** Surface.java 2 Oct 2007 06:41:57 -0000 1.186 --- Surface.java 3 Oct 2007 10:01:19 -0000 1.187 *************** *** 1061,1071 **** } if (isVertexBounded(v[i]) || (isRootExtrusion && isInner())) { if (v2dir.containsKey(v[i])) { Direction d = (Direction)v2dir.get(v[i]); vmap[i] = d.getVertex(); ! d.alterDirection(normal); } else { vmap[i] = v[i].copy(); ! v2dir.put(v[i], new Direction(vmap[i], normal, min, max)); } } else { --- 1061,1086 ---- } if (isVertexBounded(v[i]) || (isRootExtrusion && isInner())) { + Vertex tempNormal = normal; + Surface bound = null; + for (Surface s : v[i].getSurfaces()) { + if (s != this) { + double dot = s.normal().dot(normal); + if (dot > -0.9 && dot < 0.9) { + bound = s; + } + } + } + if (bound != null) { + Vertex boundNormal = bound.normal(); + Vertex along = boundNormal.cross(tempNormal); + tempNormal = along.cross(boundNormal); + } if (v2dir.containsKey(v[i])) { Direction d = (Direction)v2dir.get(v[i]); vmap[i] = d.getVertex(); ! d.alterDirection(tempNormal); } else { vmap[i] = v[i].copy(); ! v2dir.put(v[i], new Direction(vmap[i], tempNormal, min, max)); } } else { |