bprocessor-commit Mailing List for B-processor (Page 71)
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: Nordholt <nor...@us...> - 2007-03-29 13:50:23
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27401/src/net/sourceforge/bprocessor/gl/tool Modified Files: ConstructorTool.java Log Message: removed unused fields Index: ConstructorTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ConstructorTool.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ConstructorTool.java 15 Nov 2006 09:53:17 -0000 1.13 --- ConstructorTool.java 29 Mar 2007 13:50:08 -0000 1.14 *************** *** 33,42 **** private Intersection p2; - /** P3 */ - private Intersection p3; - - /** P4 */ - private Intersection p4; - /** * Constructor for ConstructorTool --- 33,36 ---- |
|
From: Michael L. <he...@us...> - 2007-03-29 12:51:06
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2693/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: Removed unused code Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.148 retrieving revision 1.149 diff -C2 -d -r1.148 -r1.149 *** Surface.java 28 Mar 2007 21:33:08 -0000 1.148 --- Surface.java 29 Mar 2007 12:51:05 -0000 1.149 *************** *** 1095,1100 **** Vertex other = hole.normal(); double dot = normal.dot(other); - Space front = getFrontDomain(); - Space back = getBackDomain(); if (dot < 0) { /* If the normal of the hole is not the same the hole is reversed */ --- 1095,1098 ---- *************** *** 1106,1119 **** hole.setBackDomain(holeFront); } - if (getOwner() != null) { - // If there are no front space assignments, make one - if (hole.getFrontDomain() == getOwner().getEmpty()) { - //hole.setFrontDomain(front); - } - // If there are no back space assignments, make one - if (hole.getBackDomain() == getOwner().getEmpty()) { - //hole.setBackDomain(back); - } - } } --- 1104,1107 ---- |
|
From: Michael L. <he...@us...> - 2007-03-29 12:38:21
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30379/src/net/sourceforge/bprocessor/gl/tool Modified Files: ExtrusionTool.java Log Message: Removed unused import Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** ExtrusionTool.java 29 Mar 2007 10:10:57 -0000 1.53 --- ExtrusionTool.java 29 Mar 2007 12:38:20 -0000 1.54 *************** *** 21,25 **** import net.sourceforge.bprocessor.gl.view.Transformation; import net.sourceforge.bprocessor.gl.view.View; - import net.sourceforge.bprocessor.gui.GUI; import net.sourceforge.bprocessor.model.Constructor; import net.sourceforge.bprocessor.model.Edge; --- 21,24 ---- |
|
From: Michael L. <he...@us...> - 2007-03-29 10:11:01
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3568/src/net/sourceforge/bprocessor/gl/tool Modified Files: ExtrusionTool.java Log Message: Uses new mesh-insertion in extrude tool Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** ExtrusionTool.java 28 Mar 2007 08:59:30 -0000 1.52 --- ExtrusionTool.java 29 Mar 2007 10:10:57 -0000 1.53 *************** *** 27,30 **** --- 27,31 ---- import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Line; + import net.sourceforge.bprocessor.model.Mesh; import net.sourceforge.bprocessor.model.Plane; import net.sourceforge.bprocessor.model.Project; *************** *** 88,94 **** */ private void insert(Space space, Collection<Surface> extrusion) { ! for (Surface surface : extrusion) { ! space.insert(surface); ! } space.changed(); } --- 89,96 ---- */ private void insert(Space space, Collection<Surface> extrusion) { ! Collection<Edge> edges = Surface.edges(extrusion); ! Collection<Vertex> vertices = Edge.vertices(edges); ! Mesh mesh = new Mesh(extrusion, edges, vertices); ! space.insert(mesh); space.changed(); } *************** *** 338,344 **** protected void pressed(MouseEvent e) { if (!Selection.primary().isEmpty()) { - // some of the selction should be extruded if (extrudeEdges == null) { - // The extrusion havn't started yet extrudeEdges = new ArrayList<Edge>(); for (Object o : Selection.primary()) { --- 340,344 ---- *************** *** 346,350 **** extrudeEdges.add((Edge) o); } else { - GUI.getInstance().alert("Selection isn't extrudable, due to other elements than edges"); extrudeEdges.clear(); } --- 346,349 ---- *************** *** 365,369 **** Plane plane = new Plane(0, 0, 1, extrudeEdges.get(0).getFrom()); dragplane = plane.orthogonalPlane(ray); - //from = view.toPlaneCoords(startx, starty, dragplane); active = true; start = findIntersection(e); --- 364,367 ---- *************** *** 371,375 **** } } else { - // finish the extrusion if (extrusion != null) { if (ontoPlane != null) { --- 369,372 ---- *************** *** 384,388 **** } } else { - // look at the mouse target if (extrudesurface == null) { findTarget(e); --- 381,384 ---- |
|
From: Michael L. <he...@us...> - 2007-03-29 10:01:12
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31980/src/net/sourceforge/bprocessor/model Modified Files: Geometry.java Log Message: RectTool uses new mesh-insertion Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** Geometry.java 28 Mar 2007 09:00:47 -0000 1.48 --- Geometry.java 29 Mar 2007 10:00:53 -0000 1.49 *************** *** 425,444 **** * @return List of the surfaces created (empty list if none) */ ! public static List insertEdges(List edges) { Space space = Project.getInstance().getActiveSpace(); ! List result = new LinkedList(); ! List actual = new LinkedList(); ! { ! Iterator iter = edges.iterator(); ! while (iter.hasNext()) { ! Edge current = (Edge) iter.next(); ! Edge edge = space.insert(current); ! if (edge != null) { ! actual.add(edge); ! } ! } ! } ! SurfaceAnalysis analysis = new SurfaceAnalysis(); ! analysis.surfaceAnalysis(space, actual); Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); --- 425,436 ---- * @return List of the surfaces created (empty list if none) */ ! public static List insertEdges(List<Edge> edges) { Space space = Project.getInstance().getActiveSpace(); ! List<Surface> result = new LinkedList(); ! ! Collection<Vertex> vertices = Edge.vertices(edges); ! Mesh mesh = new Mesh(new LinkedList(), edges, vertices); ! space.insert(mesh); ! Project.getInstance().changed(Project.getInstance()); Project.getInstance().checkpoint(); |
|
From: Michael L. <he...@us...> - 2007-03-29 09:38:39
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23246/src/net/sourceforge/bprocessor/model Modified Files: SurfaceAnalysis.java Log Message: Finished improved geometry insertion algorithm Index: SurfaceAnalysis.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SurfaceAnalysis.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SurfaceAnalysis.java 28 Mar 2007 13:52:06 -0000 1.6 --- SurfaceAnalysis.java 29 Mar 2007 09:38:38 -0000 1.7 *************** *** 236,240 **** for (Surface current : surfaces) { if (keys.containsAll(current.getEdges())) { - SurfaceNode surfacenode = new SurfaceNode(current); int direction = Surface.direction(current.getEdges(), system); if (direction == Surface.RIGHT) { --- 236,239 ---- *************** *** 243,247 **** EdgeNode node = emap.get(edge); VertexNode to = node.other(from); ! node.setRight(to, surfacenode); from = to; } --- 242,246 ---- EdgeNode node = emap.get(edge); VertexNode to = node.other(from); ! node.addRight(to, current); from = to; } *************** *** 252,256 **** EdgeNode node = (EdgeNode) emap.get(edge); VertexNode to = node.other(from); ! node.setLeft(to, surfacenode); from = to; } --- 251,255 ---- EdgeNode node = (EdgeNode) emap.get(edge); VertexNode to = node.other(from); ! node.addLeft(to, current); from = to; } *************** *** 264,270 **** for (Edge current : start) { if (emap.containsKey(current)) { ! EdgeNode node = emap.get(current); ! node.left = null; ! node.right = null; } } --- 263,269 ---- for (Edge current : start) { if (emap.containsKey(current)) { ! //EdgeNode node = emap.get(current); ! //node.left = null; ! //node.right = null; } } *************** *** 323,348 **** private void assign(Surface surface, Collection<Surface> surfaces) { ! if (!surfaces.isEmpty()) { ! Surface other = surfaces.iterator().next(); ! Vertex n1 = surface.normal(); Vertex n2 = other.normal(); if (n1.dot(n2) > 0) { ! surface.setBackDomain(other.getBackDomain()); ! surface.setBackMaterial(other.getBackMaterial()); ! surface.setFrontDomain(other.getFrontDomain()); ! surface.setFrontMaterial(other.getFrontMaterial()); } else { ! surface.setBackDomain(other.getFrontDomain()); ! surface.setBackMaterial(other.getFrontMaterial()); ! surface.setFrontDomain(other.getBackDomain()); ! surface.setFrontMaterial(other.getBackMaterial()); } } } private void surfaceAnalysis (EdgeNode start, CoordinateSystem system, Set<Surface> added, Set<Surface> removed) { ! if (start.left == null) { SurfaceNode s = new SurfaceNode(); VertexNode to = start.to; EdgeNode current = start; --- 322,371 ---- private void assign(Surface surface, Collection<Surface> surfaces) { ! Space back = null; ! Material backmaterial = null; ! Space front = null; ! Material frontmaterial = null; ! Vertex n1 = surface.normal(); ! for (Surface other : surfaces) { Vertex n2 = other.normal(); if (n1.dot(n2) > 0) { ! if (back == null) { ! back = other.getBackDomain(); ! backmaterial = other.getBackMaterial(); ! } ! if (front == null) { ! front = other.getFrontDomain(); ! frontmaterial = other.getFrontMaterial(); ! } } else { ! if (back == null) { ! back = other.getFrontDomain(); ! backmaterial = other.getFrontMaterial(); ! } ! if (front == null) { ! front = other.getBackDomain(); ! frontmaterial = other.getBackMaterial(); ! } } } + surface.setBackDomain(back); + surface.setBackMaterial(backmaterial); + surface.setFrontDomain(front); + surface.setFrontMaterial(frontmaterial); + } + + private boolean marked(SurfaceNode node) { + if (node == null) { + return false; + } else { + return node.mark; + } } private void surfaceAnalysis (EdgeNode start, CoordinateSystem system, Set<Surface> added, Set<Surface> removed) { ! if (!marked(start.left)) { SurfaceNode s = new SurfaceNode(); + s.mark = true; VertexNode to = start.to; EdgeNode current = start; *************** *** 366,371 **** } } ! if (start.right == null) { SurfaceNode s = new SurfaceNode(); VertexNode to = start.to; EdgeNode current = start; --- 389,395 ---- } } ! if (!marked(start.right)) { SurfaceNode s = new SurfaceNode(); + s.mark = true; VertexNode to = start.to; EdgeNode current = start; *************** *** 669,672 **** --- 693,726 ---- /** + * + * @param end VertexNode + * @param surface Surface + */ + public void addRight(VertexNode end, Surface surface) { + SurfaceNode right = getRight(end); + if (right != null) { + right.add(surface); + } else { + right = new SurfaceNode(surface); + setRight(end, right); + } + } + + /** + * + * @param end VertexNode + * @param surface Surface + */ + public void addLeft(VertexNode end, Surface surface) { + SurfaceNode left = getLeft(end); + if (left != null) { + left.add(surface); + } else { + left = new SurfaceNode(surface); + setLeft(end, left); + } + } + + /** * @return String */ *************** *** 698,701 **** --- 752,760 ---- /** + * Mark used while visiting all sides of adjacent edges. + */ + private boolean mark; + + /** * Constructs this SurfaceNode with an empty set of surfaces */ *************** *** 703,706 **** --- 762,766 ---- super(); surfaces = new HashSet(); + mark = false; } /** *************** *** 713,716 **** --- 773,777 ---- surfaces = new HashSet(); surfaces.add(surface); + mark = false; } *************** *** 726,729 **** --- 787,798 ---- } } + + /** + * Adds the surface to the set of surfaces of this SurfaceNode. + * @param surface The surface to add. + */ + public void add(Surface surface) { + surfaces.add(surface); + } } } |
|
From: rimestad <rim...@us...> - 2007-03-28 21:33:28
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28510/src/net/sourceforge/bprocessor/facade/modellor Added Files: ModelBathModellor.java Log Message: Initial version of badkabine --- NEW FILE: ModelBathModellor.java --- //--------------------------------------------------------------------------------- // $Id: ModelBathModellor.java,v 1.1 2007/03/28 21:33:27 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.facade.modellor; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Space; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Vertex; import net.sourceforge.bprocessor.model.modellor.Modellor; import org.apache.log4j.Logger; /** A modellor to make windows */ public class ModelBathModellor extends Modellor { /** Id */ private static final long serialVersionUID = 1L; /** The logger */ private static Logger log = Logger.getLogger(ModelBathModellor.class); private Space space; private Surface bottom; private Surface top; private double shaftOffset; private double length; private double width; private double height; private double floorThickness = 55; private double wallThickness = 55; private double ceilingThickness = 55; /** * the constructor */ public ModelBathModellor() { super(); shaftOffset = 100; } /** * the constructor * @param s the Space to realize the modellor in */ public ModelBathModellor(Space s) { this(); space = s; bottom = null; Collection<Surface> vertical = new HashSet<Surface>(); Collection<Surface> horizontal = new HashSet<Surface>(); Collection<Surface> surs = s.getEnvelope(); if (surs.size() != 6) { log.info("Have to be a square box with 6 sides 4 vertical and 2 horizontal"); return; } Vertex up = new Vertex(0, 0, 1); for (Surface sur : surs) { double dot = (sur.normal()).dot(up); if (Math.abs(dot) - 1 < 0.001) { horizontal.add(sur); } else if (dot < 0.001 && dot > -0.001) { vertical.add(sur); } } if (vertical.size() + horizontal.size() != surs.size()) { log.error("Sides were not vertical and top and bottom vertical"); return; } for (Surface sur : horizontal) { if (bottom == null) { bottom = sur; } else { if (bottom.getFirstVertex().getZ() > sur.getFirstVertex().getZ()) { top = bottom; bottom = sur; } else { top = sur; } } } if (bottom == null || top == null) { log.error("Could not find at bottom surface"); return; } else { List<Edge> edges = bottom.getEdges(); width = edges.get(0).getLength() * 1000; length = edges.get(1).getLength() * 1000; height = bottom.plane().distance(top.getFirstVertex()) * 1000; } generate(); } /** * */ private void generate() { Surface making = makeFloor(); Space wallSystem = new Space("Vægsystem", Space.CONSTRUCTION, Space.ELEMENT_LEVEL, true); space.add(wallSystem); making.setBackDomain(wallSystem); { List<Edge> offset = Edge.offset(making.getEdges(), making, -wallThickness / 1000); Surface room = new Surface(offset); for (Edge e : offset) { space.add(e.getFrom()); space.add(e.getTo()); space.add(e); } space.add(room); room.setFrontDomain(making.getFrontDomain()); room.setBackDomain(making.getBackDomain()); Geometry.holeAnalysis(room); Space badkabine = new Space("Badekabine", Space.FUNCTIONAL, Space.ELEMENT_LEVEL, true); space.add(badkabine); room.setBackDomain(badkabine); } { Set<Surface> sides = new HashSet<Surface>(); Set<Surface> tops = new HashSet<Surface>(); Surface top = making.extrusionall(-(height - floorThickness - ceilingThickness) / 1000, sides, tops); space.addAll(sides); space.addAll(tops); Space ceiling = new Space("Ceiling", Space.CONSTRUCTION, Space.ELEMENT_LEVEL, true); space.add(ceiling); for (Surface s : tops) { s.setFrontDomain(ceiling); } sides.clear(); sides.add(top.extrusion(ceilingThickness / 1000, sides)); space.addAll(sides); } } /** * */ private Surface makeFloor() { Space floor = new Space("Floor", Space.CONSTRUCTION, Space.ELEMENT_LEVEL, true); space.add(floor); bottom = bottom.copy(space); bottom.setFrontDomain(floor); Collection<Surface> geom = new LinkedList<Surface>(); Surface floorTop = bottom.extrusion(floorThickness / 1000, geom); geom.add(floorTop); space.addAll(geom); return floorTop; } /** {@inheritDoc} */ public void update(Object entity) { cleanUp(); generate(); } /** {@inheritDoc} */ public Modellor newInstance(Space s) { if (s.getLevel() == Space.SPACE_LEVEL) { return new ModelBathModellor(s); } else { return null; } } /** {@inheritDoc} */ public void delete() { space.setModellor(null); } /** * Clean up the constructed geometry */ private void cleanUp() { space.clear(); } /** {@inheritDoc} */ public void setAttributes(List attributes) { update(space); } /** {@inheritDoc} */ public List getAttributes() { List res = new LinkedList(); res.add(new Attribute("Name", getName(), false)); res.add(new Attribute("Length", length, true)); res.add(new Attribute("Width", width, true)); res.add(new Attribute("Height", height, true)); res.add(new Attribute("Shaft-offset", shaftOffset, true)); return res; } /** {@inheritDoc} */ public String getName() { return "Bath-module"; } /** {@inheritDoc} */ public String getGeneralName() { return "Bath-module modellor"; } /** {@inheritDoc} */ public void setContent(Map m) { space = (Space)m.get("Space"); } /** {@inheritDoc} */ public Map getContent() { Map what = new HashMap(); what.put("Space", space); return what; } } |
|
From: rimestad <rim...@us...> - 2007-03-28 21:33:28
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28510/src/net/sourceforge/bprocessor/facade Modified Files: FacadeMain.java Log Message: Initial version of badkabine Index: FacadeMain.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/FacadeMain.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FacadeMain.java 28 Nov 2006 16:18:18 -0000 1.5 --- FacadeMain.java 28 Mar 2007 21:33:27 -0000 1.6 *************** *** 8,11 **** --- 8,12 ---- import net.sourceforge.bprocessor.facade.modellor.FacadeModellor; + import net.sourceforge.bprocessor.facade.modellor.ModelBathModellor; import net.sourceforge.bprocessor.facade.modellor.NetFacadeModellor; import net.sourceforge.bprocessor.model.modellor.Modellor; *************** *** 26,29 **** --- 27,32 ---- Modellor.registerModellor(new FacadeModellor()); Modellor.registerModellor(new NetFacadeModellor()); + Modellor.registerModellor(new ModelBathModellor()); + } } |
|
From: rimestad <rim...@us...> - 2007-03-28 21:33:21
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28442/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: added some info to javaDoc Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.147 retrieving revision 1.148 diff -C2 -d -r1.147 -r1.148 *** Surface.java 27 Mar 2007 17:18:11 -0000 1.147 --- Surface.java 28 Mar 2007 21:33:08 -0000 1.148 *************** *** 559,563 **** /** * Extrude with holes ! * @param delta Distance to extrude * @param sides Collection of extruded sides * @param tops Collection of extruede tops --- 559,563 ---- /** * Extrude with holes ! * @param delta Distance to extrude in meters * @param sides Collection of extruded sides * @param tops Collection of extruede tops *************** *** 578,582 **** /** * Extrusion ! * @param delta Dinstance * @param sides Set * @return Top --- 578,582 ---- /** * Extrusion ! * @param delta Dinstance in meters * @param sides Set * @return Top *************** *** 679,683 **** /** * Extrude this surface ! * @param delta How much to extrude along the normal * @param sides Will contain the sides that are created * @return The top in the extruded surface --- 679,683 ---- /** * Extrude this surface ! * @param delta How much to extrude along the normal in meters * @param sides Will contain the sides that are created * @return The top in the extruded surface *************** *** 704,708 **** /** * Make the new vertices, edges and surfaces for extrusion ! * @param delta the direction of extrusion * @param sides Will contain the sides that are created * @param e2e a edge to new extruded parallel edge map --- 704,708 ---- /** * Make the new vertices, edges and surfaces for extrusion ! * @param delta the length of extrusion in meters * @param sides Will contain the sides that are created * @param e2e a edge to new extruded parallel edge map *************** *** 843,847 **** /** * Make the new vertices, edges and surfaces for extrusion ! * @param delta the direction of extrusion * @param sides Will contain the sides that are created * @param e2e a edge to new extruded parallel edge map --- 843,847 ---- /** * Make the new vertices, edges and surfaces for extrusion ! * @param delta the length of extrusion in meters * @param sides Will contain the sides that are created * @param e2e a edge to new extruded parallel edge map |
|
From: Michael L. <he...@us...> - 2007-03-28 13:52:09
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4094/src/net/sourceforge/bprocessor/model Modified Files: SurfaceAnalysis.java Space.java Log Message: Performs surface-analysis as part of Part.insert(mesh) Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.126 retrieving revision 1.127 diff -C2 -d -r1.126 -r1.127 *** Space.java 26 Mar 2007 10:48:23 -0000 1.126 --- Space.java 28 Mar 2007 13:52:06 -0000 1.127 *************** *** 2740,2743 **** --- 2740,2745 ---- surfaces.add(insert(surface)); } + SurfaceAnalysis analysis = new SurfaceAnalysis(); + surfaces.addAll(analysis.surfaceAnalysis(this, edges)); return new Mesh(surfaces, edges, vertices); } Index: SurfaceAnalysis.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SurfaceAnalysis.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SurfaceAnalysis.java 28 Mar 2007 12:02:22 -0000 1.5 --- SurfaceAnalysis.java 28 Mar 2007 13:52:06 -0000 1.6 *************** *** 264,270 **** for (Edge current : start) { if (emap.containsKey(current)) { ! // EdgeNode node = emap.get(current); ! // node.left = null; ! // node.right = null; } } --- 264,270 ---- for (Edge current : start) { if (emap.containsKey(current)) { ! EdgeNode node = emap.get(current); ! node.left = null; ! node.right = null; } } |
|
From: Michael L. <he...@us...> - 2007-03-28 12:35:50
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25111/src/net/sourceforge/bprocessor/model Modified Files: SurfaceAnalysis.java Log Message: Genericitification of surface analysis Index: SurfaceAnalysis.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SurfaceAnalysis.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SurfaceAnalysis.java 21 Dec 2006 13:33:02 -0000 1.4 --- SurfaceAnalysis.java 28 Mar 2007 12:02:22 -0000 1.5 *************** *** 12,16 **** import java.util.HashMap; import java.util.HashSet; - import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedList; --- 12,15 ---- *************** *** 30,37 **** * @return True if edge is contained in a CoordinateSystem */ ! private boolean contains(Collection systems, Edge edge) { ! Iterator iter = systems.iterator(); ! while (iter.hasNext()) { ! CoordinateSystem system = (CoordinateSystem) iter.next(); if (system.plane().contains(edge)) { return true; --- 29,34 ---- * @return True if edge is contained in a CoordinateSystem */ ! private boolean contains(Collection<CoordinateSystem> systems, Edge edge) { ! for (CoordinateSystem system : systems) { if (system.plane().contains(edge)) { return true; *************** *** 47,55 **** * @return true if system is contained in collection */ ! private boolean contains(Collection systems, CoordinateSystem system) { ! Iterator iter = systems.iterator(); Plane plane = system.plane(); ! while (iter.hasNext()) { ! CoordinateSystem current = (CoordinateSystem) iter.next(); if (plane.contains(current.getOrigin())) { Vertex n1 = system.getN(); --- 44,50 ---- * @return true if system is contained in collection */ ! private boolean contains(Collection<CoordinateSystem> systems, CoordinateSystem system) { Plane plane = system.plane(); ! for (CoordinateSystem current : systems) { if (plane.contains(current.getOrigin())) { Vertex n1 = system.getN(); *************** *** 69,76 **** */ public void clearPlanes(Space space) { ! Collection planes = space.getCoordinateSystems(); ! Iterator iter = planes.iterator(); ! while (iter.hasNext()) { ! CoordinateSystem current = (CoordinateSystem) iter.next(); space.remove(current); } --- 64,69 ---- */ public void clearPlanes(Space space) { ! Collection<CoordinateSystem> planes = space.getCoordinateSystems(); ! for (CoordinateSystem current : planes) { space.remove(current); } *************** *** 83,87 **** * @return collection of CoordinateSystem */ ! public Collection planeAnalysis(Space space) { return planeAnalysis(space, space.getEdges()); } --- 76,80 ---- * @return collection of CoordinateSystem */ ! public Collection<CoordinateSystem> planeAnalysis(Space space) { return planeAnalysis(space, space.getEdges()); } *************** *** 92,164 **** * @return Collection of CoordinateSystem */ ! public Collection planeAnalysis(Space space, Collection start) { ! Collection systems = new LinkedList(); ! Collection edges = space.getEdges(); { ! Set mark = new HashSet(); ! Map neighbours = new HashMap(); { ! Collection vertices = space.getVertices(); ! Map edgemap = new HashMap(); ! { ! Iterator iter = vertices.iterator(); ! while (iter.hasNext()) { ! Vertex current = (Vertex) iter.next(); ! edgemap.put(current, new LinkedList()); ! } } ! { ! Iterator iter = edges.iterator(); ! while (iter.hasNext()) { ! Edge current = (Edge) iter.next(); ! Vertex from = current.getFrom(); ! List fl = (List) edgemap.get(from); ! fl.add(current); ! Vertex to = current.getTo(); ! List tl = (List) edgemap.get(to); ! tl.add(current); ! } } ! { ! Iterator iter = edges.iterator(); ! while (iter.hasNext()) { ! Edge current = (Edge) iter.next(); ! List incident = new LinkedList(); ! { ! Vertex from = current.getFrom(); ! List fl = (List) edgemap.get(from); ! Iterator flit = fl.iterator(); ! while (flit.hasNext()) { ! Edge edge = (Edge) flit.next(); ! if (edge != current) { ! incident.add(edge); ! } } } ! { ! Vertex to = current.getTo(); ! List tl = (List) edgemap.get(to); ! Iterator tlit = tl.iterator(); ! while (tlit.hasNext()) { ! Edge edge = (Edge) tlit.next(); ! if (edge != current) { ! incident.add(edge); ! } } } - neighbours.put(current, incident); } } } ! LinkedList queue = new LinkedList(start); while (!queue.isEmpty()) { ! Edge current = (Edge) queue.removeFirst(); if (!mark.contains(current)) { mark.add(current); ! List incident = (List) neighbours.get(current); ! List pls = new LinkedList(); ! Iterator it = incident.iterator(); ! while (it.hasNext()) { ! Edge edge = (Edge) it.next(); CoordinateSystem system = CoordinateSystem.create(current, edge); if (system != null) { --- 85,139 ---- * @return Collection of CoordinateSystem */ ! public Collection<CoordinateSystem> planeAnalysis(Space space, Collection<Edge> start) { ! Collection<CoordinateSystem> systems = new LinkedList(); ! Collection<Edge> edges = space.getEdges(); { ! Set<Edge> mark = new HashSet(); ! Map<Edge, List<Edge>> neighbours = new HashMap(); { ! Collection<Vertex> vertices = space.getVertices(); ! Map<Vertex, List<Edge>> edgemap = new HashMap(); ! for (Vertex current : vertices) { ! edgemap.put(current, new LinkedList()); } ! for (Edge current : edges) { ! Vertex from = current.getFrom(); ! List<Edge> fl = edgemap.get(from); ! fl.add(current); ! Vertex to = current.getTo(); ! List<Edge> tl = edgemap.get(to); ! tl.add(current); } ! for (Edge current : edges) { ! List<Edge> incident = new LinkedList(); ! { ! Vertex from = current.getFrom(); ! List<Edge> fl = edgemap.get(from); ! for (Edge edge : fl) { ! if (edge != current) { ! incident.add(edge); } } ! } ! { ! Vertex to = current.getTo(); ! List<Edge> tl = edgemap.get(to); ! for (Edge edge : tl) { ! if (edge != current) { ! incident.add(edge); } } } + neighbours.put(current, incident); } } ! LinkedList<Edge> queue = new LinkedList(start); while (!queue.isEmpty()) { ! Edge current = queue.removeFirst(); if (!mark.contains(current)) { mark.add(current); ! List<Edge> incident = neighbours.get(current); ! List<CoordinateSystem> pls = new LinkedList(); ! for (Edge edge : incident) { CoordinateSystem system = CoordinateSystem.create(current, edge); if (system != null) { *************** *** 184,191 **** */ public void clearSurfaces(Space space) { ! Collection surfaces = new LinkedList(space.getSurfaces()); ! Iterator iter = surfaces.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); space.remove(current); } --- 159,164 ---- */ public void clearSurfaces(Space space) { ! Collection<Surface> surfaces = new LinkedList(space.getSurfaces()); ! for (Surface current : surfaces) { space.remove(current); } *************** *** 199,208 **** * @return collection of surfaces */ ! public Collection surfaceAnalysis(Space space, Collection start) { ! Collection systems = planeAnalysis(space, start); ! Iterator iter = systems.iterator(); ! Collection added = new LinkedList(); ! while (iter.hasNext()) { ! CoordinateSystem current = (CoordinateSystem) iter.next(); added.addAll(surfaceAnalysis(space, current, start)); } --- 172,179 ---- * @return collection of surfaces */ ! public Collection<Surface> surfaceAnalysis(Space space, Collection<Edge> start) { ! Collection<CoordinateSystem> systems = planeAnalysis(space, start); ! Collection<Surface> added = new LinkedList(); ! for (CoordinateSystem current : systems) { added.addAll(surfaceAnalysis(space, current, start)); } *************** *** 215,222 **** */ public void surfaceAnalysis(Space space) { ! Collection systems = space.getCoordinateSystems(); ! Iterator iter = systems.iterator(); ! while (iter.hasNext()) { ! CoordinateSystem current = (CoordinateSystem) iter.next(); surfaceAnalysis(space, current, space.getEdges()); } --- 186,191 ---- */ public void surfaceAnalysis(Space space) { ! Collection<CoordinateSystem> systems = space.getCoordinateSystems(); ! for (CoordinateSystem current : systems) { surfaceAnalysis(space, current, space.getEdges()); } *************** *** 231,244 **** * @return collection of Surfaces */ ! public Collection surfaceAnalysis(Space space, CoordinateSystem system, Collection start) { Plane plane = system.plane(); ! Map vmap = new LinkedHashMap(); ! Map emap = new LinkedHashMap(); { ! List vertices = new LinkedList(space.getVertices()); Entity.sort(vertices); ! Iterator iter = vertices.iterator(); ! while (iter.hasNext()) { ! Vertex current = (Vertex) iter.next(); if (plane.contains(current)) { vmap.put(current, new VertexNode(current)); --- 200,212 ---- * @return collection of Surfaces */ ! public Collection<Surface> surfaceAnalysis(Space space, CoordinateSystem system, ! Collection<Edge> start) { Plane plane = system.plane(); ! Map<Vertex, VertexNode> vmap = new LinkedHashMap(); ! Map<Edge, EdgeNode> emap = new LinkedHashMap(); { ! List<Vertex> vertices = new LinkedList(space.getVertices()); Entity.sort(vertices); ! for (Vertex current : vertices) { if (plane.contains(current)) { vmap.put(current, new VertexNode(current)); *************** *** 247,257 **** } { ! List edges = new LinkedList(space.getEdges()); Entity.sort(edges); ! Iterator iter = edges.iterator(); ! while (iter.hasNext()) { ! Edge current = (Edge) iter.next(); ! VertexNode from = (VertexNode) vmap.get(current.getFrom()); ! VertexNode to = (VertexNode) vmap.get(current.getTo()); if (from != null && to != null) { EdgeNode node = new EdgeNode(current, from, to); --- 215,223 ---- } { ! List<Edge> edges = new LinkedList(space.getEdges()); Entity.sort(edges); ! for (Edge current : edges) { ! VertexNode from = vmap.get(current.getFrom()); ! VertexNode to = vmap.get(current.getTo()); if (from != null && to != null) { EdgeNode node = new EdgeNode(current, from, to); *************** *** 262,287 **** } } ! { ! Iterator iter = vmap.values().iterator(); ! while (iter.hasNext()) { ! VertexNode current = (VertexNode) iter.next(); ! current.sort(system); ! } } { ! 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); --- 228,245 ---- } } ! for (VertexNode current : vmap.values()) { ! current.sort(system); } { ! Set<Edge> keys = emap.keySet(); ! Collection<Surface> surfaces = space.getSurfaces(); ! for (Surface current : surfaces) { if (keys.containsAll(current.getEdges())) { SurfaceNode surfacenode = new SurfaceNode(current); int direction = Surface.direction(current.getEdges(), system); if (direction == Surface.RIGHT) { ! VertexNode from = vmap.get(current.getFirstVertex()); ! for (Edge edge : current.getEdges()) { ! EdgeNode node = emap.get(edge); VertexNode to = node.other(from); node.setRight(to, surfacenode); *************** *** 290,297 **** } 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); --- 248,253 ---- } if (direction == Surface.LEFT) { VertexNode from = (VertexNode) vmap.get(current.getFirstVertex()); ! for (Edge edge : current.getEdges()) { EdgeNode node = (EdgeNode) emap.get(edge); VertexNode to = node.other(from); *************** *** 303,314 **** } } ! Set added = new HashSet(); ! Set removed = new HashSet(); { ! Iterator iter = start.iterator(); ! while (iter.hasNext()) { ! Edge current = (Edge) iter.next(); if (emap.containsKey(current)) { ! EdgeNode node = (EdgeNode) emap.get(current); // node.left = null; // node.right = null; --- 259,268 ---- } } ! Set<Surface> added = new HashSet(); ! Set<Surface> removed = new HashSet(); { ! for (Edge current : start) { if (emap.containsKey(current)) { ! // EdgeNode node = emap.get(current); // node.left = null; // node.right = null; *************** *** 316,355 **** } } ! { ! Iterator iter = start.iterator(); ! while (iter.hasNext()) { ! Edge current = (Edge) iter.next(); ! if (emap.containsKey(current)) { ! EdgeNode node = (EdgeNode) emap.get(current); ! surfaceAnalysis(node, system, added, removed); ! } } } ! { ! Iterator iter = removed.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! space.remove(current); ! } } ! { ! Iterator iter = added.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! space.add(current); ! } } ! { ! Iterator iter = added.iterator(); ! while (iter.hasNext()) { ! Surface current = (Surface) iter.next(); ! Geometry.holeAnalysis(current); ! } } return added; } ! private List rightContour(EdgeNode start) { ! List edges = new LinkedList(); VertexNode to = start.to; EdgeNode current = start; --- 270,293 ---- } } ! for (Edge current : start) { ! if (emap.containsKey(current)) { ! EdgeNode node = (EdgeNode) emap.get(current); ! surfaceAnalysis(node, system, added, removed); } } ! for (Surface current : removed) { ! space.remove(current); } ! for (Surface current : added) { ! space.add(current); } ! for (Surface current : added) { ! Geometry.holeAnalysis(current); } return added; } ! private List<Edge> rightContour(EdgeNode start) { ! List<Edge> edges = new LinkedList(); VertexNode to = start.to; EdgeNode current = start; *************** *** 367,372 **** } ! private List leftContour(EdgeNode start) { ! List edges = new LinkedList(); VertexNode to = start.to; EdgeNode current = start; --- 305,310 ---- } ! private List<Edge> leftContour(EdgeNode start) { ! List<Edge> edges = new LinkedList(); VertexNode to = start.to; EdgeNode current = start; *************** *** 384,390 **** } ! private void assign(Surface surface, Collection surfaces) { if (!surfaces.isEmpty()) { ! Surface other = (Surface) surfaces.iterator().next(); Vertex n1 = surface.normal(); Vertex n2 = other.normal(); --- 322,328 ---- } ! private void assign(Surface surface, Collection<Surface> surfaces) { if (!surfaces.isEmpty()) { ! Surface other = surfaces.iterator().next(); Vertex n1 = surface.normal(); Vertex n2 = other.normal(); *************** *** 404,408 **** private void surfaceAnalysis (EdgeNode start, CoordinateSystem system, ! Set added, Set removed) { if (start.left == null) { SurfaceNode s = new SurfaceNode(); --- 342,346 ---- private void surfaceAnalysis (EdgeNode start, CoordinateSystem system, ! Set<Surface> added, Set<Surface> removed) { if (start.left == null) { SurfaceNode s = new SurfaceNode(); *************** *** 416,420 **** } if (start.left != start.right) { ! List edges = leftContour(start); if (edges.size() > 2) { int turn = Surface.direction(edges, system); --- 354,358 ---- } if (start.left != start.right) { ! List<Edge> edges = leftContour(start); if (edges.size() > 2) { int turn = Surface.direction(edges, system); *************** *** 439,443 **** } if (start.right != start.left) { ! List edges = rightContour(start); if (edges.size() > 2) { int turn = Surface.direction(edges, system); --- 377,381 ---- } if (start.right != start.left) { ! List<Edge> edges = rightContour(start); if (edges.size() > 2) { int turn = Surface.direction(edges, system); *************** *** 460,464 **** private Vertex vertex; /** edges */ ! private List edges; /** --- 398,402 ---- private Vertex vertex; /** edges */ ! private List<EdgeNode> edges; /** *************** *** 528,534 **** List right = new LinkedList(); ! Iterator iter = edges.iterator(); ! while (iter.hasNext()) { ! EdgeNode current = (EdgeNode) iter.next(); VertexNode other = current.other(this); Vertex delta = other.vertex.minus(vertex); --- 466,470 ---- List right = new LinkedList(); ! for (EdgeNode current : edges) { VertexNode other = current.other(this); Vertex delta = other.vertex.minus(vertex); *************** *** 567,574 **** } { ! EdgeNode previous = (EdgeNode) edges.get(edges.size() - 1); ! Iterator iter = edges.iterator(); ! while (iter.hasNext()) { ! EdgeNode current = (EdgeNode) iter.next(); if (previous.to == this) { previous.toSucc = current; --- 503,508 ---- } { ! EdgeNode previous = edges.get(edges.size() - 1); ! for (EdgeNode current : edges) { if (previous.to == this) { previous.toSucc = current; *************** *** 761,765 **** * the current geometric tools. */ ! private Set surfaces; /** --- 695,699 ---- * the current geometric tools. */ ! private Set<Surface> surfaces; /** |
|
From: Michael L. <he...@us...> - 2007-03-28 12:24:08
|
Update of /cvsroot/bprocessor/test/reference In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32364/reference Modified Files: directions.out Log Message: New directions test reference Index: directions.out =================================================================== RCS file: /cvsroot/bprocessor/test/reference/directions.out,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** directions.out 5 Jan 2007 13:55:40 -0000 1.4 --- directions.out 28 Mar 2007 12:24:00 -0000 1.5 *************** *** 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 --- 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 = V[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 = V[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 = V[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 = V[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 = V[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 = V[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: 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 --- 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 = V[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 = V[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 = V[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 = V[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 = V[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 = V[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: 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 --- 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 = V[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 = V[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 = V[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 = V[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: rimestad <rim...@us...> - 2007-03-28 09:00:48
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14493/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Geometry.java Log Message: made som changes to find the right space assignment when extruding a contour, seems to work fabulous Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** Edge.java 27 Mar 2007 17:18:11 -0000 1.78 --- Edge.java 28 Mar 2007 09:00:47 -0000 1.79 *************** *** 1001,1052 **** surfaceedges.add(e); Surface side = new Surface(surfaceedges); ! List<Surface> surfs = Geometry.neighbourAroundEdge(side, e); if (surfs != null) { - CoordinateSystem cs = side.coordinateSystem(); - log.info("Side coord " + cs); //for front domain Surface inside = surfs.get(0); ! int dir1 = inside.direction(cs); ! int dir2 = side.direction(cs); ! if (dir1 == Surface.PARALLEL) { ! if (cs.translate(e.getFrom().add(inside.normal())).getY() < 0) { ! if (dir2 == Surface.LEFT) { ! side.setFrontDomain(inside.getBackDomain()); ! } else { ! side.setBackDomain(inside.getBackDomain()); ! } } else { ! if (dir2 == Surface.LEFT) { ! side.setFrontDomain(inside.getFrontDomain()); ! } else { ! side.setBackDomain(inside.getFrontDomain()); ! } } - } else if (dir1 == dir2) { - side.setFrontDomain(inside.getFrontDomain()); } else { ! side.setFrontDomain(inside.getBackDomain()); } //for back domain Surface outside = surfs.get(surfs.size() - 1); ! dir1 = outside.direction(cs); ! if (dir1 == Surface.PARALLEL) { ! /*if (cs.translate(e.getFrom().add(outside.normal())).getY() < 0) { ! if (dir2 == Surface.RIGHT) { ! side.setBackDomain(outside.getBackDomain()); ! } else { ! side.setFrontDomain(outside.getBackDomain()); ! } } else { ! if (dir2 == Surface.RIGHT) { ! side.setBackDomain(outside.getFrontDomain()); ! } else { ! side.setFrontDomain(outside.getFrontDomain()); ! } ! }*/ ! } else if (dir1 == dir2) { ! side.setBackDomain(outside.getBackDomain()); } else { ! side.setBackDomain(outside.getFrontDomain()); } } --- 1001,1040 ---- surfaceedges.add(e); Surface side = new Surface(surfaceedges); ! Map<Surface, Double> surToAngle = new HashMap<Surface, Double>(); ! List<Surface> surfs = Geometry.neighbourAroundEdge(side, e, surToAngle); if (surfs != null) { //for front domain Surface inside = surfs.get(0); ! double angleToInside = surToAngle.get(inside); ! if (inside.normal().dot(direction) >= 0) { ! if (angleToInside <= Math.PI) { ! side.setFrontDomain(inside.getFrontDomain()); } else { ! side.setFrontDomain(inside.getBackDomain()); } } else { ! if (angleToInside <= Math.PI) { ! side.setFrontDomain(inside.getBackDomain()); ! } else { ! side.setFrontDomain(inside.getFrontDomain()); ! } } //for back domain Surface outside = surfs.get(surfs.size() - 1); ! double angleToOutside = surToAngle.get(outside); ! double dotout = outside.normal().dot(direction); ! if (dotout >= 0) { ! //the surface to get backdomain from have front to us if angle are greater that PI ! if (angleToOutside > Math.PI) { ! side.setBackDomain(outside.getFrontDomain()); } else { ! side.setBackDomain(outside.getBackDomain()); ! } } else { ! if (angleToOutside > Math.PI) { ! side.setBackDomain(outside.getBackDomain()); ! } else { ! side.setBackDomain(outside.getFrontDomain()); ! } } } Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** Geometry.java 27 Mar 2007 17:18:11 -0000 1.47 --- Geometry.java 28 Mar 2007 09:00:47 -0000 1.48 *************** *** 509,515 **** * @param from the surface to find neighbours for. * @param edge the shared edge * @return the neighbour surface ordered after angle to from. */ ! public static List<Surface> neighbourAroundEdge(Surface from, Edge edge) { //Building a coordinate system: Vertex n = edge.getDirection(); --- 509,519 ---- * @param from the surface to find neighbours for. * @param edge the shared edge + * @param surToAngle a map from surface to angle + * (null can be given as argument if info in not needed) * @return the neighbour surface ordered after angle to from. */ ! public static List<Surface> neighbourAroundEdge(Surface from, ! Edge edge, ! Map<Surface, Double> surToAngle) { //Building a coordinate system: Vertex n = edge.getDirection(); *************** *** 527,532 **** Plane p = new Plane(n.getX(), n.getY(), n.getZ(), sharedVertex); ! Vertex projVertex = p.project(adjacentVertex); ! Vertex i = projVertex.minus(sharedVertex); i.normalize(); CoordinateSystem cs = new CoordinateSystem(i, j , n, sharedVertex); --- 531,536 ---- Plane p = new Plane(n.getX(), n.getY(), n.getZ(), sharedVertex); ! Vertex projVertex = p.project(adjacentVertex.minus(sharedVertex)); ! Vertex i = projVertex; i.normalize(); CoordinateSystem cs = new CoordinateSystem(i, j , n, sharedVertex); *************** *** 534,540 **** //Project.getInstance().getActiveSpace().add(cs); List<Surface> neighbours = new LinkedList<Surface>(edge.getSurfaces()); ! Map<Surface, Double> surToAngle = new HashMap<Surface, Double>(); //make pre calculations finding all angles to surfaces and filling map ! for (Surface s : edge.getSurfaces()) { if (s != from) { Vertex notShared = findNonparallelVertex(s, edge); --- 538,547 ---- //Project.getInstance().getActiveSpace().add(cs); List<Surface> neighbours = new LinkedList<Surface>(edge.getSurfaces()); ! if (surToAngle == null) { ! surToAngle = new HashMap<Surface, Double>(); ! } //make pre calculations finding all angles to surfaces and filling map ! Set<Surface> surs = edge.getSurfaces(); ! for (Surface s : surs) { if (s != from) { Vertex notShared = findNonparallelVertex(s, edge); *************** *** 542,545 **** --- 549,556 ---- double angle = Geometry.findAngle(notShared, cs); surToAngle.put(s, angle); + if (s.getExterior() != null) { + surToAngle.put(s.getExterior(), (Math.PI + angle) % (2 * Math.PI)); + neighbours.add(s.getExterior()); + } } } |
|
From: rimestad <rim...@us...> - 2007-03-28 08:59:31
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14030/src/net/sourceforge/bprocessor/gl/tool Modified Files: ExtrusionTool.java Log Message: minior precision fix for the contour extrusion Index: ExtrusionTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ExtrusionTool.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** ExtrusionTool.java 12 Mar 2007 16:01:32 -0000 1.51 --- ExtrusionTool.java 28 Mar 2007 08:59:30 -0000 1.52 *************** *** 365,371 **** Plane plane = new Plane(0, 0, 1, extrudeEdges.get(0).getFrom()); dragplane = plane.orthogonalPlane(ray); ! from = view.toPlaneCoords(startx, starty, dragplane); active = true; start = findIntersection(e); } } else { --- 365,372 ---- Plane plane = new Plane(0, 0, 1, extrudeEdges.get(0).getFrom()); dragplane = plane.orthogonalPlane(ray); ! //from = view.toPlaneCoords(startx, starty, dragplane); active = true; start = findIntersection(e); + from = start.vertex(); } } else { |
|
From: rimestad <rim...@us...> - 2007-03-28 06:17:04
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13246/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: minor style fix Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** GenericTreeView.java 27 Mar 2007 08:47:07 -0000 1.91 --- GenericTreeView.java 28 Mar 2007 06:16:43 -0000 1.92 *************** *** 1042,1047 **** if (o instanceof Project) { Project c = (Project) o; ! //((ClassificationContainer)this.getChildAt(0)).update(c.getConstructionClas().getChildren()); ! //((ClassificationContainer)this.getChildAt(1)).update(c.getFunctionalClas().getChildren()); } else { log.warn("Expected a Classification but found a " + o.getClass().getName()); --- 1042,1051 ---- if (o instanceof Project) { Project c = (Project) o; ! /* ! ((ClassificationContainer)this.getChildAt(0)). ! update(c.getConstructionClas().getChildren()); ! ((ClassificationContainer)this.getChildAt(1)). ! update(c.getFunctionalClas().getChildren()); ! */ } else { log.warn("Expected a Classification but found a " + o.getClass().getName()); |
|
From: rimestad <rim...@us...> - 2007-03-27 17:18:21
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22370/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Surface.java Geometry.java CoordinateSystem.java Log Message: played a bit around with space assignment after contour extrusion... not perfect yet but on its way... Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.146 retrieving revision 1.147 diff -C2 -d -r1.146 -r1.147 *** Surface.java 26 Mar 2007 10:48:22 -0000 1.146 --- Surface.java 27 Mar 2007 17:18:11 -0000 1.147 *************** *** 90,93 **** --- 90,96 ---- previous = current; } + if (e1 == null || e2 == null) { + return PARALLEL; + } Vertex common = Edge.commonVertex(e1, e2); Vertex from = e1.otherVertex(common); Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** Edge.java 22 Mar 2007 14:37:26 -0000 1.77 --- Edge.java 27 Mar 2007 17:18:11 -0000 1.78 *************** *** 1000,1004 **** surfaceedges.add(sideMap.get(e.getTo())); surfaceedges.add(e); ! extrusion.add(new Surface(surfaceedges)); } --- 1000,1055 ---- surfaceedges.add(sideMap.get(e.getTo())); surfaceedges.add(e); ! Surface side = new Surface(surfaceedges); ! List<Surface> surfs = Geometry.neighbourAroundEdge(side, e); ! if (surfs != null) { ! CoordinateSystem cs = side.coordinateSystem(); ! log.info("Side coord " + cs); ! //for front domain ! Surface inside = surfs.get(0); ! int dir1 = inside.direction(cs); ! int dir2 = side.direction(cs); ! if (dir1 == Surface.PARALLEL) { ! if (cs.translate(e.getFrom().add(inside.normal())).getY() < 0) { ! if (dir2 == Surface.LEFT) { ! side.setFrontDomain(inside.getBackDomain()); ! } else { ! side.setBackDomain(inside.getBackDomain()); ! } ! } else { ! if (dir2 == Surface.LEFT) { ! side.setFrontDomain(inside.getFrontDomain()); ! } else { ! side.setBackDomain(inside.getFrontDomain()); ! } ! } ! } else if (dir1 == dir2) { ! side.setFrontDomain(inside.getFrontDomain()); ! } else { ! side.setFrontDomain(inside.getBackDomain()); ! } ! //for back domain ! Surface outside = surfs.get(surfs.size() - 1); ! dir1 = outside.direction(cs); ! if (dir1 == Surface.PARALLEL) { ! /*if (cs.translate(e.getFrom().add(outside.normal())).getY() < 0) { ! if (dir2 == Surface.RIGHT) { ! side.setBackDomain(outside.getBackDomain()); ! } else { ! side.setFrontDomain(outside.getBackDomain()); ! } ! } else { ! if (dir2 == Surface.RIGHT) { ! side.setBackDomain(outside.getFrontDomain()); ! } else { ! side.setFrontDomain(outside.getFrontDomain()); ! } ! }*/ ! } else if (dir1 == dir2) { ! side.setBackDomain(outside.getBackDomain()); ! } else { ! side.setBackDomain(outside.getFrontDomain()); ! } ! } ! extrusion.add(side); } Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** Geometry.java 23 Mar 2007 15:27:18 -0000 1.46 --- Geometry.java 27 Mar 2007 17:18:11 -0000 1.47 *************** *** 10,17 **** --- 10,21 ---- import java.util.ArrayList; import java.util.Collection; + import java.util.Collections; + import java.util.Comparator; + import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; + import java.util.Map; import java.util.Set; *************** *** 379,383 **** return Math.asin(tmp.getZ()); } ! /** * Insert a Constructor into model --- 383,413 ---- return Math.asin(tmp.getZ()); } ! ! /** ! * finds the angle between the x-axis of the coordinate system and ! * the given vertex in radian. ! * @param vertex The vertex to find the angle to ! * @param coordinateSystem - the coordinatesystem to find it in ! * @return the resulting angle ! */ ! public static double findAngle(Vertex vertex, CoordinateSystem coordinateSystem) { ! Vertex projVertex = coordinateSystem.project(vertex); ! Vertex vector = projVertex.minus(coordinateSystem.getOrigin()); ! vector.normalize(); ! Vertex xAxis = coordinateSystem.getI().copy(); ! double cosAngle = xAxis.dot(vector); ! if (cosAngle > 1 && cosAngle < 1.001) { ! cosAngle = 1; ! } else if (cosAngle < -1 && cosAngle > -1.001) { ! cosAngle = -1; ! } ! double angle = Math.acos(cosAngle); ! Vertex translated = coordinateSystem.translate(vertex); ! if (translated.getY() < 0) { ! angle = 2 * Math.PI - angle; ! } ! return angle; ! } ! /** * Insert a Constructor into model *************** *** 474,477 **** --- 504,596 ---- } + + /** + * Finds and sort the neighborsurfaces after angle + * @param from the surface to find neighbours for. + * @param edge the shared edge + * @return the neighbour surface ordered after angle to from. + */ + public static List<Surface> neighbourAroundEdge(Surface from, Edge edge) { + //Building a coordinate system: + Vertex n = edge.getDirection(); + n.normalize(); + + Vertex j = from.normal(); + if (j == null) { + return null; + } + Vertex sharedVertex = edge.getFrom(); + Vertex adjacentVertex = Geometry.findNonparallelVertex(from, edge); + if (adjacentVertex == null) { + return null; + } + + Plane p = new Plane(n.getX(), n.getY(), n.getZ(), sharedVertex); + Vertex projVertex = p.project(adjacentVertex); + Vertex i = projVertex.minus(sharedVertex); + i.normalize(); + CoordinateSystem cs = new CoordinateSystem(i, j , n, sharedVertex); + log.info(cs); + //Project.getInstance().getActiveSpace().add(cs); + List<Surface> neighbours = new LinkedList<Surface>(edge.getSurfaces()); + Map<Surface, Double> surToAngle = new HashMap<Surface, Double>(); + //make pre calculations finding all angles to surfaces and filling map + for (Surface s : edge.getSurfaces()) { + if (s != from) { + Vertex notShared = findNonparallelVertex(s, edge); + if (notShared != null) { + double angle = Geometry.findAngle(notShared, cs); + surToAngle.put(s, angle); + } + } + } + log.info(surToAngle); + Collections.sort(neighbours, new SurfaceComparator(surToAngle)); + return neighbours; + } + + /** + * Private comparator class for use in neighborOnEdge method + * @author Rimestad + */ + private static final class SurfaceComparator implements Comparator<Surface> { + private Map<Surface, Double> surToAngle; + /** + * @param preComps precomputations of the angles to the different surfaces + */ + public SurfaceComparator(Map<Surface, Double> preComps) { + super(); + surToAngle = preComps; + } + + /** + * {@inheritDoc} + */ + public int compare(Surface o1, Surface o2) { + return surToAngle.get(o1).compareTo(surToAngle.get(o2)); + } + } + + /** + * Find the next vertex in a surface that is not on the given edge (the line i generates that is) + * @param in The Surface to look for vertexes in + * @param to The edge containing the vertexes generating the line (have to be a edge in in) + * @return The found vertex if any + */ + public static Vertex findNonparallelVertex(Surface in, Edge to) { + Set<Vertex> vertexes = in.collect(); + Vertex adjacentVertex = null; + for (Vertex v : vertexes) { + if (v != to.getFrom() && v != to.getTo()) { + if (to.getDirection().dot(v.minus(to.getFrom())) > 0.0001) { + // the found vertex v were not on the same line as sharedEdge + adjacentVertex = v; + break; + } + } + } + return adjacentVertex; + } + /** * Display info on the log Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** CoordinateSystem.java 23 Mar 2007 15:27:18 -0000 1.47 --- CoordinateSystem.java 27 Mar 2007 17:18:11 -0000 1.48 *************** *** 137,141 **** /** ! * Constructor secure that they all are orthogonal to each other and normalized * @param i The i vector * @param j The j vector --- 137,141 ---- /** ! * Constructor taking all three axis (normalize and secure orthogonality yourself) * @param i The i vector * @param j The j vector |
|
From: Michael L. <he...@us...> - 2007-03-27 08:47:22
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3047/src/net/sourceforge/bprocessor/model Modified Files: Mesh.java Log Message: Fixed an update mistake in GenericTreeView, where wrong child were updated Removed some non-working update in ClassificationContainer Fixed an error en Mesh.split algorithm that caused ordering of edges to be wrong in surfaces Index: Mesh.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Mesh.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Mesh.java 23 Mar 2007 09:48:57 -0000 1.14 --- Mesh.java 27 Mar 2007 08:47:11 -0000 1.15 *************** *** 168,171 **** --- 168,172 ---- replacement.add(original); } + from = original.otherVertex(from); } current.setEdges(replacement); |
|
From: Michael L. <he...@us...> - 2007-03-27 08:47:15
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2922/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java SpaceTreeView.java Log Message: Fixed an update mistake in GenericTreeView, where wrong child were updated Removed some non-working update in ClassificationContainer Fixed an error en Mesh.split algorithm that caused ordering of edges to be wrong in surfaces Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** GenericTreeView.java 23 Mar 2007 12:53:45 -0000 1.90 --- GenericTreeView.java 27 Mar 2007 08:47:07 -0000 1.91 *************** *** 1040,1049 **** */ public void update(Object o) { ! if (o instanceof Classification) { ! Classification c = (Classification) o; ! ((ClassificationContainer)this.getChildAt(0)).update(c.getChildren()); ! ((ClassificationContainer)this.getChildAt(1)).update(c.getChildren()); } else { ! log.warn("Expected a Classification but found a " + o); } } --- 1040,1049 ---- */ public void update(Object o) { ! if (o instanceof Project) { ! Project c = (Project) o; ! //((ClassificationContainer)this.getChildAt(0)).update(c.getConstructionClas().getChildren()); ! //((ClassificationContainer)this.getChildAt(1)).update(c.getFunctionalClas().getChildren()); } else { ! log.warn("Expected a Classification but found a " + o.getClass().getName()); } } Index: SpaceTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/SpaceTreeView.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** SpaceTreeView.java 19 Mar 2007 12:37:10 -0000 1.20 --- SpaceTreeView.java 27 Mar 2007 08:47:07 -0000 1.21 *************** *** 45,50 **** ((GenericNode)root.getChildAt(2)).update(Project.getInstance().getConstraints()); ((GenericNode)root.getChildAt(3)).update(Project.getInstance().getGlobals()); ! ((GenericNode)root.getChildAt(3)).update(Project.getInstance()); ! ((GenericNode)root.getChildAt(4)).update(Project.getInstance().getConstructors()); } } --- 45,50 ---- ((GenericNode)root.getChildAt(2)).update(Project.getInstance().getConstraints()); ((GenericNode)root.getChildAt(3)).update(Project.getInstance().getGlobals()); ! ((GenericNode)root.getChildAt(4)).update(Project.getInstance()); ! ((GenericNode)root.getChildAt(5)).update(Project.getInstance().getConstructors()); } } |
|
From: rimestad <rim...@us...> - 2007-03-26 10:48:34
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29196/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Space.java Log Message: added a mergeSpaceAssignment to surface as a static method taking three surfaces merging the space assignments from the first two into the last one... used it when deleting edges resulting i merging of surfaces... Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.145 retrieving revision 1.146 diff -C2 -d -r1.145 -r1.146 *** Surface.java 22 Mar 2007 11:44:29 -0000 1.145 --- Surface.java 26 Mar 2007 10:48:22 -0000 1.146 *************** *** 1980,1982 **** --- 1980,2037 ---- return result; } + + /** + * Make space assignments merge + * @param sur1 a surface + * @param sur2 another surface + * @param onto the surface to give the resulting assigment + */ + public static void mergeSpaceAssign(Surface sur1, Surface sur2, Surface onto) { + Space front = null; + Space back = null; + if (sur1.direction(Project.getInstance().getActiveCoordinateSystem()) == + sur2.direction(Project.getInstance().getActiveCoordinateSystem())) { + //the surfaces have the same turning so front is front + if (sur1.getFrontDomain() == sur2.getFrontDomain()) { + front = sur1.getFrontDomain(); + } else if (sur1.getFrontDomain() == sur1.getOwner().empty) { + front = sur2.getFrontDomain(); + } else if (sur2.getFrontDomain() == sur2.getOwner().empty) { + front = sur1.getFrontDomain(); + } + + if (sur1.getBackDomain() == sur2.getBackDomain()) { + back = sur1.getBackDomain(); + } else if (sur1.getBackDomain() == sur1.getOwner().empty) { + back = sur2.getBackDomain(); + } else if (sur2.getBackDomain() == sur2.getOwner().empty) { + back = sur1.getBackDomain(); + } + } else { + if (sur1.getFrontDomain() == sur2.getBackDomain()) { + front = sur1.getFrontDomain(); + } else if (sur1.getFrontDomain() == sur1.getOwner().empty) { + front = sur2.getBackDomain(); + } else if (sur2.getBackDomain() == sur2.getOwner().empty) { + front = sur1.getFrontDomain(); + } + + if (sur1.getBackDomain() == sur2.getFrontDomain()) { + back = sur1.getBackDomain(); + } else if (sur1.getBackDomain() == sur1.getOwner().empty) { + back = sur2.getFrontDomain(); + } else if (sur2.getFrontDomain() == sur2.getOwner().empty) { + back = sur1.getBackDomain(); + } + } + + if (onto.direction(Project.getInstance().getActiveCoordinateSystem()) == + sur1.direction(Project.getInstance().getActiveCoordinateSystem())) { + onto.setFrontDomain(front); + onto.setBackDomain(back); + } else { + onto.setFrontDomain(back); + onto.setBackDomain(front); + } + } } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.125 retrieving revision 1.126 diff -C2 -d -r1.125 -r1.126 *** Space.java 22 Mar 2007 14:37:26 -0000 1.125 --- Space.java 26 Mar 2007 10:48:23 -0000 1.126 *************** *** 844,849 **** if (s1.getExterior() != null) { s1.getExterior().addHole(surface); - // FIXME: Assign spaces } } } --- 844,849 ---- if (s1.getExterior() != null) { s1.getExterior().addHole(surface); } + Surface.mergeSpaceAssign(s1, s2, surface); } } |
|
From: rimestad <rim...@us...> - 2007-03-23 15:27:30
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19250/src/net/sourceforge/bprocessor/gl/tool Modified Files: EdgeMoveTool.java AbstractPencil.java Log Message: made a working implementation of the edgemoveTool, there are some problems still but i works in some sense... The movement gets weird when for example two planes gets planar then the edge placement isn't unique and that gives som weird lacking movement, but otherwise I think it looks ok Index: EdgeMoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/EdgeMoveTool.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EdgeMoveTool.java 22 Mar 2007 11:47:06 -0000 1.1 --- EdgeMoveTool.java 23 Mar 2007 15:27:23 -0000 1.2 *************** *** 12,15 **** --- 12,16 ---- import java.util.Collection; import java.util.HashMap; + import java.util.HashSet; import java.util.LinkedList; import java.util.List; *************** *** 44,48 **** private HashMap<Surface, CoordinateSystem> coordMap; private HashMap<Surface, Line> swiwel; ! private Intersection previous; /** --- 45,50 ---- private HashMap<Surface, CoordinateSystem> coordMap; private HashMap<Surface, Line> swiwel; ! private Vertex initialFrom; ! private Vertex initialTo; /** *************** *** 56,72 **** ! private void move(Vertex to, Vertex from) { if (to == null) { ! System.out.println("move-to null"); } else { for (Surface surface : coordMap.keySet()) { CoordinateSystem system = coordMap.get(surface); ! Vertex about = swiwel.get(surface).getOrigin(); Vertex v1 = to.minus(about); ! Vertex v2 = from.minus(about); ! double angle = v1.dot(v2); ! System.out.println("Angle were " + angle); ! ! system.rotate(angle, swiwel.get(surface)); for (Vertex vertex : verticesMap.get(surface)) { --- 58,76 ---- ! private void move(Vertex to) { if (to == null) { ! System.out.println("move-to or move-from null"); } else { for (Surface surface : coordMap.keySet()) { CoordinateSystem system = coordMap.get(surface); ! Line l = swiwel.get(surface); ! Vertex about = l.getOrigin(); Vertex v1 = to.minus(about); ! v1.normalize(); ! Vertex j = l.getDirection(); ! Vertex n = j.cross(v1); ! v1 = n.cross(j); ! system.setIJN(v1, j, n); ! system.setOrigin(about); for (Vertex vertex : verticesMap.get(surface)) { *************** *** 83,100 **** system.update(); } - /* - system.setOrigin(to); - for (Vertex vertex : vertices) { - Vertex vector = system.getN(); - Collection<Edge> binding = map.get(vertex); - if (!binding.isEmpty()) { - Edge bind = binding.iterator().next(); - vector = bind.getDirection(); - vector.normalize(); - } - Vertex project = system.slide(vertex, vector); - vertex.set(project); - } - system.update();*/ } } --- 87,90 ---- *************** *** 109,121 **** } else { Vertex hit = glv.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); ! previous = current; ! current = new Intersection(hit, Intersection.EDGE, null); Vertex from = start.vertex(); ! makeTarget(current); Vertex to = current.vertex(); Edge edge = new Edge(from, to); edge.setStrippled(true); edges.add(edge); ! move(to, previous.vertex()); } feedback(edges); --- 99,110 ---- } else { Vertex hit = glv.getView().toPlaneCoords(e.getX(), e.getY(), dragplane); ! current = new Intersection(hit, Intersection.EDGE, edge); Vertex from = start.vertex(); ! makeTarget(start); Vertex to = current.vertex(); Edge edge = new Edge(from, to); edge.setStrippled(true); edges.add(edge); ! move(to); } feedback(edges); *************** *** 130,133 **** --- 119,124 ---- if (target instanceof Edge) { edge = (Edge) target; + initialFrom = edge.getFrom().copy(); + initialTo = edge.getTo().copy(); Set<Surface> surfaces = edge.getSurfaces(); verticesMap = new HashMap<Surface, Collection<Vertex>>(); *************** *** 149,154 **** Vertex center = surface.oppositeVertex(edge); swiwel.put(surface, new Line(center, edge.getDirection())); ! ! verticesMap.put(surface, surface.getVertices()); } --- 140,146 ---- Vertex center = surface.oppositeVertex(edge); swiwel.put(surface, new Line(center, edge.getDirection())); ! Set<Vertex> verts = new HashSet<Vertex>(); ! Geometry.collect(surface, verts); ! verticesMap.put(surface, verts); } *************** *** 158,168 **** if (!coordMap.containsKey(surface)) { CoordinateSystem system = surface.coordinateSystem(); ! system.onlyPlane(true); system.setActive(true); coordMap.put(surface, system); } } } start = findIntersection(e); makeTarget(start); for (CoordinateSystem cs : coordMap.values()) { --- 150,163 ---- if (!coordMap.containsKey(surface)) { CoordinateSystem system = surface.coordinateSystem(); ! system.onlyPlane(false); system.setActive(true); coordMap.put(surface, system); } } + } else { + return; } start = findIntersection(e); + current = start; makeTarget(start); for (CoordinateSystem cs : coordMap.values()) { *************** *** 177,186 **** Edge ray = new Edge(near, far); ray = trans.unProject(ray); ! Vertex dir = edge.getDirection(); ! Plane plane = new Plane(dir.getX(), dir.getY(), dir.getZ(), start.vertex()); ! dragplane = plane.orthogonalPlane(ray); ! } else { Project.getInstance().checkpoint(); cleanUp(); moved(e); --- 172,182 ---- Edge ray = new Edge(near, far); ray = trans.unProject(ray); ! Vertex norm = ray.getDirection(); ! norm.normalize(); ! norm.scale(-1); ! dragplane = new Plane(norm.getX(), norm.getY(), norm.getZ(), start.vertex()); } else { Project.getInstance().checkpoint(); + start = null; cleanUp(); moved(e); *************** *** 192,196 **** public void cleanUp() { if (start != null) { ! move(current.vertex(), start.vertex()); } if (coordMap != null) { --- 188,194 ---- public void cleanUp() { if (start != null) { ! move(start.vertex()); ! edge.getTo().set(initialTo); ! edge.getFrom().set(initialFrom); } if (coordMap != null) { Index: AbstractPencil.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractPencil.java,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** AbstractPencil.java 6 Feb 2007 17:28:26 -0000 1.73 --- AbstractPencil.java 23 Mar 2007 15:27:23 -0000 1.74 *************** *** 604,608 **** case Intersection.EDGE: Edge edge = (Edge) intersection.object(); ! if (edge.getStrippled()) { target = current; targetColor = View.EDGE_ON_COLOR; --- 604,608 ---- case Intersection.EDGE: Edge edge = (Edge) intersection.object(); ! if (edge != null && edge.getStrippled()) { target = current; targetColor = View.EDGE_ON_COLOR; |
|
From: rimestad <rim...@us...> - 2007-03-23 15:27:27
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19236/src/net/sourceforge/bprocessor/model Modified Files: Vertex.java Geometry.java CoordinateSystem.java Log Message: made a working implementation of the edgemoveTool, there are some problems still but i works in some sense... The movement gets weird when for example two planes gets planar then the edge placement isn't unique and that gives som weird lacking movement, but otherwise I think it looks ok Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** Vertex.java 22 Mar 2007 14:37:26 -0000 1.56 --- Vertex.java 23 Mar 2007 15:27:18 -0000 1.57 *************** *** 156,160 **** /** ! * * @param other Vertex */ --- 156,160 ---- /** ! * Set the placement of this to the given vertex * @param other Vertex */ Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** CoordinateSystem.java 22 Mar 2007 11:45:31 -0000 1.46 --- CoordinateSystem.java 23 Mar 2007 15:27:18 -0000 1.47 *************** *** 823,827 **** * rotate a coordinatesystem about a line * rotate all axis about 0,0,0 and the origin about line.origin ! * @param angle the angle to rotate * @param line the line to rotate about */ --- 823,827 ---- * rotate a coordinatesystem about a line * rotate all axis about 0,0,0 and the origin about line.origin ! * @param angle the angle in radian to rotate * @param line the line to rotate about */ Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** Geometry.java 16 Feb 2007 09:29:26 -0000 1.45 --- Geometry.java 23 Mar 2007 15:27:18 -0000 1.46 *************** *** 177,181 **** /** * Rotate ! * @param angle The angle * @param x The x * @param y The y --- 177,181 ---- /** * Rotate ! * @param angle The angle in radian * @param x The x * @param y The y |
|
From: Michael L. <he...@us...> - 2007-03-23 13:20:10
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1392/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Hilites spaces again Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.199 retrieving revision 1.200 diff -C2 -d -r1.199 -r1.200 *** View.java 23 Mar 2007 12:54:49 -0000 1.199 --- View.java 23 Mar 2007 13:20:04 -0000 1.200 *************** *** 908,912 **** while (iter.hasNext()) { Object o = iter.next(); ! if (o instanceof Surface) { drawGeometric((Geometric) o); } --- 908,912 ---- while (iter.hasNext()) { Object o = iter.next(); ! if (o instanceof Surface || o instanceof Edge) { drawGeometric((Geometric) o); } *************** *** 914,917 **** --- 914,919 ---- } + + drawSpace(Project.getInstance().world(), false, false); |
|
From: Michael L. <he...@us...> - 2007-03-23 12:54:51
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23681/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: Grid uses linewidth 0.5 Index: View.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.198 retrieving revision 1.199 diff -C2 -d -r1.198 -r1.199 *** View.java 22 Mar 2007 11:46:34 -0000 1.198 --- View.java 23 Mar 2007 12:54:49 -0000 1.199 *************** *** 808,814 **** protected void grid(CoordinateSystem cs) { double size = View.gridSize(); ! gl.glLineWidth(1.0f); gl.glColor4fv(gridColor, 0); ! //gl.glDisable(GL.GL_DEPTH_TEST); gl.glBegin(GL.GL_LINES); --- 808,814 ---- protected void grid(CoordinateSystem cs) { double size = View.gridSize(); ! gl.glLineWidth(0.5f); gl.glColor4fv(gridColor, 0); ! gl.glEnable(GL.GL_DEPTH_TEST); gl.glBegin(GL.GL_LINES); *************** *** 970,974 **** } } ! drawConstructorPlanes(); } --- 970,974 ---- } } ! grid(Project.getInstance().getActiveCoordinateSystem()); drawConstructorPlanes(); } *************** *** 1230,1234 **** drawGeneralConstructor(Project.getInstance().getActiveCoordinateSystem(), dist, true, OBJECTS); ! grid(Project.getInstance().getActiveCoordinateSystem()); gl.glPopMatrix(); } --- 1230,1234 ---- drawGeneralConstructor(Project.getInstance().getActiveCoordinateSystem(), dist, true, OBJECTS); ! // grid(Project.getInstance().getActiveCoordinateSystem()); gl.glPopMatrix(); } |
|
From: Michael L. <he...@us...> - 2007-03-23 12:53:45
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv23273/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Fixed class-cast exception Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** GenericTreeView.java 19 Mar 2007 12:48:25 -0000 1.89 --- GenericTreeView.java 23 Mar 2007 12:53:45 -0000 1.90 *************** *** 502,506 **** * @param sort boolean that is true if the entities should be sorted */ ! public void insertChildren(Collection<Entity> entities, boolean sort) { LinkedList sorted = new LinkedList(entities); if (sort) { --- 502,506 ---- * @param sort boolean that is true if the entities should be sorted */ ! public void insertChildren(Collection entities, boolean sort) { LinkedList sorted = new LinkedList(entities); if (sort) { *************** *** 975,981 **** /** {@inheritDoc} */ public EntityNode nodeFor(Object entity) { - return new ClassificationNode((Classification) entity); - } /** --- 975,979 ---- |
|
From: Michael L. <he...@us...> - 2007-03-23 09:49:05
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13529/src/net/sourceforge/bprocessor/model Modified Files: Mesh.java Log Message: Progress on mesh Index: Mesh.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Mesh.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Mesh.java 22 Mar 2007 14:37:26 -0000 1.13 --- Mesh.java 23 Mar 2007 09:48:57 -0000 1.14 *************** *** 117,123 **** for (Vertex vertex : others) { split(vertex, added, removed); } - edges.removeAll(removed); - edges.addAll(added); } --- 117,125 ---- for (Vertex vertex : others) { split(vertex, added, removed); + edges.removeAll(removed); + edges.addAll(added); + removed.clear(); + added.clear(); } } *************** *** 132,135 **** --- 134,138 ---- Collection<Edge> added, Collection<Edge> removed) { boolean add = false; + for (Edge edge : edges) { if (edge.coincides(vertex)) { |