bprocessor-commit Mailing List for B-processor (Page 63)
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: rimestad <rim...@us...> - 2007-05-24 10:58:13
|
Update of /cvsroot/bprocessor//gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18341/src/net/sourceforge/bprocessor/gui Modified Files: PopupMenu.java Log Message: some better type handling Index: PopupMenu.java =================================================================== RCS file: /cvsroot/bprocessor//gui/src/net/sourceforge/bprocessor/gui/PopupMenu.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** PopupMenu.java 17 Apr 2007 13:05:11 -0000 1.32 --- PopupMenu.java 24 May 2007 10:58:12 -0000 1.33 *************** *** 351,355 **** * @return the popupmenu */ ! public static JPopupMenu getEntiesMenu(Collection entities) { JPopupMenu menu = new JPopupMenu(); AbstractAction delete = new EntitiesMenuAction(entities, "Delete") { --- 351,355 ---- * @return the popupmenu */ ! public static JPopupMenu getEntiesMenu(Collection<Geometric> entities) { JPopupMenu menu = new JPopupMenu(); AbstractAction delete = new EntitiesMenuAction(entities, "Delete") { *************** *** 407,417 **** Space owner = null; ! Collection<Geometric> geometrics = (Collection<Geometric>) entities; ! for (Geometric geometric : geometrics) { ! if (geometric instanceof Space) { ! interior.add((Space) geometric); } } ! for (Space space : interior) { surfaces.addAll(space.getEnvelope()); --- 407,419 ---- Space owner = null; ! for (Entity ent : entities) { ! if (ent instanceof Space) { ! interior.add((Space) ent); } } ! if (interior.isEmpty()) { ! //Do nothing ! return; ! } for (Space space : interior) { surfaces.addAll(space.getEnvelope()); |
From: rimestad <rim...@us...> - 2007-05-24 10:57:48
|
Update of /cvsroot/bprocessor//gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17982/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Log Message: name fix Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor//gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** GUI.java 15 Apr 2007 11:07:42 -0000 1.66 --- GUI.java 24 May 2007 10:57:48 -0000 1.67 *************** *** 264,268 **** int lvl = Project.getInstance().getActiveSpace().getLevel(); if (lvl < Space.PART_LEVEL) { ! String append = Space.levelToSting(lvl + 1); JMenuItem createFunctionalSpace = new JMenuItem("Functional " + append); --- 264,268 ---- int lvl = Project.getInstance().getActiveSpace().getLevel(); if (lvl < Space.PART_LEVEL) { ! String append = Space.levelToString(lvl + 1); JMenuItem createFunctionalSpace = new JMenuItem("Functional " + append); |
From: rimestad <rim...@us...> - 2007-05-24 10:57:24
|
Update of /cvsroot/bprocessor//gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17969/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: changed labels for unions and container for inner elements Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor//gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** GenericTreeView.java 9 May 2007 09:31:05 -0000 1.100 --- GenericTreeView.java 24 May 2007 10:57:23 -0000 1.101 *************** *** 598,602 **** Set surfaces = space.getEnvelope(); add(new SurfaceContainer("Envelope", surfaces)); ! add(new ElementContainer(space.getElements())); add(new GeometryContainer("Geometry", space)); ContainerNode cn = new ConstructorContainer("Constructors", space.getConstructors()); --- 598,608 ---- Set surfaces = space.getEnvelope(); add(new SurfaceContainer("Envelope", surfaces)); ! String lvlstr = ""; ! if (space.isUnion()) { ! lvlstr = Space.levelToString(space.getLevel()); ! } else { ! lvlstr = Space.levelToString(space.getLevel() + 1); ! } ! add(new ElementContainer(lvlstr, space.getElements())); add(new GeometryContainer("Geometry", space)); ContainerNode cn = new ConstructorContainer("Constructors", space.getConstructors()); *************** *** 920,931 **** * Constructor * @param elements The elements */ ! public ElementContainer(Collection elements) { ! super("", elements); Iterator iter = elements.iterator(); - setUserObject("Unknown"); if (iter.hasNext()) { Space s = (Space)iter.next(); - setUserObject(s.getLevelString()); } insertChildren(elements, true); --- 926,936 ---- * Constructor * @param elements The elements + * @param name the string that should be shown on this object */ ! public ElementContainer(String name, Collection elements) { ! super(name, elements); Iterator iter = elements.iterator(); if (iter.hasNext()) { Space s = (Space)iter.next(); } insertChildren(elements, true); |
From: rimestad <rim...@us...> - 2007-05-24 10:56:18
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17580/src/net/sourceforge/bprocessor/model Modified Files: Selector.java Log Message: made selector generic Index: Selector.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Selector.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Selector.java 30 Jan 2007 16:18:04 -0000 1.2 --- Selector.java 24 May 2007 10:56:16 -0000 1.3 *************** *** 7,10 **** --- 7,11 ---- package net.sourceforge.bprocessor.model; + import java.util.ArrayList; import java.util.List; *************** *** 13,18 **** /** * A list of possible values for an attribute. */ ! public class Selector { /** The logger */ --- 14,20 ---- /** * A list of possible values for an attribute. + * @param <Type> The type contained in the selector */ ! public class Selector<Type> { /** The logger */ *************** *** 20,27 **** /** The options to choose from */ ! private List options; /** The choice of the options */ ! private Object currentValue; /** --- 22,29 ---- /** The options to choose from */ ! private List<Type> options; /** The choice of the options */ ! private Type currentValue; /** *************** *** 29,35 **** * @param options initial options */ ! public Selector(List options) { this.options = options; } /** --- 31,49 ---- * @param options initial options */ ! public Selector(List<Type> options) { this.options = options; } + + /** + * Constructor taking a abitrary number of options for the selector, the object + * have to be of the same type as specified in the constructor + * @param options the options wanted + */ + public Selector(Type ...options) { + this.options = new ArrayList<Type>(options.length); + for (Type t : options) { + this.options.add(t); + } + } /** *************** *** 37,41 **** * @return the current value */ ! public Object getCurrentValue() { return currentValue; } --- 51,55 ---- * @return the current value */ ! public Type getCurrentValue() { return currentValue; } *************** *** 46,50 **** * @param value a new value */ ! public void setCurrentValue(Object value) { if (options.contains(value)) { this.currentValue = value; --- 60,64 ---- * @param value a new value */ ! public void setCurrentValue(Type value) { if (options.contains(value)) { this.currentValue = value; |
From: rimestad <rim...@us...> - 2007-05-24 10:55:43
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17199/src/net/sourceforge/bprocessor/model/modellor Modified Files: ModelBathModellor2.java Log Message: improvements on the modellor Index: ModelBathModellor2.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/modellor/ModelBathModellor2.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ModelBathModellor2.java 20 May 2007 10:27:07 -0000 1.2 --- ModelBathModellor2.java 24 May 2007 10:55:42 -0000 1.3 *************** *** 18,21 **** --- 18,22 ---- import net.sourceforge.bprocessor.model.CoordinateSystem; import net.sourceforge.bprocessor.model.Edge; + import net.sourceforge.bprocessor.model.Geometric; import net.sourceforge.bprocessor.model.Geometry; import net.sourceforge.bprocessor.model.Net; *************** *** 46,51 **** private Space bath; - private double shaftOffset; - private double length; --- 47,50 ---- *************** *** 68,72 **** private double windowOffset = 1.2; ! private double doorWindow = 0.5; /** --- 67,73 ---- private double windowOffset = 1.2; ! private double windowHeight = 0.5; ! ! private Collection<Space> doorAndWindows = new ArrayList<Space>(); /** *************** *** 75,79 **** public ModelBathModellor2() { super(); - shaftOffset = 100; } --- 76,79 ---- *************** *** 130,138 **** /** {@inheritDoc} */ public void update(Object entity) { ! if (entity.equals(net) || entity.equals(this) || entity.equals(space) && isActive()) { ! cleanUp(); ! space.add(net); ! checkNetProperties(); ! generateBath(); } } --- 130,150 ---- /** {@inheritDoc} */ public void update(Object entity) { ! if (isActive()) { ! boolean doIt = false; ! if (entity instanceof Geometric) { ! Geometric g = (Geometric)entity; ! if (g.getOwner() == net || g.getOwner() == space) { ! doIt = true; ! } ! } ! if (entity.equals(net) || entity.equals(this) || entity.equals(space)) { ! doIt = true; ! } ! if (doIt) { ! cleanUp(); ! space.add(net); ! checkNetProperties(); ! generateBath(); ! } } } *************** *** 155,158 **** --- 167,380 ---- makeCeiling(); makeDoorAndWindows(); + + elementWalls(); + //addTileModellors(); + } + + private void addTileModellors() { + for (Space elem : walls.getElements()) { + elem.setModellor(new TileModellor(elem)); + } + } + + private void elementWalls2() { + WallPartingModellor wpm = new WallPartingModellor(walls, net); + + walls.setModellor(wpm); + wpm.update(walls); + } + + /** + * Part the walls space into elements + */ + private void elementWalls() { + double wallHeight = height - floorThickness - ceilingThickness; + Vertex toInnerOffset = null; + Vertex fromInnerOffset = null; + Vertex center = net.getSurfaces().iterator().next().center(); + List<List<Edge>> straights = new LinkedList<List<Edge>>(); + List<Edge> remainingEdges = new ArrayList<Edge>(net.getEdges()); + while (!remainingEdges.isEmpty()) { + List<Edge> parallel = remainingEdges.get(0).parrallelRun(); + straights.add(parallel); + remainingEdges.removeAll(parallel); + } + List<Surface> concretes = new ArrayList<Surface>(straights.size()); + List<Surface> tiles = new ArrayList<Surface>(straights.size()); + for (List<Edge> list : straights) { + Edge outer = new Edge(list.get(0).getFrom(), + list.get(list.size() - 1).getTo()); + Edge outerCopy = outer.copy(); + Edge tileCopy = outer.copy(); + //Check if from corner should belong to outer + Object info = outer.getFrom().getParameters().environment().get("Corner"); + if (info != null) { + if (info instanceof Selector) { + Selector<String> s = (Selector<String>)info; + String corner = s.getCurrentValue(); + if (corner.equals("Left")) { + Vertex delta = outer.getDirection(); + delta.normalize(); + delta.scale(wallThickness - 0.005); + outerCopy.getFrom().move(delta.getX(), delta.getY(), delta.getZ()); + delta.normalize(); + delta.scale(wallThickness); + tileCopy.getFrom().move(delta.getX(), delta.getY(), delta.getZ()); + fromInnerOffset = null; + } else { + Vertex delta = outer.getDirection(); + delta.normalize(); + delta.scale(wallThickness); + tileCopy.getFrom().move(delta.getX(), delta.getY(), delta.getZ()); + if (corner.equals("Split")) { + fromInnerOffset = delta; + fromInnerOffset.normalize(); + fromInnerOffset.scale(wallThickness - 0.005); + } + } + } + } + //check if to corner should belong to outer + info = outer.getTo().getParameters().environment().get("Corner"); + if (info != null) { + if (info instanceof Selector) { + Selector<String> s = (Selector<String>)info; + String corner = s.getCurrentValue(); + if (corner.equals("Right")) { + Vertex delta = outer.getDirection(); + delta.normalize(); + delta.scale(-1); + delta.scale(wallThickness - 0.005); + outerCopy.getTo().move(delta.getX(), delta.getY(), delta.getZ()); + delta.normalize(); + delta.scale(wallThickness); + tileCopy.getTo().move(delta.getX(), delta.getY(), delta.getZ()); + toInnerOffset = null; + } else { + Vertex delta = outer.getDirection(); + delta.normalize(); + delta.scale(-1); + delta.scale(wallThickness); + tileCopy.getTo().move(delta.getX(), delta.getY(), delta.getZ()); + if (corner.equals("Split")) { + toInnerOffset = delta; + toInnerOffset.normalize(); + toInnerOffset.scale(wallThickness - 0.005); + } + } + } + } + //create a surface for the outline of the wall element + //surface for concrete + Edge inner = outerCopy.copy(); + if (toInnerOffset != null) { + inner.getTo().move(toInnerOffset); + } + if (fromInnerOffset != null) { + inner.getFrom().move(fromInnerOffset); + } + Vertex inter = inner.intersection(center); + Vertex dir = center.minus(inter); + dir.normalize(); + Vertex usedDir = dir.copy(); + usedDir.scale(wallThickness - 0.005); + inner.move(usedDir); + Edge between1 = new Edge(outerCopy.getFrom(), inner.getFrom()); + Edge between2 = new Edge(inner.getTo(), outerCopy.getTo()); + Surface s = new Surface(inner, between1, outerCopy, between2); + Space concrete = new Space("Concrete", Space.CONSTRUCTION, Space.ELEMENT_LEVEL, true); + walls.add(concrete); + if (s.normal().getZ() == 1.0) { + s.setFrontDomain(concrete); + } else { + s.setBackDomain(concrete); + } + concretes.add(s); + //surface for tiles + dir.normalize(); + dir.scale(wallThickness - 0.005); + tileCopy.move(dir); + Edge inner2 = tileCopy.copy(); + dir.normalize(); + dir.scale(0.005); + inner2.move(dir); + between1 = new Edge(tileCopy.getFrom(), inner2.getFrom()); + between2 = new Edge(inner2.getTo(), tileCopy.getTo()); + s = new Surface(inner2, between1, tileCopy, between2); + Space tile = new Space("Tile", Space.CONSTRUCTION, Space.ELEMENT_LEVEL, true); + walls.add(tile); + if (s.normal().getZ() == 1.0) { + s.setFrontDomain(tile); + } else { + s.setBackDomain(tile); + } + tiles.add(s); + } + CoordinateSystem cs = coord.copy(); + cs.move(0, 0, floorThickness); + Geometry.unTranslateGeometry(concretes, cs); + Geometry.unTranslateGeometry(tiles, cs); + for (Surface s : concretes) { + s.setEdges(walls.insert(s.getEdges())); + walls.add(s); + } + for (Surface s : tiles) { + s.setEdges(walls.insert(s.getEdges())); + walls.add(s); + } + + //split edges at crossings + Collection<Vertex> verts = walls.getVertices(); + List<Edge> edges = new LinkedList<Edge>(walls.getEdges()); + while (!edges.isEmpty()) { + Edge e = edges.get(0); + for (Vertex v : verts) { + if (!e.contains(v) && e.coincides(v) && !e.getFrom().equalEps(v) && + !e.getTo().equalEps(v)) { + Vertex intersection = e.intersection(v); + edges.addAll(e.split(intersection)); + break; + } + } + edges.remove(0); + } + + Collection<Surface> sides = new ArrayList<Surface>(5); + Collection<Surface> bottoms = new ArrayList<Surface>(walls.getSurfaces()); + // extrude concrete and tiles up + for (Surface s : bottoms) { + double dist = wallHeight; + if (s.getFrontDomain() == walls.getEmpty()) { + dist *= -1; + } + sides.add(s.extrusion(dist, sides)); + for (Surface side : sides) { + walls.insert(side); + } + sides.clear(); + } + // copy doors and windows in + for (Space spc : doorAndWindows) { + double maxDist = 0; + Surface outer = null; + for (Surface s : spc.getEnvelope()) { + Surface news = s.copy(walls); + double dist = news.center().distance(center); + Geometry.holeAnalysis(news); + if (dist > maxDist && + Math.abs(news.normal().getZ()) < 0.0001 && + news.getExterior() != null) { + maxDist = dist; + outer = news; + } + } + sides.clear(); + Surface s = outer.extrusion(-(wallThickness - 0.005), sides); + walls.insert(s); + for (Surface sur : sides) { + walls.insert(sur); + } + + } } *************** *** 165,168 **** --- 387,391 ---- // make a door Space doorSpc = new Space("Door", Space.CONSTRUCTION, Space.SPACE_LEVEL, true); + doorAndWindows.add(doorSpc); space.add(doorSpc); doorSpc.setTransparent(true); *************** *** 190,194 **** in = dir.cross(up); sur = space.insert(sur); - Geometry.holeAnalysis(sur); Collection<Surface> sides = new LinkedList<Surface>(); Surface t; --- 413,416 ---- *************** *** 204,211 **** space.insert(surface); } - Geometry.holeAnalysis(t); } else if (s.getCurrentValue().equals("Window")) { //make a window Space winSpc = new Space("Window", Space.CONSTRUCTION, Space.SPACE_LEVEL, true); space.add(winSpc); winSpc.setTransparent(true); --- 426,433 ---- space.insert(surface); } } else if (s.getCurrentValue().equals("Window")) { //make a window Space winSpc = new Space("Window", Space.CONSTRUCTION, Space.SPACE_LEVEL, true); + doorAndWindows.add(winSpc); space.add(winSpc); winSpc.setTransparent(true); *************** *** 220,224 **** win.add(side2); bottom.move(new Vertex(0, 0, floorThickness + windowOffset)); ! top.move(new Vertex(0, 0, floorThickness + windowOffset + doorWindow)); Surface sur = new Surface(win); Vertex center = net.getSurfaces().iterator().next().center(); --- 442,446 ---- win.add(side2); bottom.move(new Vertex(0, 0, floorThickness + windowOffset)); ! top.move(new Vertex(0, 0, floorThickness + windowOffset + windowHeight)); Surface sur = new Surface(win); Vertex center = net.getSurfaces().iterator().next().center(); *************** *** 268,272 **** } } ! /** * Generate wall element --- 490,494 ---- } } ! /** * Generate wall element *************** *** 402,410 **** Map<String, Object> env = e.getParameters().environment(); if (!env.containsKey("Type")) { ! List options = new LinkedList(); ! options.add("Wall"); ! options.add("Door"); ! options.add("Window"); ! Selector sel = new Selector(options); sel.setCurrentValue("Wall"); e.getParameters().put(new Attribute("Type", sel)); --- 624,628 ---- Map<String, Object> env = e.getParameters().environment(); if (!env.containsKey("Type")) { ! Selector<String> sel = new Selector<String>("Wall", "Door", "Window"); sel.setCurrentValue("Wall"); e.getParameters().put(new Attribute("Type", sel)); *************** *** 416,431 **** if (!env.containsKey("Corner")) { switch (v.getEdges().size()) { - case 3 : - v.getParameters().put(new Attribute("Corner", "Straight")); - break; case 2 : ! List options = new LinkedList(); ! options.add("Left"); ! options.add("Right"); ! Selector sel = new Selector(options); sel.setCurrentValue("Left"); v.getParameters().put(new Attribute("Corner", sel)); break; ! default: break; } --- 634,648 ---- if (!env.containsKey("Corner")) { switch (v.getEdges().size()) { case 2 : ! Selector<String> sel = new Selector<String>("Left", "Right", "Split"); sel.setCurrentValue("Left"); v.getParameters().put(new Attribute("Corner", sel)); break; ! } ! } else { ! switch (v.getEdges().size()) { ! case 1 : ! case 3 : ! v.getParameters().clear(); break; } *************** *** 435,438 **** --- 652,656 ---- /** {@inheritDoc} */ + @Override public Modellor newInstance(Space s) { if (s.getLevel() == Space.SPACE_LEVEL) { *************** *** 444,447 **** --- 662,666 ---- /** {@inheritDoc} */ + @Override public void delete() { space.setModellor(null); *************** *** 453,456 **** --- 672,682 ---- private void cleanUp() { space.clear(); + if (walls != null) { + walls.clear(); + floor.clear(); + bath.clear(); + ceiling.clear(); + } + doorAndWindows.clear(); } *************** *** 470,476 **** height = (Double)a.getValue(); } ! a = attributes.get("Shaft-offset"); if (a != null) { ! shaftOffset = (Double)a.getValue(); } update(space); --- 696,722 ---- height = (Double)a.getValue(); } ! a = attributes.get("Floor thickness"); if (a != null) { ! floorThickness = (Double)a.getValue(); ! } ! a = attributes.get("Wall thickness"); ! if (a != null) { ! wallThickness = (Double)a.getValue(); ! } ! a = attributes.get("Ceiling thickness"); ! if (a != null) { ! ceilingThickness = (Double)a.getValue(); ! } ! a = attributes.get("Door height"); ! if (a != null) { ! doorHeight = (Double)a.getValue(); ! } ! a = attributes.get("Window offset"); ! if (a != null) { ! windowOffset = (Double)a.getValue(); ! } ! a = attributes.get("Window height"); ! if (a != null) { ! windowHeight = (Double)a.getValue(); } update(space); *************** *** 478,489 **** /** {@inheritDoc} */ public void getAttributes(List<Attribute> l) { l.add(new Attribute("Length", length, true)); l.add(new Attribute("Width", width, true)); l.add(new Attribute("Height", height, true)); ! l.add(new Attribute("Shaft-offset", shaftOffset, true)); } /** {@inheritDoc} */ public String getName() { return "New Bath-module"; --- 724,742 ---- /** {@inheritDoc} */ + @Override public void getAttributes(List<Attribute> l) { l.add(new Attribute("Length", length, true)); l.add(new Attribute("Width", width, true)); l.add(new Attribute("Height", height, true)); ! l.add(new Attribute("Floor thickness", floorThickness, true)); ! l.add(new Attribute("Wall thickness", wallThickness, true)); ! l.add(new Attribute("Ceiling thickness", ceilingThickness, true)); ! l.add(new Attribute("Door height", floorThickness, true)); ! l.add(new Attribute("Window offset", windowOffset, true)); ! l.add(new Attribute("Window height", windowHeight, true)); } /** {@inheritDoc} */ + @Override public String getName() { return "New Bath-module"; *************** *** 491,494 **** --- 744,748 ---- /** {@inheritDoc} */ + @Override public String getGeneralName() { return "New Bath-module modellor"; *************** *** 496,506 **** --- 750,782 ---- /** {@inheritDoc} */ + @Override public void setSubContent(Map<String, Object> m) { space = (Space)m.get("Space"); + net = (Net)m.get("Net"); + wallThickness = (Double)m.get("wallThickness"); + floorThickness = (Double)m.get("floorThickness"); + ceilingThickness = (Double)m.get("ceilingThickness"); + length = (Double)m.get("length"); + width = (Double)m.get("width"); + height = (Double)m.get("height"); + windowOffset = (Double)m.get("windowOffset"); + windowHeight = (Double)m.get("windowHeight"); + doorHeight = (Double)m.get("doorHeight"); } /** {@inheritDoc} */ + @Override public void getSubContent(Map<String, Object> m) { m.put("Space", space); + m.put("Net", net); + m.put("wallThickness", wallThickness); + m.put("floorThickness", floorThickness); + m.put("ceilingThickness", ceilingThickness); + m.put("length", length); + m.put("height", height); + m.put("widht", width); + m.put("windowOffset", windowOffset); + m.put("windowHeight", windowHeight); + m.put("doorHeight", doorHeight); } |
From: rimestad <rim...@us...> - 2007-05-24 10:54:36
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16807/src/net/sourceforge/bprocessor/model Modified Files: Vertex.java Log Message: added a move method to vertex that take a vector instead of dx, dy, dz (the new method just unpacks the vertex and calls the old method Index: Vertex.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Vertex.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** Vertex.java 16 Apr 2007 15:55:22 -0000 1.59 --- Vertex.java 24 May 2007 10:54:36 -0000 1.60 *************** *** 402,405 **** --- 402,413 ---- /** + * Moves the vertex the vector d + * @param d the move vector + */ + public void move(Vertex d) { + move(d.getX(), d.getY(), d.getZ()); + } + + /** * String representation of the object * @return The string |
From: rimestad <rim...@us...> - 2007-05-24 10:53:14
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16348/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: added new constructor to surface that take abitary number of edges as argument Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.161 retrieving revision 1.162 diff -C2 -d -r1.161 -r1.162 *** Surface.java 20 May 2007 10:21:20 -0000 1.161 --- Surface.java 24 May 2007 10:53:13 -0000 1.162 *************** *** 155,158 **** --- 155,170 ---- setEdges(edges); } + + /** + * Constructor + * @param edges The edges + */ + public Surface(Edge ...edges) { + List<Edge> tmp = new ArrayList<Edge>(edges.length); + for (Edge e : edges) { + tmp.add(e); + } + setEdges(tmp); + } /** |
From: rimestad <rim...@us...> - 2007-05-24 10:49:34
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14725/src/net/sourceforge/bprocessor/model Modified Files: ParameterBlock.java Log Message: added possibility to clear parameterblocks Index: ParameterBlock.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/ParameterBlock.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ParameterBlock.java 14 Apr 2007 15:00:47 -0000 1.8 --- ParameterBlock.java 24 May 2007 10:49:34 -0000 1.9 *************** *** 128,130 **** --- 128,137 ---- parameters.remove(a); } + + /** + * Clear the list of parameters + */ + public void clear() { + parameters.clear(); + } } |
From: rimestad <rim...@us...> - 2007-05-24 10:47:15
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13940/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: removed old bathmodellor from list Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.125 retrieving revision 1.126 diff -C2 -d -r1.125 -r1.126 *** Project.java 18 May 2007 19:08:37 -0000 1.125 --- Project.java 24 May 2007 10:47:14 -0000 1.126 *************** *** 25,29 **** import net.sourceforge.bprocessor.model.modellor.InnerWallModellor; import net.sourceforge.bprocessor.model.modellor.LayerModellor; - import net.sourceforge.bprocessor.model.modellor.ModelBathModellor; import net.sourceforge.bprocessor.model.modellor.ModelBathModellor2; import net.sourceforge.bprocessor.model.modellor.Modellor; --- 25,28 ---- *************** *** 162,166 **** Modellor.registerModellor(new Cylinder()); Modellor.registerModellor(new WindowModellor()); - Modellor.registerModellor(new ModelBathModellor()); Modellor.registerModellor(new ModelBathModellor2()); --- 161,164 ---- |
From: rimestad <rim...@us...> - 2007-05-24 10:44:54
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12759/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Log Message: Some generics Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** Edge.java 20 May 2007 10:29:23 -0000 1.89 --- Edge.java 24 May 2007 10:44:53 -0000 1.90 *************** *** 94,99 **** * @return Collection of edges that coincides */ ! public static Set findEdge(Collection edges, Vertex vertex) { ! Set result = new HashSet(); Iterator iter = edges.iterator(); while (iter.hasNext()) { --- 94,99 ---- * @return Collection of edges that coincides */ ! public static Set<Edge> findEdge(Collection<Edge> edges, Vertex vertex) { ! Set<Edge> result = new HashSet<Edge>(); Iterator iter = edges.iterator(); while (iter.hasNext()) { *************** *** 283,287 **** * @return A copy */ ! public Edge copy(Map map) { Edge copy = (Edge) map.get(this); if (copy == null) { --- 283,287 ---- * @return A copy */ ! public Edge copy(Map<Edge, Edge> map) { Edge copy = (Edge) map.get(this); if (copy == null) { *************** *** 412,417 **** * @return a list containing the two new edges */ ! public Collection split(Vertex vertex) { ! List added = new ArrayList(); Vertex from = getFrom(); Vertex to = getTo(); --- 412,417 ---- * @return a list containing the two new edges */ ! public List<Edge> split(Vertex vertex) { ! List<Edge> added = new ArrayList<Edge>(); Vertex from = getFrom(); Vertex to = getTo(); *************** *** 586,591 **** * @return the set of vertices */ ! public Set collect() { ! Set result = new HashSet(); result.add(this.to); result.add(this.from); --- 586,591 ---- * @return the set of vertices */ ! public Set<Vertex> collect() { ! Set<Vertex> result = new HashSet<Vertex>(); result.add(this.to); result.add(this.from); *************** *** 630,634 **** */ public static Set<Surface> surfaces(Collection edges) { ! Set surfaces = new HashSet<Surface>(); Iterator iter = edges.iterator(); while (iter.hasNext()) { --- 630,634 ---- */ public static Set<Surface> surfaces(Collection edges) { ! Set<Surface> surfaces = new HashSet<Surface>(); Iterator iter = edges.iterator(); while (iter.hasNext()) { *************** *** 648,656 **** * @return an offset-direction map for each vertex */ ! public static Map offsetDirections(List which, Surface inner, double offset) { ! Map offsets = new HashMap(); ! Iterator it = which.iterator(); ! while (it.hasNext()) { ! offsets.put(it.next(), Double.valueOf(offset)); } return offsetDirections(which, inner, offsets); --- 648,656 ---- * @return an offset-direction map for each vertex */ ! public static Map<Vertex, Vertex> offsetDirections(List<Edge> which, Surface inner, ! double offset) { ! Map<Edge, Double> offsets = new HashMap<Edge, Double>(); ! for (Edge e : which) { ! offsets.put(e, Double.valueOf(offset)); } return offsetDirections(which, inner, offsets); *************** *** 667,672 **** * @return an offset-direction map for each vertex */ ! public static Map offsetDirections(List which, Surface inner, Map offsetMap) { ! Map v2Dir = new HashMap(); Edge e1 = null; Edge e2 = null; --- 667,673 ---- * @return an offset-direction map for each vertex */ ! public static Map<Vertex, Vertex> offsetDirections(List<Edge> which, Surface inner, ! Map<Edge, Double> offsetMap) { ! Map<Vertex, Vertex> v2Dir = new HashMap<Vertex, Vertex>(); Edge e1 = null; Edge e2 = null; *************** *** 750,759 **** * @return a list of the constructed edges. */ ! public static List placeOffset(List which, Surface inner, Map offsetMap) { ! Map v2v = new HashMap(); ! Map e2e = new LinkedHashMap(); ! Iterator it = which.iterator(); ! while (it.hasNext()) { ! Edge e = (Edge)it.next(); Vertex from = e.getFrom(); Vertex to = e.getTo(); --- 751,758 ---- * @return a list of the constructed edges. */ ! public static List placeOffset(List<Edge> which, Surface inner, Map<Edge, Double> offsetMap) { ! Map<Vertex, Vertex> v2v = new HashMap<Vertex, Vertex>(); ! Map<Edge, Edge> e2e = new LinkedHashMap<Edge, Edge>(); ! for (Edge e : which) { Vertex from = e.getFrom(); Vertex to = e.getTo(); *************** *** 813,817 **** } } ! return new LinkedList(e2e.values()); } --- 812,816 ---- } } ! return new LinkedList<Edge>(e2e.values()); } *************** *** 827,831 **** * @return The generated list of Edges */ ! public static List offset(List which, Surface inner, double offset) { return offset(which, inner, offset, null); } --- 826,830 ---- * @return The generated list of Edges */ ! public static List<Edge> offset(List<Edge> which, Surface inner, double offset) { return offset(which, inner, offset, null); } *************** *** 840,848 **** * @return The generated list of Edges */ ! public static List offset(List which, Surface inner, double offset, Map directions) { ! Map offsetMap = new HashMap(); ! Iterator it = which.iterator(); ! while (it.hasNext()) { ! offsetMap.put(it.next(), Double.valueOf(offset)); } return offset(which, inner, offsetMap, directions); --- 839,847 ---- * @return The generated list of Edges */ ! public static List <Edge> offset(List<Edge> which, Surface inner, ! double offset, Map<Vertex, Direction> directions) { ! Map<Edge, Double> offsetMap = new HashMap<Edge, Double>(); ! for (Edge e : which) { ! offsetMap.put(e, Double.valueOf(offset)); } return offset(which, inner, offsetMap, directions); *************** *** 858,870 **** * @return The generated list of Edges */ ! public static List offset(List which, Surface inner, Map offsetMap, Map directions) { ! HashSet edges = new HashSet(which); ! ArrayList res = new ArrayList(); if (directions == null) { ! directions = new HashMap(); } ! HashMap to2edge = new HashMap(); ! HashMap from2edge = new HashMap(); ! HashMap v2v = new HashMap(); Edge prevEdge = null; Edge firstEdge = null; --- 857,870 ---- * @return The generated list of Edges */ ! public static List<Edge> offset(List<Edge> which, Surface inner, ! Map<Edge, Double> offsetMap, Map<Vertex, Direction> directions) { ! HashSet<Edge> edges = new HashSet<Edge>(which); ! ArrayList<Edge> res = new ArrayList<Edge>(); if (directions == null) { ! directions = new HashMap<Vertex, Direction>(); } ! HashMap<Vertex, Edge> to2edge = new HashMap<Vertex, Edge>(); ! HashMap<Vertex, Edge> from2edge = new HashMap<Vertex, Edge>(); ! HashMap<Vertex, Vertex> v2v = new HashMap<Vertex, Vertex>(); Edge prevEdge = null; Edge firstEdge = null; |
From: rimestad <rim...@us...> - 2007-05-24 10:44:17
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12703/src/net/sourceforge/bprocessor/model Modified Files: Camera.java Log Message: fixed camara.focusOn to work better with nets Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** Camera.java 8 May 2007 12:32:00 -0000 1.42 --- Camera.java 24 May 2007 10:44:11 -0000 1.43 *************** *** 475,482 **** for (Geometric g : c) { if (g instanceof Space) { ! if (((Space)g).getLevel() == Space.PROJECT_LEVEL) { ! allVertices.addAll(Geometry.collect(((Space)g).getSurfaces())); } else { ! allVertices.addAll(Geometry.collect(((Space)g).getEnvelope())); } } else { --- 475,487 ---- for (Geometric g : c) { if (g instanceof Space) { ! Space s = (Space)g; ! if (s.getEnvelope().isEmpty()) { ! if (s.getVertices().isEmpty()) { ! g.collect(); ! } else { ! allVertices.addAll(s.getVertices()); ! } } else { ! allVertices.addAll(Geometry.collect(s.getEnvelope())); } } else { |
From: rimestad <rim...@us...> - 2007-05-24 10:41:11
|
Update of /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11191/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: potieltal null pointer Index: View.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.211 retrieving revision 1.212 diff -C2 -d -r1.211 -r1.212 *** View.java 20 May 2007 10:23:55 -0000 1.211 --- View.java 24 May 2007 10:41:04 -0000 1.212 *************** *** 3429,3433 **** }*/ } else { ! log.warn("There were a update event on a undecided entity " + entity.getClass()); } } --- 3429,3435 ---- }*/ } else { ! if (entity != null) { ! log.warn("There were a update event on a undecided entity " + entity.getClass()); ! } } } |
From: rimestad <rim...@us...> - 2007-05-20 10:29:25
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16533/src/net/sourceforge/bprocessor/model Modified Files: Edge.java Log Message: edge copy method for a bunch of edges Index: Edge.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Edge.java,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** Edge.java 7 May 2007 15:41:35 -0000 1.88 --- Edge.java 20 May 2007 10:29:23 -0000 1.89 *************** *** 1169,1171 **** --- 1169,1184 ---- return run; } + + /** + * Copy a collection of edges + * @param edges the edges to copy + * @return The copied edges + */ + public static List<Edge> copy(Collection<Edge> edges) { + List<Edge> res = new ArrayList<Edge>(edges.size()); + for (Edge e : edges) { + res.add(e.copy()); + } + return res; + } } |
From: rimestad <rim...@us...> - 2007-05-20 10:28:53
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16150/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: minor changes Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.144 retrieving revision 1.145 diff -C2 -d -r1.144 -r1.145 *** Space.java 18 May 2007 19:09:26 -0000 1.144 --- Space.java 20 May 2007 10:28:52 -0000 1.145 *************** *** 702,706 **** * @return The resulting list of edges */ ! public List<Edge> insert(List<Edge> edges) { List<Edge> tmp = new ArrayList<Edge>(edges.size()); for (Edge edge : edges) { --- 702,706 ---- * @return The resulting list of edges */ ! public List<Edge> insert(Collection<Edge> edges) { List<Edge> tmp = new ArrayList<Edge>(edges.size()); for (Edge edge : edges) { *************** *** 1675,1678 **** --- 1675,1684 ---- res = "Net" + res; break; + case PROJECT_LEVEL: + res = "Proj" + res; + break; + default: + res = "Spc(def)" + res; + break; } if (getClassification() != null) { *************** *** 2642,2645 **** --- 2648,2654 ---- */ public String getLevelString() { + if (isUnion()) { + return "Union"; + } if (getLevel() == Space.PROJECT_LEVEL) { return "Project"; *************** *** 2661,2665 **** /** ! * * @param vertices Collection of vertices * @return Map of edges going into the collection --- 2670,2676 ---- /** ! * Find for each vertex in the given collection, if possible, a edge in this space ! * that are only reachable from that vertex. e.i. a possible edge out of the collection ! * of vertices. Useable for creating a map of vertex to sliding edge * @param vertices Collection of vertices * @return Map of edges going into the collection |
From: rimestad <rim...@us...> - 2007-05-20 10:27:10
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv15614/src/net/sourceforge/bprocessor/model/modellor Modified Files: ModelBathModellor2.java Log Message: reached stage one for the bathmodellor Index: ModelBathModellor2.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/modellor/ModelBathModellor2.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ModelBathModellor2.java 15 May 2007 16:28:09 -0000 1.1 --- ModelBathModellor2.java 20 May 2007 10:27:07 -0000 1.2 *************** *** 13,16 **** --- 13,17 ---- import java.util.List; import java.util.Map; + import java.util.Set; import net.sourceforge.bprocessor.model.Attribute; *************** *** 18,22 **** import net.sourceforge.bprocessor.model.Edge; import net.sourceforge.bprocessor.model.Geometry; - import net.sourceforge.bprocessor.model.Geometric; import net.sourceforge.bprocessor.model.Net; import net.sourceforge.bprocessor.model.Project; --- 19,22 ---- *************** *** 38,44 **** private Space space; ! private Surface bottom; ! private Surface top; private double shaftOffset; --- 38,48 ---- private Space space; ! private Space floor; ! private Space walls; ! ! private Space ceiling; ! ! private Space bath; private double shaftOffset; *************** *** 56,64 **** private double ceilingThickness = 0.055; - private HashSet<Surface> vertical; - private CoordinateSystem coord; private Net net; /** * the constructor --- 60,73 ---- private double ceilingThickness = 0.055; private CoordinateSystem coord; private Net net; + + private double doorHeight = 2.2; + + private double windowOffset = 1.2; + + private double doorWindow = 0.5; + /** * the constructor *************** *** 121,125 **** /** {@inheritDoc} */ public void update(Object entity) { ! if (entity.equals(net) || entity.equals(this) || entity.equals(space)) { cleanUp(); space.add(net); --- 130,134 ---- /** {@inheritDoc} */ public void update(Object entity) { ! if (entity.equals(net) || entity.equals(this) || entity.equals(space) && isActive()) { cleanUp(); space.add(net); *************** *** 133,138 **** --- 142,270 ---- */ private void generateBath() { + floor = new Space("Floor", Space.CONSTRUCTION, Space.SPACE_LEVEL, true); + space.add(floor); + bath = new Space("Bath cabin", Space.FUNCTIONAL, Space.SPACE_LEVEL, true); + space.add(bath); + walls = new Space("Walls", Space.CONSTRUCTION, Space.SPACE_LEVEL, true); + space.add(walls); + ceiling = new Space("Ceiling", Space.CONSTRUCTION, Space.SPACE_LEVEL, true); + space.add(ceiling); makeFloor(); makeWalls(); + Geometry.simplifyGeometry(space.getSurfaces()); + makeCeiling(); + makeDoorAndWindows(); + } + + private void makeDoorAndWindows() { + for (Edge e : net.getEdges()) { + Object o = e.getParameters().environment().get("Type"); + Selector s = (Selector)o; + if (s != null) { + if (s.getCurrentValue().equals("Door")) { + // make a door + Space doorSpc = new Space("Door", Space.CONSTRUCTION, Space.SPACE_LEVEL, true); + space.add(doorSpc); + doorSpc.setTransparent(true); + List<Edge> door = new ArrayList<Edge>(4); + Edge bottom = e.copy(); + Edge top = e.copy(); + Edge side1 = new Edge(bottom.getFrom(), top.getFrom()); + Edge side2 = new Edge(top.getTo(), bottom.getTo()); + door.add(bottom); + door.add(side1); + door.add(top); + door.add(side2); + CoordinateSystem cs = coord.copy(); + cs.move(0, 0, floorThickness); + bottom.move(new Vertex(0, 0, floorThickness)); + top.move(new Vertex(0, 0, floorThickness + doorHeight)); + Surface sur = new Surface(door); + Vertex center = net.getSurfaces().iterator().next().center(); + Vertex in = center.minus(e.getFrom()); + in.normalize(); + Vertex dir = e.getDirection(); + dir.normalize(); + Vertex up = in.cross(dir); + up.normalize(); + in = dir.cross(up); + sur = space.insert(sur); + Geometry.holeAnalysis(sur); + Collection<Surface> sides = new LinkedList<Surface>(); + Surface t; + if (sur.normal().equalEps(in)) { + sur.setFrontDomain(doorSpc); + t = sur.extrusion(wallThickness, sides); + } else { + sur.setBackDomain(doorSpc); + t = sur.extrusion(-wallThickness, sides); + } + sides.add(t); + for (Surface surface : sides) { + space.insert(surface); + } + Geometry.holeAnalysis(t); + } else if (s.getCurrentValue().equals("Window")) { + //make a window + Space winSpc = new Space("Window", Space.CONSTRUCTION, Space.SPACE_LEVEL, true); + space.add(winSpc); + winSpc.setTransparent(true); + List<Edge> win = new ArrayList<Edge>(4); + Edge bottom = e.copy(); + Edge top = e.copy(); + Edge side1 = new Edge(bottom.getFrom(), top.getFrom()); + Edge side2 = new Edge(top.getTo(), bottom.getTo()); + win.add(bottom); + win.add(side1); + win.add(top); + win.add(side2); + bottom.move(new Vertex(0, 0, floorThickness + windowOffset)); + top.move(new Vertex(0, 0, floorThickness + windowOffset + doorWindow)); + Surface sur = new Surface(win); + Vertex center = net.getSurfaces().iterator().next().center(); + Vertex in = center.minus(e.getFrom()); + Vertex up = in.cross(e.getDirection()); + in = e.getDirection().cross(up); + sur = space.insert(sur); + Geometry.holeAnalysis(sur); + Collection<Surface> sides = new LinkedList<Surface>(); + Surface t; + if (sur.normal().equalEps(in)) { + sur.setFrontDomain(winSpc); + t = sur.extrusion(wallThickness, sides); + } else { + sur.setBackDomain(winSpc); + t = sur.extrusion(-wallThickness, sides); + } + sides.add(t); + for (Surface surface : sides) { + space.insert(surface); + } + Geometry.holeAnalysis(t); + } + } + } + } + + private void makeCeiling() { + //extrude the one space in ceiling + Surface top = null; + for (Surface s : ceiling.getEnvelope()) { + if (s.getExterior() == null) { + top = s; + } + } + if (top != null) { + Collection<Surface> sides = new ArrayList<Surface>(5); + if (top.getFrontDomain() == ceiling) { + sides.add(top.extrusion(ceilingThickness, sides)); + } else { + sides.add(top.extrusion(-ceilingThickness, sides)); + } + space.addAll(sides); + } else { + log.warn("Could not find the right surface for ceiling among " + + ceiling.getEnvelope().toString()); + } } *************** *** 141,145 **** */ private void makeWalls() { ! Collection<Geometric> border = Geometry.copy(net.getEdges()); } --- 273,375 ---- */ private void makeWalls() { ! // create the wall outline ! Surface s = net.getSurfaces().iterator().next(); ! List<Edge> offset = Edge.offset(s.getEdges(), s, -wallThickness); ! CoordinateSystem cs = coord.copy(); ! cs.move(0, 0, floorThickness); ! Geometry.unTranslateGeometry(offset, cs); ! Surface bathcabin = new Surface(offset); ! bathcabin = space.insert(bathcabin); ! bathcabin.setFrontDomain(floor); ! bathcabin.setBackDomain(bath); ! ! Vertex center = s.center(); ! Collection<Edge> remain = new ArrayList<Edge>(net.getEdges()); ! remain.removeAll(s.getEdges()); ! Collection<Surface> extra = new LinkedList<Surface>(); ! for (Edge e : remain) { ! //Copy net edge ! Edge copy = e.copy(); ! //Find sliding dir ! Set<Edge> connected = e.getFrom().getEdges(); ! if (connected.size() == 1) { ! connected = e.getTo().getEdges(); ! } ! connected.remove(e); ! Edge closest = connected.iterator().next(); ! double minangle = Double.MAX_VALUE; ! for (Edge eConnected : connected) { ! double angle = Geometry.angle(e, eConnected); ! if (angle < minangle) { ! closest = eConnected; ! minangle = angle; ! } ! } ! Vertex common = Edge.commonVertex(closest, e); ! Vertex direction = closest.otherVertex(common).minus(common); ! direction.normalize(); ! Vertex alongE = e.otherVertex(common).minus(common); ! alongE.normalize(); ! Vertex cross = direction.cross(alongE); ! Vertex orthoDir = alongE.cross(cross); ! Vertex deltaUnit = orthoDir.copy(); ! orthoDir.scale(wallThickness); ! double slideScale = 0; ! if (deltaUnit.getX() != 0) { ! double dot = direction.dot(deltaUnit); ! slideScale = orthoDir.getX() / (dot * deltaUnit.getX()); ! } else if (deltaUnit.getY() != 0) { ! slideScale = orthoDir.getY() / (direction.dot(deltaUnit) * deltaUnit.getY()); ! } else { ! slideScale = orthoDir.getZ() / (direction.dot(deltaUnit) * deltaUnit.getZ()); ! } ! direction.scale(slideScale); ! //Create other edge and connections ! Edge moved = copy.copy(); ! Edge con1 = new Edge(copy.getFrom(), moved.getFrom()); ! Edge con2 = new Edge(copy.getTo(), moved.getTo()); ! List<Edge> out = new ArrayList<Edge>(4); ! out.add(copy); ! out.add(con1); ! out.add(moved); ! out.add(con2); ! Surface sOut = new Surface(out); ! extra.add(sOut); ! if (common == e.getFrom()) { ! moved.getFrom().move(direction.getX(), direction.getY(), direction.getZ()); ! moved.getTo().move(orthoDir.getX(), orthoDir.getY(), orthoDir.getZ()); ! } else if (common == e.getTo()) { ! moved.getTo().move(direction.getX(), direction.getY(), direction.getZ()); ! moved.getFrom().move(orthoDir.getX(), orthoDir.getY(), orthoDir.getZ()); ! } else { ! log.error("E did not contain common"); ! } ! } ! Geometry.unTranslateGeometry(extra, cs); ! for (Surface sur : extra) { ! space.insert(sur); ! Geometry.assignSame(bathcabin, sur, bath, walls); ! } ! ! // exrrude the created walls ! Collection<Surface> wallsurs = new ArrayList<Surface>(walls.getEnvelope()); ! for (Surface sur : wallsurs) { ! Collection<Surface> sides = new LinkedList<Surface>(); ! Set<Surface> tops = new HashSet<Surface>(); ! double sign = 1.0; ! if (sur.normal().equalEps(new Vertex(0, 0, -1))) { ! sign = -1.0; ! } ! sur.extrusionall(sign * (height - floorThickness - ceilingThickness), sides, tops); ! if (tops.size() > 1) { ! for (Surface top : tops) { ! if (!top.setOppositeSpace(walls, ceiling)) { ! top.setOppositeSpace(bath, ceiling); ! } ! } ! } ! sides.addAll(tops); ! space.addAll(sides); ! } } *************** *** 149,154 **** private void makeFloor() { Surface s = net.getSurfaces().iterator().next(); - Space floor = new Space("Floor", Space.CONSTRUCTION, Space.SPACE_LEVEL, true); - space.add(floor); s = s.copy(space); if (s.normal().getZ() < 0) { --- 379,382 ---- *************** *** 158,161 **** --- 386,394 ---- Collection<Surface> geom = new LinkedList<Surface>(); Surface floorTop = s.extrusion(floorThickness, geom); + if (floorTop.getBackDomain() == floor) { + floorTop.setFrontDomain(walls); + } else { + floorTop.setBackDomain(walls); + } geom.add(floorTop); space.addAll(geom); *************** *** 223,226 **** --- 456,460 ---- /** {@inheritDoc} */ + @Override public void setAttributes(Map<String, Attribute> attributes) { Attribute a = attributes.get("Length"); |
From: rimestad <rim...@us...> - 2007-05-20 10:23:56
|
Update of /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14214/src/net/sourceforge/bprocessor/gl/view Modified Files: View.java Log Message: small check when finding plane coords Index: View.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/view/View.java,v retrieving revision 1.210 retrieving revision 1.211 diff -C2 -d -r1.210 -r1.211 *** View.java 10 May 2007 11:53:11 -0000 1.210 --- View.java 20 May 2007 10:23:55 -0000 1.211 *************** *** 3129,3132 **** --- 3129,3136 ---- /** {@inheritDoc} */ public Vertex toPlaneCoords(double x, double y, Plane plane) { + if (plane == null) { + log.error("Unable to find a coordinate without a plane (plane were null)"); + return null; + } y = View.getHeight() - y; Transformation transformation = transformation(); |
From: rimestad <rim...@us...> - 2007-05-20 10:21:29
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13384/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Log Message: some generics and a method added a method for setting the opposite space of a known one on a surface Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.160 retrieving revision 1.161 diff -C2 -d -r1.160 -r1.161 *** Surface.java 15 May 2007 12:26:35 -0000 1.160 --- Surface.java 20 May 2007 10:21:20 -0000 1.161 *************** *** 152,156 **** * @param edges The edges */ ! public Surface(List edges) { setEdges(edges); } --- 152,156 ---- * @param edges The edges */ ! public Surface(List<Edge> edges) { setEdges(edges); } *************** *** 221,225 **** * @param edges The edges */ ! public void setEdges(List edges) { this.edges = edges; } --- 221,225 ---- * @param edges The edges */ ! public void setEdges(List<Edge> edges) { this.edges = edges; } *************** *** 558,562 **** * @return Extruded top */ ! public Surface extrusionall(double delta, Collection sides, Set tops) { Surface top = extrusion(delta, sides); tops.add(top); --- 558,562 ---- * @return Extruded top */ ! public Surface extrusionall(double delta, Collection<Surface> sides, Set<Surface> tops) { Surface top = extrusion(delta, sides); tops.add(top); *************** *** 564,568 **** while (iter.hasNext()) { Surface hole = (Surface) iter.next(); ! Surface holetop = hole.extrusionall(delta, sides, tops); top.addHole(holetop); } --- 564,573 ---- while (iter.hasNext()) { Surface hole = (Surface) iter.next(); ! Surface holetop; ! if (hole.normal().equalEps(this.normal())) { ! holetop = hole.extrusionall(delta, sides, tops); ! } else { ! holetop = hole.extrusionall(-delta, sides, tops); ! } top.addHole(holetop); } *************** *** 2025,2027 **** --- 2030,2050 ---- return true; } + + /** + * Set the opposite domain of s1 to s2, if s1 is not present nothing will happen + * @param s1 The space that s2 will become nabour to + * @param s2 The space to assign to the oppisite site of the surface + * @return true when succes otherwise false + */ + public boolean setOppositeSpace(Space s1, Space s2) { + if (getFrontDomain() == s1 && getBackDomain() != s1) { + setBackDomain(s2); + } else if (getBackDomain() == s1 && getFrontDomain() != s1) { + setFrontDomain(s2); + } else { + log.warn("The space " + s1 + " werent assigned to " + this + " no assign were made"); + return false; + } + return true; + } } |
From: rimestad <rim...@us...> - 2007-05-20 10:19:57
|
Update of /cvsroot/bprocessor//facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12553/src/net/sourceforge/bprocessor/facade/modellor Modified Files: NetFacadeModellor.java Log Message: refactored angle from facade to Geometry Index: NetFacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor//facade/src/net/sourceforge/bprocessor/facade/modellor/NetFacadeModellor.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** NetFacadeModellor.java 18 May 2007 19:07:27 -0000 1.32 --- NetFacadeModellor.java 20 May 2007 10:19:36 -0000 1.33 *************** *** 805,809 **** private static Collection<Surface> makeExtrusion(Edge e1, Edge e2, List<Edge> cutEdges) { ! double angle = angle(e1, e2); Vertex shared = Edge.commonVertex(e1, e2); Vertex i = e2.otherVertex(shared).minus(shared); --- 805,809 ---- private static Collection<Surface> makeExtrusion(Edge e1, Edge e2, List<Edge> cutEdges) { ! double angle = Geometry.angle(e1, e2); Vertex shared = Edge.commonVertex(e1, e2); Vertex i = e2.otherVertex(shared).minus(shared); *************** *** 877,885 **** Iterator<Edge> it = contour.iterator(); Edge current = it.next(); ! double bottomAngle = angle(prev, current); double topAngle; while (it.hasNext()) { next = (Edge)it.next(); ! topAngle = angle(current, next); Vertex origin = Edge.commonVertex(current, prev); Vertex n = current.otherVertex(origin).minus(origin); --- 877,885 ---- Iterator<Edge> it = contour.iterator(); Edge current = it.next(); ! double bottomAngle = Geometry.angle(prev, current); double topAngle; while (it.hasNext()) { next = (Edge)it.next(); ! topAngle = Geometry.angle(current, next); Vertex origin = Edge.commonVertex(current, prev); Vertex n = current.otherVertex(origin).minus(origin); *************** *** 896,900 **** } next = contour.get(0); ! topAngle = angle(current, next); Vertex origin = Edge.commonVertex(current, prev); Vertex n = current.otherVertex(origin).minus(origin); --- 896,900 ---- } next = contour.get(0); ! topAngle = Geometry.angle(current, next); Vertex origin = Edge.commonVertex(current, prev); Vertex n = current.otherVertex(origin).minus(origin); *************** *** 1000,1014 **** } - private static double angle(Edge e1, Edge e2) { - double angle = Double.NaN; - Vertex common = Edge.commonVertex(e1, e2); - if (common != null) { - Vertex dir1 = e1.otherVertex(common).minus(common); - Vertex dir2 = e2.otherVertex(common).minus(common); - angle = dir1.angle(dir2); - } - return angle; - } - /** * Test if a surface is right hand turned around a vector --- 1000,1003 ---- |
From: rimestad <rim...@us...> - 2007-05-20 10:19:57
|
Update of /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12562/src/net/sourceforge/bprocessor/model Modified Files: Geometry.java Log Message: refactored angle from facade to Geometry Index: Geometry.java =================================================================== RCS file: /cvsroot/bprocessor//model/src/net/sourceforge/bprocessor/model/Geometry.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** Geometry.java 15 May 2007 16:28:09 -0000 1.56 --- Geometry.java 20 May 2007 10:19:41 -0000 1.57 *************** *** 866,870 **** /** * Replaces a list of edges with a new edge. The list of edges are assummed ! * to be a connected sequence of parrallel edges, that all longs to one * set of surfaces. The new edge will replace the sequence of edges in all of * the surfaces that the sequence belonged to. --- 866,870 ---- /** * Replaces a list of edges with a new edge. The list of edges are assummed ! * to be a connected sequence of parrallel edges, that all belongs to one * set of surfaces. The new edge will replace the sequence of edges in all of * the surfaces that the sequence belonged to. *************** *** 953,957 **** public static void assignSame(Surface s1, Surface s2, Space sp1, Space sp2) { if (s1.getFrontDomain() == sp1) { ! if (s1.normal().dot(s2.normal()) > 0) { s2.setFrontDomain(sp2); } else { --- 953,959 ---- public static void assignSame(Surface s1, Surface s2, Space sp1, Space sp2) { if (s1.getFrontDomain() == sp1) { ! Vertex n1 = s1.normal(); ! Vertex n2 = s2.normal(); ! if (n1.dot(n2) > 0) { s2.setFrontDomain(sp2); } else { *************** *** 959,968 **** } } else if (s1.getBackDomain() == sp1) { ! if (s1.normal().dot(s2.normal()) > 0) { s2.setBackDomain(sp2); } else { s2.setFrontDomain(sp2); } ! } } --- 961,974 ---- } } else if (s1.getBackDomain() == sp1) { ! Vertex n1 = s1.normal(); ! Vertex n2 = s2.normal(); ! if (n1.dot(n2) > 0) { s2.setBackDomain(sp2); } else { s2.setFrontDomain(sp2); } ! } else { ! log.warn(s1 + " werent assigned " + sp1 + " at all"); ! } } *************** *** 974,978 **** * @param system the coordinate system to untranslate according to */ ! public static void unTranslateGeometry(Set geometry, CoordinateSystem system) { List<Vertex> vertices = new LinkedList<Vertex>(collect(geometry)); List<Vertex> unTranslatedVertices = system.unTranslate(vertices); --- 980,984 ---- * @param system the coordinate system to untranslate according to */ ! public static void unTranslateGeometry(Collection geometry, CoordinateSystem system) { List<Vertex> vertices = new LinkedList<Vertex>(collect(geometry)); List<Vertex> unTranslatedVertices = system.unTranslate(vertices); *************** *** 989,998 **** /** ! * @param geometry the geometry to copy ! * @return A copy of the geometry */ ! public static Collection<Geometric> copy(Collection<? extends Geometric> geometry) { ! //TODO implement the method ! return null; ! } } --- 995,1013 ---- /** ! * Find the angle between two edges, where both edges are treated as if they pointed ! * away from each other ! * @param e1 the first edge ! * @param e2 the second edge ! * @return the angle between the edges in radian */ ! public static double angle(Edge e1, Edge e2) { ! double angle = Double.NaN; ! Vertex common = Edge.commonVertex(e1, e2); ! if (common != null) { ! Vertex dir1 = e1.otherVertex(common).minus(common); ! Vertex dir2 = e2.otherVertex(common).minus(common); ! angle = dir1.angle(dir2); ! } ! return angle; ! } } |
From: Nordholt <nor...@us...> - 2007-05-18 19:10:27
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5534/src/net/sourceforge/bprocessor/model/modellor Modified Files: InnerWallModellor.java Log Message: did some work on windows. Started to implement wooden sheets on the side of inner walls but ran out of time Index: InnerWallModellor.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/modellor/InnerWallModellor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** InnerWallModellor.java 9 May 2007 09:05:43 -0000 1.3 --- InnerWallModellor.java 18 May 2007 19:10:23 -0000 1.4 *************** *** 49,58 **** public static final double JOIST_DEPTH = 0.070; ! /** The classification id for a innerwall */ ! public static final String INNERWALL_CLASS = "-1.-205"; ! /** The classification id for a innerwall */ public static final String EXTERIOR = "-1.-80"; /** The space of this modellor */ private Space space; --- 49,64 ---- public static final double JOIST_DEPTH = 0.070; ! /** Thickness of the wood sheets */ ! public static final double SHEET_THICKNESS = 0.005; ! /** The classification id for a wall */ ! public static final String WALL = "-1.-205.01"; ! ! /** The classification id for exterior */ public static final String EXTERIOR = "-1.-80"; + /** The classification id for a window */ + public static final String WINDOW = "-1.-205.02"; + /** The space of this modellor */ private Space space; *************** *** 64,69 **** private double joistInterval = 0.5; ! /** Says whether or not the modellor should be build, ! * is false when there is no-need to rebuild the innerwall */ private boolean build = true; --- 70,79 ---- private double joistInterval = 0.5; ! /** ! * Says whether or not the modellor should be build, ! * is false when there is no-need to rebuild the innerwall. ! * While true the innerwall will be rebuild every time the ! * update method is called ! */ private boolean build = true; *************** *** 73,76 **** --- 83,87 ---- /** The net of the modellor */ private Net net; + /** * The empty constructor *************** *** 159,166 **** } if (net != null) { ! addSupport(); space.clear(); space.add(net); buildFramework(net); build = false; } --- 170,179 ---- } if (net != null) { ! addWallSupport(); ! addWindowSupport(); space.clear(); space.add(net); buildFramework(net); + buildWoodSheets(net); build = false; } *************** *** 168,173 **** } private void buildFramework(Net net) { ! Map<Edge, Edge> edge2Run = getRuns(net); Set<Edge> runs = new HashSet<Edge>(edge2Run.values()); Edge right = null; --- 181,190 ---- } + /** + * Builds the framework of the innerwall given a net + * @param net a net to build the framework from + */ private void buildFramework(Net net) { ! Map<Edge, Edge> edge2Run = getRuns(net.getEdges()); Set<Edge> runs = new HashSet<Edge>(edge2Run.values()); Edge right = null; *************** *** 201,204 **** --- 218,222 ---- space.add(base); Space joist = new Space("joist", Space.CONSTRUCTION, space.getLevel() + 1, true); + joist.setClassification(woodJoist()); space.add(joist); Vertex dir = e.getDirection(); *************** *** 236,247 **** base.extrude(length, sides); space.addAll(sides); } } ! private Map<Edge, Edge> getRuns(Net net) { Map<Edge, Edge> edge2Run = new HashMap<Edge, Edge>(); ! if (net != null) { ! Collection<Edge> netEdges = net.getEdges(); ! for (Edge e : netEdges) { if (edge2Run.get(e) == null) { List<Edge> run = e.parrallelRun(); --- 254,306 ---- base.extrude(length, sides); space.addAll(sides); + } + } + + private void buildWoodSheets(Net net) { + List<Edge> outline = netOutline(net); + if (!outline.isEmpty()) { + List<Edge> outlineCopy1 = new LinkedList<Edge>(); + List<Edge> outlineCopy2 = new LinkedList<Edge>(); + for (Edge outlineEdge : outline) { + outlineCopy1.add(outlineEdge); + outlineCopy2.add(outlineEdge); + } + Surface sheet1 = new Surface(outlineCopy1); + Surface sheet2 = new Surface(outlineCopy2); + Space sheetSpace1 = new Space("sheet1", Space.CONSTRUCTION, space.getLevel() + 1, true); + sheetSpace1.setClassification(woodSheet()); + Space sheetSpace2 = new Space("sheet2", Space.CONSTRUCTION, space.getLevel() + 1, true); + sheetSpace2.setClassification(woodSheet()); + Vertex j = cs.getJ().copy(); + j.normalize(); + j.scale(SHEET_THICKNESS + JOIST_DEPTH); + sheet2.move(j.getX(), j.getY(), j.getZ()); + double correction = 1; + space.insert(sheet1); + space.insert(sheet2); + if (j.dot(sheet1.normal()) < 0) { + correction = -1; + } + Set<Surface> surfaces = new HashSet<Surface>(); + surfaces.add(sheet1); + surfaces.add(sheet2); + Geometry.simplifyGeometry(surfaces); + sheet1.extrude(SHEET_THICKNESS * correction, surfaces); + sheet2.extrude(SHEET_THICKNESS * correction, surfaces); + } else { + log.info("Couldnt make sheets on the innerwall"); } } ! /** ! * Maps each edge in a set to an edge representing the run of that edge. ! * A run being the an amount of parrallel cennected edges. ! * @param edges a collection of edges ! * @return the described map ! */ ! private Map<Edge, Edge> getRuns(Collection<Edge> edges) { Map<Edge, Edge> edge2Run = new HashMap<Edge, Edge>(); ! if (edges != null) { ! for (Edge e : edges) { if (edge2Run.get(e) == null) { List<Edge> run = e.parrallelRun(); *************** *** 269,276 **** private static Surface joistBase() { List<Vertex> vl = new LinkedList<Vertex>(); ! Vertex first = new Vertex(0, 0, 0); ! vl.add(new Vertex(JOIST_WIDTH, 0, 0)); ! vl.add(new Vertex(JOIST_WIDTH, JOIST_DEPTH, 0)); ! vl.add(new Vertex(0, JOIST_DEPTH, 0)); List<Edge> el = new LinkedList<Edge>(); Vertex prevV = first; --- 328,335 ---- private static Surface joistBase() { List<Vertex> vl = new LinkedList<Vertex>(); ! Vertex first = new Vertex(0, SHEET_THICKNESS, 0); ! vl.add(new Vertex(JOIST_WIDTH, SHEET_THICKNESS, 0)); ! vl.add(new Vertex(JOIST_WIDTH, JOIST_DEPTH + SHEET_THICKNESS, 0)); ! vl.add(new Vertex(0, JOIST_DEPTH + SHEET_THICKNESS, 0)); List<Edge> el = new LinkedList<Edge>(); Vertex prevV = first; *************** *** 284,287 **** --- 343,351 ---- } + /** + * Builds a net from a single surface + * (Should be able to handle a set of surfaces) + * @return a net for building the framework + */ private Net buildNet() { if (space != null && !space.getEnvelope().isEmpty()) { *************** *** 304,325 **** } if (horizontal != null && vertical != null) { ! Vertex origin = horizontal.getFrom(); ! Vertex topToBottom = vertical.otherVertex(origin).minus(origin); ! Vertex interval = horizontal.getDirection(); ! interval.scale(joistInterval / interval.length()); ! Vertex current = origin.copy(); ! current.move(interval.getX(), interval.getY(), interval.getZ()); ! while (origin.minus(current).length() < horizontal.getLength() - joistInterval) { ! Vertex from = current.copy(); ! Vertex to = from.add(topToBottom); ! net.insert(from); ! net.insert(to); ! net.insert(new Edge(from, to)); ! current.move(interval.getX(), interval.getY(), interval.getZ()); ! } Vertex i; Vertex j; Vertex n; ! n = new Vertex(0, 0, 1); j = surface.normal(); if (surface.getBackDomain() == space) { --- 368,376 ---- } if (horizontal != null && vertical != null) { ! Vertex origin = vertical.getFrom(); Vertex i; Vertex j; Vertex n; ! n = vertical.getDirection(); j = surface.normal(); if (surface.getBackDomain() == space) { *************** *** 331,334 **** --- 382,399 ---- n.normalize(); cs = new CoordinateSystem(i, j, n, origin); + Project.getInstance().world().add(cs); + Vertex topToBottom = vertical.otherVertex(origin).minus(origin); + Vertex interval = horizontal.getDirection(); + interval.scale(joistInterval / interval.length()); + Vertex current = origin.copy(); + current.move(interval.getX(), interval.getY(), interval.getZ()); + while (origin.minus(current).length() < horizontal.getLength() - JOIST_WIDTH) { + Vertex from = current.copy(); + Vertex to = from.add(topToBottom); + net.insert(from); + net.insert(to); + net.insert(new Edge(from, to)); + current.move(interval.getX(), interval.getY(), interval.getZ()); + } } else { log.error("The surface found did not meet the requirements"); *************** *** 344,348 **** * innerwalls. */ ! private void addSupport() { if (net != null) { log.info("net not null"); --- 409,414 ---- * innerwalls. */ ! private Set<Edge> addWallSupport() { ! Set<Edge> supports = new HashSet<Edge>(); if (net != null) { log.info("net not null"); *************** *** 355,360 **** Classification backClass = back.getClassification(); if ((frontClass != null && backClass != null) && ! ((frontClass.getFullId(front).equalsIgnoreCase(INNERWALL_CLASS) && front != space) || ! (backClass.getFullId(back).equalsIgnoreCase(INNERWALL_CLASS) && back != space))) { log.info("found suiteable surface"); Edge left = null; --- 421,426 ---- Classification backClass = back.getClassification(); if ((frontClass != null && backClass != null) && ! ((frontClass.getFullId(front).equalsIgnoreCase(WALL) && front != space) || ! (backClass.getFullId(back).equalsIgnoreCase(WALL) && back != space))) { log.info("found suiteable surface"); Edge left = null; *************** *** 383,395 **** from = cs.unTranslate(from); Edge support1 = new Edge(to, from); ! net.insert(support1); Edge support2 = support1.copy(); Vertex move = cs.getI().copy(JOIST_WIDTH / cs.getI().length()); support2.move(move); ! net.insert(support2); ! } } } } } --- 449,561 ---- from = cs.unTranslate(from); Edge support1 = new Edge(to, from); ! supports.add(support1); Edge support2 = support1.copy(); Vertex move = cs.getI().copy(JOIST_WIDTH / cs.getI().length()); support2.move(move); ! supports.add(support2); ! } ! } ! } ! Collection<Edge> delete = new LinkedList<Edge>(); ! for (Edge netEdge : net.getEdges()) { ! double netX = cs.translate(netEdge.getFrom()).getX(); ! if (vertical(netEdge)) { ! for (Edge supportEdge : supports) { ! double supportX = cs.translate(supportEdge.getFrom()).getX(); ! if ((netX > supportX - JOIST_WIDTH) && ! (netX < supportX + JOIST_WIDTH)) { ! delete.add(netEdge); ! break; ! } ! } } } + for (Edge e : delete) { + e.delete(); + } + List<Edge> supportsList = new LinkedList<Edge>(supports); + supports = new HashSet<Edge>(net.insert(supportsList)); + } + return supports; + } + + private Set<Edge> addWindowSupport() { + Set<Edge> supports = new HashSet<Edge>(); + if (net != null) { + Set<Surface> envelope = space.getEnvelope(); + Set<Edge> delete = new HashSet<Edge>(); + for (Surface s : envelope) { + for (Surface h : s.getHoles()) { + Space front = h.getFrontDomain(); + Space back = h.getBackDomain(); + Classification frontClass = front.getClassification(); + Classification backClass = back.getClassification(); + if ((frontClass != null && backClass != null) && + ((frontClass.getFullId(front).equalsIgnoreCase(WINDOW) && front != space) || + (backClass.getFullId(back).equalsIgnoreCase(WINDOW) && back != space))) { + Edge left = null; + Edge right = null; + double min = Double.POSITIVE_INFINITY; + double max = Double.NEGATIVE_INFINITY; + for (Edge e : h.getEdges()) { + if (vertical(e)) { + Vertex from = cs.translate(e.getFrom()); + double x = from.getX(); + if (min > x) { + min = x; + left = e; + } + if (max < x) { + max = x; + right = e; + } + } + } + Vertex leftTo = cs.translate(left.getTo()); + Vertex leftFrom = cs.translate(left.getFrom()); + leftFrom.setY(0); + leftFrom.setZ(0); + leftTo.setY(0); + leftTo.setZ(getHeight()); + leftTo.move(-JOIST_WIDTH, 0, 0); + leftFrom.move(-JOIST_WIDTH, 0, 0); + + Vertex rightTo = cs.translate(right.getTo()); + Vertex rightFrom = cs.translate(right.getFrom()); + rightFrom.setY(0); + rightFrom.setZ(0); + rightTo.setY(0); + rightTo.setZ(getHeight()); + + + for (Edge e : net.getEdges()) { + Vertex from = cs.translate(e.getFrom()); + if (vertical(e) && + from.getX() > (leftFrom.getX() - JOIST_WIDTH) && + from.getX() < (rightFrom.getX() + JOIST_WIDTH)) { + delete.add(e); + } + } + + leftFrom = cs.unTranslate(leftFrom); + leftTo = cs.unTranslate(leftTo); + Edge leftEdge = new Edge(leftFrom, leftTo); + supports.add(leftEdge); + + + rightFrom = cs.unTranslate(rightFrom); + rightTo = cs.unTranslate(rightTo); + Edge rightEdge = new Edge(rightFrom, rightTo); + supports.add(rightEdge); + } + } + } + for (Edge e : delete) { + e.delete(); + } + List<Edge> supportsList = new LinkedList<Edge>(supports); + supports = new HashSet<Edge>(net.insert(supportsList)); } + return supports; } *************** *** 485,488 **** --- 651,671 ---- } + /** + * gets the height of the innerwall element + * @return a height + */ + private double getHeight() { + double height = 0; + if (net != null) { + Set<Edge> runs = new HashSet<Edge>(getRuns(net.getEdges()).values()); + for (Edge run : runs) { + if (vertical(run) && height < run.getLength()) { + height = run.getLength(); + } + } + } + return height; + } + private boolean horizontal(Edge e) { Vertex to = e.getTo(); *************** *** 497,500 **** --- 680,747 ---- Math.abs(to.getY() - from.getY()) < Geometry.EPS); } + + /** + * Finds the outline of a net, if it makes sence. + * The outline must be a sequence of connected outer edges, so that + * the last edge is connected to the first. Also all outer edges most be + * in the outline. + * @param net a net + * @return a list of connected edges making up the net outline + */ + private List<Edge> netOutline(Net net) { + /*Find outer edges*/ + Set<Edge> outer = new HashSet<Edge>(); + for (Edge current : net.getEdges()) { + if (current.getSurfaces().size() < 2) { + outer.add(current); + } + } + /*If there are outer edges sort them in order*/ + if (!outer.isEmpty()) { + LinkedList<Edge> outline = new LinkedList<Edge>(); + Edge first = (Edge)outer.iterator().next(); + outline.add(first); + outer.remove(first); + Vertex nextVertex = first.getTo(); + boolean doneAll = false; + while (!doneAll) { + Edge next = null; + for (Edge e : nextVertex.getEdges()) { + if (outer.contains(e)) { + next = (Edge)e; + break; + } + } + if (next != null) { + outer.remove(next); + nextVertex = next.otherVertex(nextVertex); + outline.add(next); + } else { + doneAll = true; + } + } + if (outer.isEmpty() && + first.getFrom().getEdges().contains(outline.getLast())) { + return outline; + } else { + log.warn("Outline not well defined, " + + " outer edges left: " + outer.size() + + " outline connected: " + first.getFrom().getEdges().contains(outline.getLast())); + } + } + return new LinkedList<Edge>(); + } + + private static Classification woodJoist() { + Classification c = Project.getInstance().getClassification("-1.-205.01.01", 0); + Classification type = Project.getInstance().getProductType("-1.-205.01.A01"); + c.setTypeClassification(type); + return c; + } + + private static Classification woodSheet() { + Classification c = Project.getInstance().getClassification("-1.-205.01.03", 0); + return c; + } /** |
From: Nordholt <nor...@us...> - 2007-05-18 19:09:33
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5089/src/net/sourceforge/bprocessor/model Modified Files: Space.java Log Message: corrected spelling Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.143 retrieving revision 1.144 diff -C2 -d -r1.143 -r1.144 *** Space.java 15 May 2007 12:26:35 -0000 1.143 --- Space.java 18 May 2007 19:09:26 -0000 1.144 *************** *** 700,704 **** * in the space * @param edges List of edges ! * @return The resulting collection of edges */ public List<Edge> insert(List<Edge> edges) { --- 700,704 ---- * in the space * @param edges List of edges ! * @return The resulting list of edges */ public List<Edge> insert(List<Edge> edges) { *************** *** 1585,1589 **** } } ! if (getClassification() != null && !getClassification().getProdukt().equalsIgnoreCase("")) { res.add(new Attribute("Type", Project.getInstance(). getType(getClassification().getName()), getTypeClassification(), this)); --- 1585,1589 ---- } } ! if (getClassification() != null && !getClassification().getProduct().equalsIgnoreCase("")) { res.add(new Attribute("Type", Project.getInstance(). getType(getClassification().getName()), getTypeClassification(), this)); |
From: Nordholt <nor...@us...> - 2007-05-18 19:08:37
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4701/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: corrected spelling Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.124 retrieving revision 1.125 diff -C2 -d -r1.124 -r1.125 *** Project.java 15 May 2007 16:28:09 -0000 1.124 --- Project.java 18 May 2007 19:08:37 -0000 1.125 *************** *** 1039,1043 **** * @return temp the produkt type * */ ! public Classification getProduktType(String id) { Classification temp = getClassification(id, 0); Classification pt = Project.getInstance().getType(temp.getName()); --- 1039,1043 ---- * @return temp the produkt type * */ ! public Classification getProductType(String id) { Classification temp = getClassification(id, 0); Classification pt = Project.getInstance().getType(temp.getName()); *************** *** 1066,1070 **** StringTokenizer s = new StringTokenizer(last, "."); while (s.hasMoreTokens()) { - String curid = s.nextToken(); Iterator it = pt.getChildren().iterator(); --- 1066,1069 ---- *************** *** 1075,1080 **** } } ! } ! return pt; } --- 1074,1078 ---- } } ! } return pt; } *************** *** 1147,1151 **** * GetType returns the type of this classification * @param name the name of the classification ! * @return temp the type */ public Classification getType(String name) { --- 1145,1149 ---- * GetType returns the type of this classification * @param name the name of the classification ! * @return the type */ public Classification getType(String name) { |
From: Nordholt <nor...@us...> - 2007-05-18 19:08:18
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4686/src/net/sourceforge/bprocessor/model Modified Files: Persistence.java Log Message: corrected spelling Index: Persistence.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Persistence.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** Persistence.java 17 Apr 2007 13:04:43 -0000 1.37 --- Persistence.java 18 May 2007 19:08:17 -0000 1.38 *************** *** 233,237 **** getClassification(xml.getClassification(), 0)); space.setTypeClassification(Project.getInstance(). ! getProduktType(xml.getClassification())); } else { Classification newclas = new Classification("-1", xml.getClassification(), --- 233,237 ---- getClassification(xml.getClassification(), 0)); space.setTypeClassification(Project.getInstance(). ! getProductType(xml.getClassification())); } else { Classification newclas = new Classification("-1", xml.getClassification(), |
From: Nordholt <nor...@us...> - 2007-05-18 19:07:56
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4293/src/net/sourceforge/bprocessor/model Modified Files: Classification.java Log Message: corrected spelling Index: Classification.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Classification.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Classification.java 15 May 2007 11:34:47 -0000 1.15 --- Classification.java 18 May 2007 19:07:56 -0000 1.16 *************** *** 34,38 **** /** The type of this classification */ ! private String produkt; /** The uvalue the classification */ --- 34,38 ---- /** The type of this classification */ ! private String product; /** The uvalue the classification */ *************** *** 231,236 **** * @return produkt the produkt types */ ! public String getProdukt() { ! return produkt; } --- 231,236 ---- * @return produkt the produkt types */ ! public String getProduct() { ! return product; } *************** *** 240,244 **** */ public void setProdukt(String produkt) { ! this.produkt = produkt; } --- 240,244 ---- */ public void setProdukt(String produkt) { ! this.product = produkt; } *************** *** 253,259 **** res.add(new Attribute("U-value", getUvalue(), true)); res.add(new Attribute("Density", getDensity(), true)); ! if (!getProdukt().equalsIgnoreCase("")) { ! res.add(new Attribute("Type", Project.getInstance(). ! getType(getName()))); } return res; --- 253,258 ---- res.add(new Attribute("U-value", getUvalue(), true)); res.add(new Attribute("Density", getDensity(), true)); ! if (productType != null) { ! res.add(new Attribute("Type", productType)); } return res; *************** *** 332,337 **** public void setTypeClassification(Classification productType) { this.productType = productType; ! } ! ! } --- 331,334 ---- public void setTypeClassification(Classification productType) { this.productType = productType; ! } } |
From: Nordholt <nor...@us...> - 2007-05-18 19:07:37
|
Update of /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4220/src/net/sourceforge/bprocessor/facade/modellor Modified Files: NetFacadeModellor.java Log Message: removed some code that did writeouts Index: NetFacadeModellor.java =================================================================== RCS file: /cvsroot/bprocessor/facade/src/net/sourceforge/bprocessor/facade/modellor/NetFacadeModellor.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** NetFacadeModellor.java 17 May 2007 08:51:41 -0000 1.31 --- NetFacadeModellor.java 18 May 2007 19:07:27 -0000 1.32 *************** *** 55,58 **** --- 55,64 ---- public static final String EXTERIOR = "-1.-80"; + /** The classification id for window frames */ + public static final String FRAME = "-1.-205.02.01.01"; + + /** The classification id for window glass */ + public static final String GLASS = "-1.-205.02.01.02"; + /** serial id */ private static final long serialVersionUID = 1L; *************** *** 82,88 **** private static Logger log = Logger.getLogger(NetFacadeModellor.class); - /** Times a facade has been generated */ - private int facades = 0; - /** * Empty constructor for the net facade --- 88,91 ---- *************** *** 130,133 **** --- 133,143 ---- Project.getInstance().scheduleObserver(mod); s.setModellor(mod); + frame = new Space("Frame", + Space.CONSTRUCTION, + Space.ELEMENT_LEVEL, + true); + Classification frameClass = Project.getInstance().getClassification(FRAME, 0); + frame.setClassification(frameClass); + mod.frame = frame; mod.setFront(findFront(s)); mod.setNet(mod.createNet(mod.getFront())); *************** *** 206,211 **** l.add(new Attribute("Net", net, true)); l.add(new Attribute("Front", front, true)); ! l.add(new Attribute("Framewidth", new Double(frameWidth), true)); ! l.add(new Attribute("Depth", new Double(depth), true)); l.add(new Attribute("Single", Boolean.valueOf(single), true)); } --- 216,223 ---- l.add(new Attribute("Net", net, true)); l.add(new Attribute("Front", front, true)); ! if (single) { ! l.add(new Attribute("Framewidth", new Double(frameWidth), true)); ! l.add(new Attribute("Depth", new Double(depth), true)); ! } l.add(new Attribute("Single", Boolean.valueOf(single), true)); } *************** *** 311,315 **** } } ! /** * Regenerate the entire facade, deleting what ever was there before. --- 323,327 ---- } } ! /** * Regenerate the entire facade, deleting what ever was there before. *************** *** 318,342 **** if (frame != null) { frame.clear(); ! frame = null; ! } ! double time = System.nanoTime(); ! space.clear(); ! space.add(getNet()); ! prepareNet(getNet()); ! if (single) { ! log.info("calling create1"); ! createSingleFacade(getNet()); ! } else { ! log.info("calling create2"); ! createDoubleFacade(getNet()); ! } ! time = (System.nanoTime() - time) / 1000000; ! facades++; ! int fields = 0; ! if (net != null) { ! fields = net.getSurfaces().size(); } - log.info("Facade no.: " + facades + " with: " + fields + " fields " + - " were generated in: " + time); } --- 330,343 ---- if (frame != null) { frame.clear(); ! space.clear(); ! space.add(getNet()); ! space.add(frame); ! prepareNet(getNet()); ! if (single) { ! createSingleFacade(getNet()); ! } else { ! createDoubleFacade(getNet()); ! } } } *************** *** 382,391 **** if (frame == null) { frame = new Space("Frame", ! Space.CONSTRUCTION, ! Space.ELEMENT_LEVEL, ! true); space.add(frame); } - log.info("create"); if (net != null) { for (Surface field : net.getSurfaces()) { --- 383,393 ---- if (frame == null) { frame = new Space("Frame", ! Space.CONSTRUCTION, ! Space.ELEMENT_LEVEL, ! true); ! Classification frameClass = Project.getInstance().getClassification(FRAME, 0); ! frame.setClassification(frameClass); space.add(frame); } if (net != null) { for (Surface field : net.getSurfaces()) { *************** *** 414,418 **** out.scale(-1); } - log.info("create"); Set<Surface> frame1 = generateFrame(cut1, field.getEdges(), out); Set<Surface> frame2 = generateFrame(cut2, field.getEdges(), out); --- 416,419 ---- *************** *** 453,467 **** /* Put holes into the shell */ for (Surface field : net.getSurfaces()) { ! Map offsetMap = new HashMap(); ! Iterator fieldEdges = field.getEdges().iterator(); Map envF = field.getParameters().environment(); ! while (fieldEdges.hasNext()) { ! Edge e = (Edge)fieldEdges.next(); Map envE = e.getParameters().environment(); double width = ((Double)envE.get("width")).doubleValue(); if (outline.contains(e)) { ! offsetMap.put(e, Double.valueOf(-(width))); } else { ! offsetMap.put(e, Double.valueOf(-((width / 2)))); } } --- 454,466 ---- /* Put holes into the shell */ for (Surface field : net.getSurfaces()) { ! Map<Edge, Double> offsetMap = new HashMap<Edge, Double>(); Map envF = field.getParameters().environment(); ! for (Edge e : field.getEdges()) { Map envE = e.getParameters().environment(); double width = ((Double)envE.get("width")).doubleValue(); if (outline.contains(e)) { ! offsetMap.put(e, -width); } else { ! offsetMap.put(e, -(width / 2)); } } *************** *** 519,526 **** --- 518,529 ---- Space.ELEMENT_LEVEL, true); + Classification frameClass = Project.getInstance().getClassification(FRAME, 0); + f.setClassification(frameClass); Space g = new Space("Glass", Space.CONSTRUCTION, Space.ELEMENT_LEVEL, true); + Classification glassClass = Project.getInstance().getClassification(GLASS, 0); + g.setClassification(glassClass); g.setTransparent(true); space.add(g); *************** *** 643,647 **** * @return the top surface of the extrusion */ ! private Surface extrudeIntoSpace(Surface s, double delta, Set sides) { int deltaCorrection = 1; if (s.normal().dot(front.normal()) < 0) { --- 646,650 ---- * @return the top surface of the extrusion */ ! private Surface extrudeIntoSpace(Surface s, double delta, Set<Surface> sides) { int deltaCorrection = 1; if (s.normal().dot(front.normal()) < 0) { *************** *** 651,661 **** deltaCorrection *= -1; } ! Set tops = new HashSet(); Surface top = s.extrusionall(delta * deltaCorrection, sides, tops); tops.addAll(sides); ! for (Object o1 : tops) { ! Surface surface = (Surface)o1; ! for (Object o2 : surface.getEdges()) { ! Edge edge = (Edge)o2; space.add(edge.getTo()); space.add(edge.getFrom()); --- 654,662 ---- deltaCorrection *= -1; } ! Set<Surface> tops = new HashSet<Surface>(); Surface top = s.extrusionall(delta * deltaCorrection, sides, tops); tops.addAll(sides); ! for (Surface surface : tops) { ! for (Edge edge : surface.getEdges()) { space.add(edge.getTo()); space.add(edge.getFrom()); *************** *** 869,880 **** contour = test.getEdges(); } ! Set<Surface> surfaces = new HashSet<Surface>(); ! HashSet surfs = new HashSet(); if (contour.size() > 2) { Vertex j = out; - Iterator it = contour.iterator(); Edge prev = contour.get(contour.size() - 1); - Edge current = (Edge)it.next(); Edge next; double bottomAngle = angle(prev, current); double topAngle; --- 870,880 ---- contour = test.getEdges(); } ! HashSet<Surface> surfaces = new HashSet<Surface>(); if (contour.size() > 2) { Vertex j = out; Edge prev = contour.get(contour.size() - 1); Edge next; + Iterator<Edge> it = contour.iterator(); + Edge current = it.next(); double bottomAngle = angle(prev, current); double topAngle; *************** *** 888,894 **** i.normalize(); CoordinateSystem cs = new CoordinateSystem(i, j, n, origin); ! Set post = genFramePost(cut, current.getLength(), bottomAngle, topAngle); Geometry.unTranslateGeometry(post, cs); ! surfs.addAll(post); prev = current; current = next; --- 888,894 ---- i.normalize(); CoordinateSystem cs = new CoordinateSystem(i, j, n, origin); ! Set<Surface> post = genFramePost(cut, current.getLength(), bottomAngle, topAngle); Geometry.unTranslateGeometry(post, cs); ! surfaces.addAll(post); prev = current; current = next; *************** *** 903,914 **** i.normalize(); CoordinateSystem cs = new CoordinateSystem(i, j, n, origin); ! Set post = genFramePost(cut, current.getLength(), bottomAngle, topAngle); Geometry.unTranslateGeometry(post, cs); ! surfs.addAll(post); ! Iterator surfIt = surfs.iterator(); ! while (surfIt.hasNext()) { ! Surface s = (Surface)surfIt.next(); ! surfaces.add(s); ! } } return surfaces; --- 903,909 ---- i.normalize(); CoordinateSystem cs = new CoordinateSystem(i, j, n, origin); ! Set<Surface> post = genFramePost(cut, current.getLength(), bottomAngle, topAngle); Geometry.unTranslateGeometry(post, cs); ! surfaces.addAll(post); } return surfaces; *************** *** 918,927 **** private static Surface cutType1() { List<Vertex> vl = new LinkedList<Vertex>(); ! Vertex first = new Vertex(0, 0, 0); ! vl.add(new Vertex(0.050, 0, 0)); ! vl.add(new Vertex(0.050, 0.016, 0)); ! vl.add(new Vertex(0.008, 0.016, 0)); ! vl.add(new Vertex(0.008, 0.125, 0)); ! vl.add(new Vertex(0.000, 0.125, 0)); List<Edge> el = new LinkedList<Edge>(); Vertex prevV = first; --- 913,922 ---- private static Surface cutType1() { List<Vertex> vl = new LinkedList<Vertex>(); ! Vertex first = new Vertex(0, 0 + 0.035, 0); ! vl.add(new Vertex(0.050, 0 + 0.035, 0)); ! vl.add(new Vertex(0.050, 0.016 + 0.035, 0)); ! vl.add(new Vertex(0.008, 0.016 + 0.035, 0)); ! vl.add(new Vertex(0.008, 0.125 + 0.035, 0)); ! vl.add(new Vertex(0.000, 0.125 + 0.035, 0)); List<Edge> el = new LinkedList<Edge>(); Vertex prevV = first; *************** *** 939,944 **** Vertex first = new Vertex(0.004, 0, 0); vl.add(new Vertex(0.050, 0, 0)); ! vl.add(new Vertex(0.050, -0.035, 0)); ! vl.add(new Vertex(0.004, -0.035, 0)); List<Edge> el = new LinkedList<Edge>(); Vertex prevV = first; --- 934,939 ---- Vertex first = new Vertex(0.004, 0, 0); vl.add(new Vertex(0.050, 0, 0)); ! vl.add(new Vertex(0.050, 0.035, 0)); ! vl.add(new Vertex(0.004, 0.035, 0)); List<Edge> el = new LinkedList<Edge>(); Vertex prevV = first; *************** *** 954,963 **** private static Surface cutType3() { List<Vertex> vl = new LinkedList<Vertex>(); ! Vertex first = new Vertex(0, 0, 0); ! vl.add(new Vertex(0.050, 0, 0)); ! vl.add(new Vertex(0.050, 0.125, 0)); ! vl.add(new Vertex(0.004, 0.125, 0)); ! vl.add(new Vertex(0.004, 0.121, 0)); ! vl.add(new Vertex(0.000, 0.121, 0)); List<Edge> el = new LinkedList<Edge>(); Vertex prevV = first; --- 949,958 ---- private static Surface cutType3() { List<Vertex> vl = new LinkedList<Vertex>(); ! Vertex first = new Vertex(0, 0 + 0.035, 0); ! vl.add(new Vertex(0.050, 0 + 0.035, 0)); ! vl.add(new Vertex(0.050, 0.125 + 0.035, 0)); ! vl.add(new Vertex(0.004, 0.125 + 0.035, 0)); ! vl.add(new Vertex(0.004, 0.121 + 0.035, 0)); ! vl.add(new Vertex(0.000, 0.121 + 0.035, 0)); List<Edge> el = new LinkedList<Edge>(); Vertex prevV = first; *************** *** 977,981 **** * @return the surfaces of the new post */ ! private static Set genFramePost(Surface cut, double length, double bottomAngle, double topAngle) { Surface copy = cut.copy(new HashMap()); copy.setBackDomain(cut.getBackDomain()); --- 972,977 ---- * @return the surfaces of the new post */ ! private static Set<Surface> genFramePost(Surface cut, double length, ! double bottomAngle, double topAngle) { Surface copy = cut.copy(new HashMap()); copy.setBackDomain(cut.getBackDomain()); *************** *** 987,998 **** Math.sin(-bottomAngle / 2), new Vertex(0 , 0, -length / 2)); ! Set surfaces = new HashSet(); ! Set tops = new HashSet(); surfaces.add(copy); copy.extrusionAllOnto(topPlane, surfaces, tops); copy.extrusionAllOnto(bottomPlane, surfaces, tops); ! Iterator it = tops.iterator(); ! while (it.hasNext()) { ! Surface top = (Surface)it.next(); top.setFrontDomain(cut.getFrontDomain()); top.setBackDomain(cut.getBackDomain()); --- 983,992 ---- Math.sin(-bottomAngle / 2), new Vertex(0 , 0, -length / 2)); ! Set<Surface> surfaces = new HashSet<Surface>(); ! Set<Surface> tops = new HashSet<Surface>(); surfaces.add(copy); copy.extrusionAllOnto(topPlane, surfaces, tops); copy.extrusionAllOnto(bottomPlane, surfaces, tops); ! for (Surface top : tops) { top.setFrontDomain(cut.getFrontDomain()); top.setBackDomain(cut.getBackDomain()); |