From: <adr...@us...> - 2011-05-11 21:10:46
|
Revision: 4130 http://reprap.svn.sourceforge.net/reprap/?rev=4130&view=rev Author: adrian-bowyer Date: 2011-05-11 21:10:40 +0000 (Wed, 11 May 2011) Log Message: ----------- Decided to plot outlines first, rather than either infill or outlines, whichever is nearest. Also, it now does outlines from the inside outwards. Modified Paths: -------------- trunk/software/host/src/org/reprap/geometry/Producer.java trunk/software/host/src/org/reprap/geometry/polygons/BooleanGridList.java Modified: trunk/software/host/src/org/reprap/geometry/Producer.java =================================================================== --- trunk/software/host/src/org/reprap/geometry/Producer.java 2011-05-11 17:56:30 UTC (rev 4129) +++ trunk/software/host/src/org/reprap/geometry/Producer.java 2011-05-11 21:10:40 UTC (rev 4130) @@ -265,7 +265,8 @@ } RrPolygonList allPolygons[] = new RrPolygonList[totalPhysicalExtruders]; - RrPolygonList tempPolygons[] = new RrPolygonList[totalPhysicalExtruders]; + RrPolygonList tempBorderPolygons[] = new RrPolygonList[totalPhysicalExtruders]; + RrPolygonList tempFillPolygons[] = new RrPolygonList[totalPhysicalExtruders]; boolean firstTimeRound = true; @@ -301,62 +302,56 @@ fills = fills.cullShorts(); shield = false; RrPolygonList support = allSTLs.computeSupport(stl, layerRules); - /* - borders = borders.nearEnds(startNearHere, false, -1); - if(borders.size() > 0) + for(int physicalExtruder = 0; physicalExtruder < allPolygons.length; physicalExtruder++) { - RrPolygon last = borders.polygon(borders.size() - 1); - startNearHere = last.point(last.size() - 1); + tempBorderPolygons[physicalExtruder] = new RrPolygonList(); + tempFillPolygons[physicalExtruder] = new RrPolygonList(); } - fills = fills.nearEnds(startNearHere, false, -1); - if(fills.size() > 0) - { - RrPolygon last = fills.polygon(fills.size() - 1); - startNearHere = last.point(last.size() - 1); - } - support = support.nearEnds(startNearHere, false, -1); - if(support.size() > 0) - { - RrPolygon last = support.polygon(support.size() - 1); - startNearHere = last.point(last.size() - 1); - } - */ - for(int physicalExtruder = 0; physicalExtruder < allPolygons.length; physicalExtruder++) - tempPolygons[physicalExtruder] = new RrPolygonList(); for(int pol = 0; pol < borders.size(); pol++) { - //shield = false; RrPolygon p = borders.polygon(pol); - tempPolygons[p.getAttributes().getExtruder().getPhysicalExtruderNumber()].add(p); + tempBorderPolygons[p.getAttributes().getExtruder().getPhysicalExtruderNumber()].add(p); } for(int pol = 0; pol < fills.size(); pol++) { - //shield = false; RrPolygon p = fills.polygon(pol); - tempPolygons[p.getAttributes().getExtruder().getPhysicalExtruderNumber()].add(p); + tempFillPolygons[p.getAttributes().getExtruder().getPhysicalExtruderNumber()].add(p); } for(int pol = 0; pol < support.size(); pol++) { - //shield = false; RrPolygon p = support.polygon(pol); - tempPolygons[p.getAttributes().getExtruder().getPhysicalExtruderNumber()].add(p); + tempFillPolygons[p.getAttributes().getExtruder().getPhysicalExtruderNumber()].add(p); } + for(int physicalExtruder = 0; physicalExtruder < allPolygons.length; physicalExtruder++) { - if(tempPolygons[physicalExtruder].size() > 0) + if(tempBorderPolygons[physicalExtruder].size() > 0) { - double linkUp = tempPolygons[physicalExtruder].polygon(0).getAttributes().getExtruder().getExtrusionSize(); + double linkUp = tempBorderPolygons[physicalExtruder].polygon(0).getAttributes().getExtruder().getExtrusionSize(); linkUp = (4*linkUp*linkUp); - tempPolygons[physicalExtruder].radicalReOrder(linkUp); - tempPolygons[physicalExtruder] = tempPolygons[physicalExtruder].nearEnds(startNearHere, false, -1); - if(tempPolygons[physicalExtruder].size() > 0) + tempBorderPolygons[physicalExtruder].radicalReOrder(linkUp); + tempBorderPolygons[physicalExtruder] = tempBorderPolygons[physicalExtruder].nearEnds(startNearHere, false, -1); + if(tempBorderPolygons[physicalExtruder].size() > 0) { - RrPolygon last = tempPolygons[physicalExtruder].polygon(tempPolygons[physicalExtruder].size() - 1); + RrPolygon last = tempBorderPolygons[physicalExtruder].polygon(tempBorderPolygons[physicalExtruder].size() - 1); startNearHere = last.point(last.size() - 1); } - allPolygons[physicalExtruder].add(tempPolygons[physicalExtruder]); + allPolygons[physicalExtruder].add(tempBorderPolygons[physicalExtruder]); } + if(tempFillPolygons[physicalExtruder].size() > 0) + { + double linkUp = tempFillPolygons[physicalExtruder].polygon(0).getAttributes().getExtruder().getExtrusionSize(); + linkUp = (4*linkUp*linkUp); + tempFillPolygons[physicalExtruder].radicalReOrder(linkUp); + tempFillPolygons[physicalExtruder] = tempFillPolygons[physicalExtruder].nearEnds(startNearHere, false, -1); + if(tempFillPolygons[physicalExtruder].size() > 0) + { + RrPolygon last = tempFillPolygons[physicalExtruder].polygon(tempFillPolygons[physicalExtruder].size() - 1); + startNearHere = last.point(last.size() - 1); + } + allPolygons[physicalExtruder].add(tempFillPolygons[physicalExtruder]); + } } } Modified: trunk/software/host/src/org/reprap/geometry/polygons/BooleanGridList.java =================================================================== --- trunk/software/host/src/org/reprap/geometry/polygons/BooleanGridList.java 2011-05-11 17:56:30 UTC (rev 4129) +++ trunk/software/host/src/org/reprap/geometry/polygons/BooleanGridList.java 2011-05-11 21:10:40 UTC (rev 4130) @@ -115,6 +115,18 @@ } /** + * Reverse the order of the list + * @return + */ + public BooleanGridList reverse() + { + BooleanGridList result = new BooleanGridList(); + for(int i = size() - 1; i >= 0; i--) + result.add(get(i)); + return result; + } + + /** * Offset all the shapes in the list for this layer * @param lc * @param outline @@ -160,6 +172,7 @@ result.add(thisOne); shell++; } + result = result.reverse(); // Best to plot from the inside out } else { // Must be a hatch. Only do it if the gap is +ve or we're building the foundation This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |