skeinforge_application.skeinforge_plugins.craft_plugins.fill ($Date: 2008/28/04 $)
index
/home/enrique/Desktop/backup/babbleold/script/reprap/fabmetheus/skeinforge_application/skeinforge_plugins/craft_plugins/fill.py

Previous / Next / Contents


Fill is a script to fill the edges of a gcode file.

The fill manual page is at:
http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Fill

Allan Ecker aka The Masked Retriever has written the "Skeinforge Quicktip: Fill" at:
http://blog.thingiverse.com/2009/07/21/mysteries-of-skeinforge-fill/


Operation
Settings
  Diaphragm
    Diaphragm Period
    Diaphragm Thickness
  Extra Shells
    Extra Shells on Alternating Solid Layers
    Extra Shells on Base
    Extra Shells on Sparse Layer
  Grid
    Grid Circle Separation over Perimeter Width
    Grid Extra Overlap
    Grid Junction Separation over Octogon Radius At End
    Grid Junction Separation over Octogon Radius At Middle
    Grid Junction Separation Band Height
  Infill
    Infill Pattern
      Grid Circular
      Grid Hexagonal
      Grid Rectangular
      Line
    Infill Begin Rotation
    Infill Odd Layer Extra Rotation
    Infill Begin Rotation Repeat
    Infill Perimeter Overlap
    Infill Solidity
    Infill Width over Thickness
  Sharpest Angle
  Solid Surface Thickness
  Start From Choice
    Lower Left
    Nearest
  Surrounding Angle
  Thread Sequence Choice
    Infill > Loops > Perimeter
    Infill > Perimeter > Loops
    Loops > Infill > Perimeter
    Loops > Perimeter > Infill
    Perimeter > Infill > Loops
    Perimeter > Loops > Infill
Examples

Operation


The default 'Activate Fill' checkbox is off. When it is on, the functions described below will work, when it is off, the functions will not be called.

Settings


Diaphragm

The diaphragm is a solid group of layers, at regular intervals. It can be used with a sparse infill to give the object watertight, horizontal compartments and/or a higher shear strength.

Diaphragm Period

Default is one hundred.

Defines the number of layers between diaphrams.

Diaphragm Thickness

Default is zero, because the diaphragm feature is rarely used.

Defines the number of layers the diaphram is composed of.

Extra Shells

The shells interior edge loops. Adding extra shells makes the object stronger & heavier.

Extra Shells on Alternating Solid Layers

Default is two.

Defines the number of extra shells, on the alternating solid layers.

Extra Shells on Base

Default is one.

Defines the number of extra shells on the bottom, base layer and every even solid layer after that. Setting this to a different value than the "Extra Shells on Alternating Solid Layers" means the infill pattern will alternate, creating a strong interleaved bond even if the edge loop shrinks.

Extra Shells on Sparse Layer

Default is one.

Defines the number of extra shells on the sparse layers. The solid layers are those at the top & bottom, and wherever the object has a plateau or overhang, the sparse layers are the layers in between.

Grid

Grid Circle Separation over Perimeter Width

Default is 0.2.

Defines the ratio of the amount the grid circle is inset over the edge width, the default is zero. With a value of zero the circles will touch, with a value of one two threads could be fitted between the circles.

Grid Extra Overlap

Default is 0.1.

Defines the amount of extra overlap added when extruding the grid to compensate for the fact that when the first thread going through a grid point is extruded, since there is nothing there yet for it to connect to it will shrink extra.

Grid Junction Separation over Octogon Radius At End

Default is zero.

Defines the ratio of the amount the grid square is increased in each direction over the extrusion width at the end. With a value of one or so the grid pattern will have large squares to go with the octogons.

Grid Junction Separation over Octogon Radius At Middle

Default is zero.

Defines the increase at the middle. If this value is different than the value at the end, the grid would have an accordion pattern, which would give it a higher shear strength.

Grid Junction Separation Band Height

Default is ten.

Defines the height of the bands of the accordion pattern.

Infill

Infill Pattern

Default is 'Line', since it is quicker to generate and does not add extra movements for the extruder. The grid pattern has extra diagonal lines, so when choosing a grid option, set the infill solidity to 0.2 or less so that there is not too much plastic and the grid generation time, which increases with the third power of solidity, will be reasonable.

Grid Circular
When selected, the infill will be a grid of separated circles. Because the circles are separated, the pattern is weak, it only provides support for the top layer threads and some strength in the z direction. The flip side is that this infill does not warp the object, the object will get warped only by the walls.

Because this pattern turns the extruder on and off often, it is best to use a stepper motor extruder.

Grid Hexagonal
When selected, the infill will be a hexagonal grid. Because the grid is made with threads rather than with molding or milling, only a partial hexagon is possible, so the rectangular grid pattern is stronger.

Grid Rectangular
When selected, the infill will be a funky octogon square honeycomb like pattern which gives the object extra strength.

Line
When selected, the infill will be made up of lines.

Infill Begin Rotation

Default is forty five degrees, giving a diagonal infill.

Defines the amount the infill direction of the base and every second layer thereafter is rotated.

Infill Odd Layer Extra Rotation

Default is ninety degrees, making the odd layer infill perpendicular to the base layer.

Defines the extra amount the infill direction of the odd layers is rotated compared to the base layer.

Infill Begin Rotation Repeat

Default is one, giving alternating cross hatching.

Defines the number of layers that the infill begin rotation will repeat. With a value higher than one, the infill will go in one direction more often, giving the object more strength in one direction and less in the other, this is useful for beams and cantilevers.

Infill Perimeter Overlap

Default is 0.15.

Defines the amount the infill overlaps the edge over the average of the edge and infill width. The higher the value the more the infill will overlap the edge, and the thicker join between the infill and the edge. If the value is too high, the join will be so thick that the nozzle will run plow through the join below making a mess, also when it is above 0.45 fill may not be able to create infill correctly. If you want to stretch the infill a lot, set 'Path Stretch over Perimeter Width' in stretch to a high value.

Infill Solidity

Default is 0.2.

Defines the solidity of the infill, this is the most important setting in fill. A value of one means the infill lines will be right beside each other, resulting in a solid, strong, heavy shape which takes a long time to extrude. A low value means the infill will be sparse, the interior will be mosty empty space, the object will be weak, light and quick to build.

Infill Width over Thickness

Default is 1.5.

Defines the ratio of the infill width over the layer height. The higher the value the wider apart the infill will be and therefore the sparser the infill will be.

Sharpest Angle

Default: 60 degrees

Defines the sharpest angle that a thread is allowed to make before it is separated into two threads. If 'Sharpest Angle' is too low, the extruder will stop and start often, slowing printing and putting more wear and tear on the extruder. If 'Sharpest Angle' is too high, then threads will almost double back on themselves, leading to bumps in the fill, and sometimes filament being dragged by the nozzle.

This parameter is used in fill, raft and skin.

Solid Surface Thickness

Default is three.

Defines the number of solid layers that are at the bottom, top, plateaus and overhang. With a value of zero, the entire object will be composed of a sparse infill, and water could flow right through it. With a value of one, water will leak slowly through the surface and with a value of three, the object could be watertight. The higher the solid surface thickness, the stronger and heavier the object will be.

Start From Choice

Default is 'Lower Left'.

Defines where each layer starts from.

Lower Left

When selected the layer will start from the lower left corner. This is to extrude in round robin fashion so that the first extrusion will be deposited on the coolest part of the last layer. The reason for this is described at:
http://hydraraptor.blogspot.com/2010/12/round-robin.html

Nearest

When selected the layer will start from the closest point to the end of the last layer. This leads to less stringing, but the first extrusion will be deposited on the hottest part of the last layer which leads to melting problems. So this option is deprecated, eventually this option will be removed and the layers will always start from the lower left.

Surrounding Angle

Default: 60 degrees

Defines the angle that the surrounding layers around the infill are expanded.

To decide whether or not the infill should be sparse or solid, fill looks at the 'Solid Surface Thickness' surrounding layers above and below the infill. If any of the expanded layers above or below the infill do not cover the infill, then the infill will be solid in that region. The layers are expanded by the height difference times the tangent of the surrounding angle, which is from the vertical. For example, if the model is a wedge with a wall angle less than the surrounding angle, the interior layers (those which are not on the bottom or top) will be sparse. If the wall angle is greater than the surrounding angle, the interior layers will be solid.

The time required to examine the surrounding layers increases with the surrounding angle, so the surrounding angle is limited to eighty degrees, regardless of the input value.

If you have an organic shape with gently sloping surfaces; if the surrounding angle is set too high, then too many layers will be sparse. If the surrounding angle is too low, then too many layers will be solid and the extruder may end up plowing through previous layers:
http://hydraraptor.blogspot.com/2008/08/bearing-fruit.html

Thread Sequence Choice

The 'Thread Sequence Choice' is the sequence in which the threads will be extruded on the second and higher layers. There are three kinds of thread, the edge threads on the outside of the object, the loop threads aka inner shell threads, and the interior infill threads. The first layer thread sequence is 'Perimeter > Loops > Infill'.

The default choice is 'Perimeter > Loops > Infill', which the default stretch parameters are based on. If you change from the default sequence choice setting of edge, then loops, then infill, the optimal stretch thread parameters would also be different. In general, if the infill is extruded first, the infill would have to be stretched more so that even after the filament shrinkage, it would still be long enough to connect to the loop or edge. The six sequence combinations follow below.

Infill > Loops > Perimeter

Infill > Perimeter > Loops

Loops > Infill > Perimeter

Loops > Perimeter > Infill

Perimeter > Infill > Loops

Perimeter > Loops > Infill


Examples


The following examples fill the file Screw Holder Bottom.stl. The examples are run in a terminal in the folder which contains Screw Holder Bottom.stl and fill.py.

> python fill.py
This brings up the fill dialog.

> python fill.py Screw Holder Bottom.stl
The fill tool is parsing the file:
Screw Holder Bottom.stl
..
The fill tool has created the file:
.. Screw Holder Bottom_fill.gcode


Previous / Next / Contents


 
Modules
       
__init__
fabmetheus_utilities.archive
fabmetheus_utilities.euclidean
fabmetheus_utilities.fabmetheus_tools.fabmetheus_interpret
fabmetheus_utilities.gcodec
fabmetheus_utilities.intercircle
math
fabmetheus_utilities.settings
skeinforge_application.skeinforge_utilities.skeinforge_craft
skeinforge_application.skeinforge_utilities.skeinforge_polyfile
skeinforge_application.skeinforge_utilities.skeinforge_profile
sys
fabmetheus_utilities.geometry.solids.triangle_mesh

 
Classes
       
FillRepository
FillSkein
RotatedLayer
YIntersectionPath

 
class FillRepository
    A class to handle the fill settings.
 
  Methods defined here:
__init__(self)
Set the default settings, execute title & settings fileName.
execute(self)
Fill button has been clicked.

 
class FillSkein
    A class to fill a skein of extrusions.
 
  Methods defined here:
__init__(self)
Initialize.
addFill(self, layerIndex)
Add fill to the carve layer.
addGcodeFromThreadZ(self, thread, z)
Add a gcode thread to the output.
addGrid(self, arounds, fillLoops, gridPointInsetX, layerIndex, paths, pixelTable, reverseRotation, surroundingCarves, width)
Add the grid to the infill layer.
addGridCircle(self, center, infillPaths, layerRotation, pixelTable, rotatedLoops, startRotation, width)
Add circle to the grid.
addGridLinePoints(self, begin, end, gridPoints, gridRotationAngle, offset, y)
Add the segments of one line of a grid to the infill.
addRemainingGridPoints(self, arounds, gridPointInsetX, gridPointInsetY, gridPoints, isBothOrNone, paths, pixelTable, width)
Add the remaining grid points to the grid point list.
addRotatedCarve(self, currentLayer, layerDelta, reverseRotation, surroundingCarves)
Add a rotated carve to the surrounding carves.rotatedCarveDictionary
addThreadsBridgeLayer(self, layerIndex, nestedRings, rotatedLayer, testLoops=None)
Add the threads, add the bridge end & the layer end tag.
addToThread(self, location)
Add a location to thread.
getCraftedGcode(self, repository, gcodeText)
Parse gcode text and store the bevel gcode.
getGridPoints(self, fillLoops, reverseRotation)
Get the grid points.
getGridPointsByLoops(self, gridRotationAngle, loops)
Get the grid points by loops.
getLayerRotation(self, layerIndex)
Get the layer rotation.
getNextGripXStep(self, gridXStep)
Get the next grid x step, increment by an extra one every three if hexagonal grid is chosen.
isGridToBeExtruded(self)
Determine if the grid is to be extruded.
isPointInsideLineSegments(self, gridPoint)
Is the point inside the line segments of the loops.
linearMove(self, splitLine)
Add a linear move to the thread.
parseInitialization(self)
Parse gcode initialization and store the parameters.
parseLine(self, lineIndex)
Parse a gcode line and add it to the fill skein.
setGridVariables(self, repository)
Set the grid variables.

 
class RotatedLayer
    A rotated layer.
 
  Methods defined here:
__init__(self, z)
Initialize.
__repr__(self)
Get the string representation of this RotatedLayer.

 
class YIntersectionPath
    A class to hold the y intersection position, the loop which it intersected and the point index of the loop which it intersected.
 
  Methods defined here:
__init__(self, pathIndex, pointIndex, y)
Initialize from the path, point index, and y.
__repr__(self)
Get the string representation of this y intersection.
getPath(self, paths)
Get the path from the paths and path index.
getPointIndexPlusOne(self)
Get the point index plus one.

 
Functions
       
addAroundGridPoint(arounds, gridPoint, gridPointInsetX, gridPointInsetY, gridPoints, gridSearchRadius, isBothOrNone, isDoubleJunction, isJunctionWide, paths, pixelTable, width)
Add the path around the grid point.
addInfillBoundary(infillBoundary, nestedRings)
Add infill boundary to the nested ring that contains it.
addLoop(infillWidth, infillPaths, loop, rotationPlaneAngle)
Add simplified path to fill.
addPath(infillWidth, infillPaths, path, rotationPlaneAngle)
Add simplified path to fill.
addPathIndexFirstSegment(gridPixel, pathIndexTable, pixelTable, segmentFirstPixel)
Add the path index of the closest segment found toward the second segment.
addPathIndexSecondSegment(gridPixel, pathIndexTable, pixelTable, segmentSecondPixel)
Add the path index of the closest segment found toward the second segment.
addPointOnPath(path, pathIndex, pixelTable, point, pointIndex, width)
Add a point to a path and the pixel table.
addPointOnPathIfFree(path, pathIndex, pixelTable, point, pointIndex, width)
Add the closest point to a path, if the point added to a path is free.
addSparseEndpoints(doubleInfillWidth, endpoints, horizontalSegmentsDictionary, horizontalSegmentsDictionaryKey, infillSolidity, removedEndpoints, solidSurfaceThickness, surroundingXIntersections)
Add sparse endpoints.
addSparseEndpointsFromSegment(doubleInfillWidth, endpoints, horizontalSegmentsDictionary, horizontalSegmentsDictionaryKey, infillSolidity, removedEndpoints, segment, solidSurfaceThickness, surroundingXIntersections)
Add sparse endpoints from a segment.
addYIntersectionPathToList(pathIndex, pointIndex, y, yIntersection, yIntersectionPaths)
Add the y intersection path to the y intersection paths.
compareDistanceFromCenter(self, other)
Get comparison in order to sort y intersections in ascending order of distance from the center.
comparePointIndexDescending(self, other)
Get comparison in order to sort y intersections in descending order of point index.
createExtraFillLoops(nestedRing, radius, radiusAround, shouldExtraLoopsBeAdded)
Create extra fill loops.
createFillForSurroundings(nestedRings, radius, radiusAround, shouldExtraLoopsBeAdded)
Create extra fill loops for nested rings.
getAdditionalLength(path, point, pointIndex)
Get the additional length added by inserting a point into a path.
getClosestOppositeIntersectionPaths(yIntersectionPaths)
Get the close to center paths, starting with the first and an additional opposite if it exists.
getCraftedText(fileName, gcodeText='', repository=None)
Fill the inset file or gcode text.
getCraftedTextFromText(gcodeText, repository=None)
Fill the inset gcode text.
getKeyIsInPixelTableAddValue(key, pathIndexTable, pixelTable)
Determine if the key is in the pixel table, and if it is and if the value is not None add it to the path index table.
getLowerLeftCorner(nestedRings)
Get the lower left corner from the nestedRings.
getNewRepository()
Get new repository.
getNonIntersectingGridPointLine(gridPointInsetX, isJunctionWide, paths, pixelTable, yIntersectionPath, width)
Get the points around the grid point that is junction wide that do not intersect.
getPlusMinusSign(number)
Get one if the number is zero or positive else negative one.
getWithLeastLength(path, point)
Insert a point into a path, at the index at which the path would be shortest.
getYIntersectionInsideYSegment(segmentFirstY, segmentSecondY, beginComplex, endComplex, x)
Get the y intersection inside the y segment if it does, else none.
insertGridPointPair(gridPoint, gridPointInsetX, gridPoints, isJunctionWide, paths, pixelTable, yIntersectionPath, width)
Insert a pair of points around the grid point is is junction wide, otherwise inset one point.
insertGridPointPairWithLinePath(gridPoint, gridPointInsetX, gridPoints, isJunctionWide, linePath, paths, pixelTable, yIntersectionPath, width)
Insert a pair of points around the grid point is is junction wide, otherwise inset one point.
insertGridPointPairs(gridPoint, gridPointInsetX, gridPoints, intersectionPathFirst, intersectionPathSecond, isBothOrNone, isJunctionWide, paths, pixelTable, width)
Insert a pair of points around a pair of grid points.
isAddedPointOnPathFree(path, pixelTable, point, pointIndex, width)
Determine if the point added to a path is intersecting the pixel table or the path.
isAddedPointOnPathIntersectingPath(begin, path, point, pointIndex)
Determine if the point added to a path is intersecting the path by checking line intersection.
isIntersectingLoopsPaths(loops, paths, pointBegin, pointEnd)
Determine if the segment between the first and second point is intersecting the loop list.
isPointAddedAroundClosest(layerInfillWidth, paths, pixelTable, removedEndpointPoint, width)
Add the closest removed endpoint to the path, with minimal twisting.
isSegmentAround(aroundSegmentsDictionary, aroundSegmentsDictionaryKey, segment)
Determine if there is another segment around.
isSegmentCompletelyInAnIntersection(segment, xIntersections)
Add sparse endpoints from a segment.
isSegmentInX(segment, xFirst, xSecond)
Determine if the segment overlaps within x.
isSharpCorner(beginComplex, centerComplex, endComplex)
Determine if the three complex points form a sharp corner.
isSidePointAdded(pixelTable, closestPath, closestPathIndex, closestPointIndex, layerInfillWidth, removedEndpointPoint, width)
Add side point along with the closest removed endpoint to the path, with minimal twisting.
main()
Display the fill dialog.
removeEndpoints(layerInfillWidth, paths, pixelTable, removedEndpoints, aroundWidth)
Remove endpoints which are added to the path.
setIsOutside(yCloseToCenterPath, yIntersectionPaths)
Determine if the yCloseToCenterPath is outside.
writeOutput(fileName, shouldAnalyze=True)
Fill an inset gcode file.

 
Data
        __author__ = 'Enrique Perez (perez_enrique@yahoo.com)'
__date__ = '$Date: 2008/28/04 $'
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
absolute_import = _Feature((2, 5, 0, 'alpha', 1), (2, 7, 0, 'alpha', 0), 16384)

 
Author
        Enrique Perez (perez_enrique@yahoo.com)