<a href="skeinforge_application.skeinforge_plugins.craft_plugins.cool.html">Cool</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.dimension.html">Dimension</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.drill.html">Drill</a><br>
+ <a href="skeinforge_application.skeinforge_plugins.craft_plugins.dwindle.html">Dwindle</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.export.html">Export</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.export_plugins.binary_16_byte.html">Binary 16 Byte</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.export_plugins.gcode_step.html">Gcode Step</a><br>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="DistanceFeedRate-__init__"><strong>__init__</strong></a>(self)</dt><dd><tt>Initialize.</tt></dd></dl>
+<dl><dt><a name="DistanceFeedRate-addFlowRateLine"><strong>addFlowRateLine</strong></a>(self, flowRate)</dt><dd><tt>Add a flow rate line.</tt></dd></dl>
+
<dl><dt><a name="DistanceFeedRate-addGcodeFromFeedRateThreadZ"><strong>addGcodeFromFeedRateThreadZ</strong></a>(self, feedRateMinute, thread, travelFeedRateMinute, z)</dt><dd><tt>Add a thread to the output.</tt></dd></dl>
<dl><dt><a name="DistanceFeedRate-addGcodeFromLoop"><strong>addGcodeFromLoop</strong></a>(self, loop, z)</dt><dd><tt>Add the gcode loop.</tt></dd></dl>
<dl><dt><a name="DistanceFeedRate-addGcodeMovementZWithFeedRate"><strong>addGcodeMovementZWithFeedRate</strong></a>(self, feedRateMinute, point, z)</dt><dd><tt>Add a movement to the output.</tt></dd></dl>
+<dl><dt><a name="DistanceFeedRate-addGcodeMovementZWithFeedRateVector3"><strong>addGcodeMovementZWithFeedRateVector3</strong></a>(self, feedRateMinute, vector3)</dt><dd><tt>Add a movement to the output by Vector3.</tt></dd></dl>
+
<dl><dt><a name="DistanceFeedRate-addLine"><strong>addLine</strong></a>(self, line)</dt><dd><tt>Add a line of text and a newline to the output.</tt></dd></dl>
<dl><dt><a name="DistanceFeedRate-addLineCheckAlteration"><strong>addLineCheckAlteration</strong></a>(self, line)</dt><dd><tt>Add a line of text and a newline to the output and check to see if it is an alteration line.</tt></dd></dl>
<dl><dt><a name="ClipSkein-getConnectionIsCloseWithoutOverlap"><strong>getConnectionIsCloseWithoutOverlap</strong></a>(self, location, path)</dt><dd><tt>Determine if the connection is close enough and does not overlap another thread.</tt></dd></dl>
-<dl><dt><a name="ClipSkein-getCraftedGcode"><strong>getCraftedGcode</strong></a>(self, clipRepository, gcodeText)</dt><dd><tt>Parse gcode text and store the clip gcode.</tt></dd></dl>
+<dl><dt><a name="ClipSkein-getCraftedGcode"><strong>getCraftedGcode</strong></a>(self, gcodeText, repository)</dt><dd><tt>Parse gcode text and store the clip gcode.</tt></dd></dl>
<dl><dt><a name="ClipSkein-getNextThreadIsACloseLoop"><strong>getNextThreadIsACloseLoop</strong></a>(self, path)</dt><dd><tt>Determine if the next thread is a loop.</tt></dd></dl>
<dl><dt><a name="ClipSkein-linearMove"><strong>linearMove</strong></a>(self, splitLine)</dt><dd><tt>Add to loop path if this is a loop or path.</tt></dd></dl>
-<dl><dt><a name="ClipSkein-parseInitialization"><strong>parseInitialization</strong></a>(self, clipRepository)</dt><dd><tt>Parse gcode initialization and store the parameters.</tt></dd></dl>
+<dl><dt><a name="ClipSkein-parseInitialization"><strong>parseInitialization</strong></a>(self)</dt><dd><tt>Parse gcode initialization and store the parameters.</tt></dd></dl>
<dl><dt><a name="ClipSkein-parseLine"><strong>parseLine</strong></a>(self, line)</dt><dd><tt>Parse a gcode line and add it to the clip skein.</tt></dd></dl>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
-<td width="100%"><dl><dt><a name="-getCraftedText"><strong>getCraftedText</strong></a>(fileName, text, clipRepository<font color="#909090">=None</font>)</dt><dd><tt>Clip a gcode linear move file or text.</tt></dd></dl>
- <dl><dt><a name="-getCraftedTextFromText"><strong>getCraftedTextFromText</strong></a>(gcodeText, clipRepository<font color="#909090">=None</font>)</dt><dd><tt>Clip a gcode linear move text.</tt></dd></dl>
+<td width="100%"><dl><dt><a name="-getCraftedText"><strong>getCraftedText</strong></a>(fileName, text, repository<font color="#909090">=None</font>)</dt><dd><tt>Clip a gcode linear move file or text.</tt></dd></dl>
+ <dl><dt><a name="-getCraftedTextFromText"><strong>getCraftedTextFromText</strong></a>(gcodeText, repository<font color="#909090">=None</font>)</dt><dd><tt>Clip a gcode linear move text.</tt></dd></dl>
<dl><dt><a name="-getNewRepository"><strong>getNewRepository</strong></a>()</dt><dd><tt>Get new repository.</tt></dd></dl>
<dl><dt><a name="-main"><strong>main</strong></a>()</dt><dd><tt>Display the clip dialog.</tt></dd></dl>
<dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName, shouldAnalyze<font color="#909090">=True</font>)</dt><dd><tt>Clip a gcode linear move file. Chain clip the gcode if it is not already clipped.</tt></dd></dl>
<dl><dt><a name="CombSkein-getAroundBetweenPath"><strong>getAroundBetweenPath</strong></a>(self, begin, end)</dt><dd><tt>Get the path around the loops in the way of the original line segment.</tt></dd></dl>
-<dl><dt><a name="CombSkein-getBetweens"><strong>getBetweens</strong></a>(self)</dt><dd><tt>Get betweens for the layer.</tt></dd></dl>
-
<dl><dt><a name="CombSkein-getBoundaries"><strong>getBoundaries</strong></a>(self)</dt><dd><tt>Get boundaries for the layer.</tt></dd></dl>
<dl><dt><a name="CombSkein-getBoundaryIndexes"><strong>getBoundaryIndexes</strong></a>(self, begin, boundaries, end, points)</dt><dd><tt>Get boundary indexes and set the points in the way of the original line segment.</tt></dd></dl>
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/enrique/Desktop/backup/babbleold/script/reprap/fabmetheus/skeinforge_application/skeinforge_plugins/craft_plugins/drill.py">/home/enrique/Desktop/backup/babbleold/script/reprap/fabmetheus/skeinforge_application/skeinforge_plugins/craft_plugins/drill.py</a></font></td></tr></table>
<p>
-<a href="skeinforge_application.skeinforge_plugins.craft_plugins.dimension.html">Previous</a> / <a href="skeinforge_application.skeinforge_plugins.craft_plugins.export.html">Next</a> / <a href="contents.html">Contents</a>
+<a href="skeinforge_application.skeinforge_plugins.craft_plugins.dimension.html">Previous</a> / <a href="skeinforge_application.skeinforge_plugins.craft_plugins.dwindle.html">Next</a> / <a href="contents.html">Contents</a>
</p>
<p><tt><br>
Drill is a script to drill down small holes.<br>
<br />
<br />
<p>
-<a href="skeinforge_application.skeinforge_plugins.craft_plugins.dimension.html">Previous</a> / <a href="skeinforge_application.skeinforge_plugins.craft_plugins.export.html">Next</a> / <a href="contents.html">Contents</a>
+<a href="skeinforge_application.skeinforge_plugins.craft_plugins.dimension.html">Previous</a> / <a href="skeinforge_application.skeinforge_plugins.craft_plugins.dwindle.html">Next</a> / <a href="contents.html">Contents</a>
</p>
<hr>
</p>
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/enrique/Desktop/backup/babbleold/script/reprap/fabmetheus/skeinforge_application/skeinforge_plugins/craft_plugins/export.py">/home/enrique/Desktop/backup/babbleold/script/reprap/fabmetheus/skeinforge_application/skeinforge_plugins/craft_plugins/export.py</a></font></td></tr></table>
<p>
-<a href="skeinforge_application.skeinforge_plugins.craft_plugins.drill.html">Previous</a> / <a href="skeinforge_application.skeinforge_plugins.craft_plugins.export_plugins.binary_16_byte.html">Next</a> / <a href="contents.html">Contents</a>
+<a href="skeinforge_application.skeinforge_plugins.craft_plugins.dwindle.html">Previous</a> / <a href="skeinforge_application.skeinforge_plugins.craft_plugins.export_plugins.binary_16_byte.html">Next</a> / <a href="contents.html">Contents</a>
</p>
<p><tt><br>
Export is a craft tool to pick an export plugin, add information to the file name, and delete comments.<br>
<br />
<br />
<p>
-<a href="skeinforge_application.skeinforge_plugins.craft_plugins.drill.html">Previous</a> / <a href="skeinforge_application.skeinforge_plugins.craft_plugins.export_plugins.binary_16_byte.html">Next</a> / <a href="contents.html">Contents</a>
+<a href="skeinforge_application.skeinforge_plugins.craft_plugins.dwindle.html">Previous</a> / <a href="skeinforge_application.skeinforge_plugins.craft_plugins.export_plugins.binary_16_byte.html">Next</a> / <a href="contents.html">Contents</a>
</p>
<hr>
</p>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.comb.html">comb</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.cool.html">cool</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.dimension.html">dimension</a><br>
-</td><td width="25%" valign=top><a href="skeinforge_application.skeinforge_plugins.craft_plugins.drill.html">drill</a><br>
+<a href="skeinforge_application.skeinforge_plugins.craft_plugins.drill.html">drill</a><br>
+</td><td width="25%" valign=top><a href="skeinforge_application.skeinforge_plugins.craft_plugins.dwindle.html">dwindle</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.export.html">export</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.export_plugins.html"><strong>export_plugins</strong> (package)</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.feed.html">feed</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.hop.html">hop</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.inset.html">inset</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.jitter.html">jitter</a><br>
-</td><td width="25%" valign=top><a href="skeinforge_application.skeinforge_plugins.craft_plugins.lash.html">lash</a><br>
-<a href="skeinforge_application.skeinforge_plugins.craft_plugins.lift.html">lift</a><br>
+<a href="skeinforge_application.skeinforge_plugins.craft_plugins.lash.html">lash</a><br>
+</td><td width="25%" valign=top><a href="skeinforge_application.skeinforge_plugins.craft_plugins.lift.html">lift</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.limit.html">limit</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.mill.html">mill</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.multiply.html">multiply</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.raft.html">raft</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.scale.html">scale</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.skin.html">skin</a><br>
-</td><td width="25%" valign=top><a href="skeinforge_application.skeinforge_plugins.craft_plugins.skirt.html">skirt</a><br>
+<a href="skeinforge_application.skeinforge_plugins.craft_plugins.skirt.html">skirt</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.smooth.html">smooth</a><br>
-<a href="skeinforge_application.skeinforge_plugins.craft_plugins.speed.html">speed</a><br>
+</td><td width="25%" valign=top><a href="skeinforge_application.skeinforge_plugins.craft_plugins.speed.html">speed</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.splodge.html">splodge</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.stretch.html">stretch</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.temperature.html">temperature</a><br>
<dl><dt><a name="-getPluginsDirectoryPath"><strong>getPluginsDirectoryPath</strong></a>()</dt><dd><tt>Get the plugins directory path.</tt></dd></dl>
<dl><dt><a name="-getProcedures"><strong>getProcedures</strong></a>(procedure, text)</dt><dd><tt>Get the procedures up to and including the given procedure.</tt></dd></dl>
<dl><dt><a name="-getReadCraftSequence"><strong>getReadCraftSequence</strong></a>()</dt><dd><tt>Get profile sequence.</tt></dd></dl>
- <dl><dt><a name="-getSequenceIndexFromProcedure"><strong>getSequenceIndexFromProcedure</strong></a>(procedure)</dt><dd><tt>Get the profile sequence index of the procedure. Return None if the procedure is not in the sequence</tt></dd></dl>
<dl><dt><a name="-getSequenceIndexPlusOneFromText"><strong>getSequenceIndexPlusOneFromText</strong></a>(fileText)</dt><dd><tt>Get the profile sequence index of the file plus one. Return zero if the procedure is not in the file</tt></dd></dl>
<dl><dt><a name="-main"><strong>main</strong></a>()</dt><dd><tt>Write craft output.</tt></dd></dl>
<dl><dt><a name="-writeChainTextWithNounMessage"><strong>writeChainTextWithNounMessage</strong></a>(fileName, procedure, shouldAnalyze<font color="#909090">=True</font>)</dt><dd><tt>Get and write a crafted shape file.</tt></dd></dl>
return False
extruderInitializationIndex = gcodeText.find('(</extruderInitialization>)')
if extruderInitializationIndex == -1:
+ metadataBeginIndex = gcodeText.find('<metadata>')
+ metadataEndIndex = gcodeText.find('</metadata>')
+ if metadataBeginIndex != -1 and metadataEndIndex != -1:
+ attributeString = "procedureName='%s'" % procedure
+ return gcodeText.find(attributeString, metadataBeginIndex, metadataEndIndex) != -1
return False
return gcodeText.find(getTagBracketedProcedure(procedure), 0, extruderInitializationIndex) != -1
self.decimalPlacesCarried = 3
self.output = cStringIO.StringIO()
+ def addFlowRateLine(self, flowRate):
+ 'Add a flow rate line.'
+ self.output.write('M108 S%s\n' % euclidean.getFourSignificantFigures(flowRate))
+
def addGcodeFromFeedRateThreadZ(self, feedRateMinute, thread, travelFeedRateMinute, z):
'Add a thread to the output.'
if len(thread) > 0:
print('thread of only one point in addGcodeFromFeedRateThreadZ in gcodec, this should never happen.')
print(thread)
return
- self.addLine('M101') # Turn extruder on.
+ self.output.write('M101\n') # Turn extruder on.
for point in thread[1 :]:
self.addGcodeMovementZWithFeedRate(feedRateMinute, point, z)
- self.addLine('M103') # Turn extruder off.
+ self.output.write('M103\n') # Turn extruder off.
def addGcodeFromLoop(self, loop, z):
'Add the gcode loop.'
print('thread of only one point in addGcodeFromThreadZ in gcodec, this should never happen.')
print(thread)
return
- self.addLine('M101') # Turn extruder on.
+ self.output.write('M101\n') # Turn extruder on.
for point in thread[1 :]:
self.addGcodeMovementZ(point, z)
- self.addLine('M103') # Turn extruder off.
+ self.output.write('M103\n') # Turn extruder off.
def addGcodeMovementZ(self, point, z):
'Add a movement to the output.'
- self.addLine(self.getLinearGcodeMovement(point, z))
+ self.output.write(self.getLinearGcodeMovement(point, z) + '\n')
def addGcodeMovementZWithFeedRate(self, feedRateMinute, point, z):
'Add a movement to the output.'
- self.addLine(self.getLinearGcodeMovementWithFeedRate(feedRateMinute, point, z))
+ self.output.write(self.getLinearGcodeMovementWithFeedRate(feedRateMinute, point, z) + '\n')
+
+ def addGcodeMovementZWithFeedRateVector3(self, feedRateMinute, vector3):
+ 'Add a movement to the output by Vector3.'
+ xRounded = self.getRounded(vector3.x)
+ yRounded = self.getRounded(vector3.y)
+ self.output.write('G1 X%s Y%s Z%s F%s\n' % (xRounded, yRounded, self.getRounded(vector3.z), self.getRounded(feedRateMinute)))
def addLine(self, line):
'Add a line of text and a newline to the output.'
def getLinearGcodeMovement(self, point, z):
'Get a linear gcode movement.'
- return 'G1 X%s Y%s Z%s' % ( self.getRounded( point.real ), self.getRounded( point.imag ), self.getRounded(z) )
+ return 'G1 X%s Y%s Z%s' % (self.getRounded(point.real), self.getRounded(point.imag), self.getRounded(z))
def getLinearGcodeMovementWithFeedRate(self, feedRateMinute, point, z):
'Get a z limited gcode movement.'
-12.01.21
\ No newline at end of file
+12.02.10
\ No newline at end of file
import subprocess
+# dwindle check for close, document announce dwindle
+# document chamber: heated bed off at a layer http://blog.makerbot.com/2011/03/17/if-you-cant-stand-the-heat/
+# document announce volumeFraction
+# question, should 'Infill Odd Layer Extra Rotation' be dropped
+# consolidate Object First Layer Flow
+#
# document raft, stretch, then carve, comb, fill, inset, oozebane, splodge, temperature, speed once they are updated
# wiki document help, description, polyfile
# subplugins like export static, maybe later mill cut and coil plugins, maybe later still export plugins & change file extension to output file extension http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge
# analyze doesn't save skeinlayer settings, remember xy in skeiniso
#
#
-#
-# question, should 'Infill Odd Layer Extra Rotation' be dropped
-# consolidate Object First Layer Flow
-#
# retraction step leave
# melt _extrusion
# think about http://code.google.com/p/skeinarchiver/ and/or undo
-# add volume fraction to fill
# getStrokeRadius default to edgeWidth
# look at loop end removed bug in upper loop of layer 8 of Screw_Holder_alteration
# fix tower edge line start problem
# set temperature in temperature
# maybe rename geometry_plugins xml
# maybe add carve preview, opening it up in browser
-# dwindle or dawdle or taper
# voronoi average location intersection looped inset intercircles
# skin layers without something over the infill
# check for last existing then remove unneeded fill code (getLastExistingFillLoops) from euclidean, add fill in penultimate loops, if there is no fill it should not use edge - skin should work
# unpause slow flow rate instead of speeding feed rate
# maybe in svgReader if loop intersection with previous union else add
# add links download manual svg_writer, add left right arrow keys to layer
-# delete location from wipe, in other words Arrival X instead of Location Arrival X, also convert Location Arrival to Arrival Location
# command
+# thin support When using support, thin column and then gradually widen: http://img534.imageshack.us/img534/514/overhang.jpg
# manipulation derivations
# cutting ahmet
#
# check inset loop for intersection with loopLayer.loops
# maybe make vectorwrite prominent, not skeiniso, probably not because it doesn't work on Mac
# close, getPillarByLoopLists, addConcave, polymorph original graph section, loop, add step object, add continuous object
-# chamber: heated bed off at a layer http://blog.makerbot.com/2011/03/17/if-you-cant-stand-the-heat/
# profile copy / rename / delete, maybe move craft type to profile
# think about rectangular getVector3RemoveByPre..
# del previous, add begin & end if far get actual path
# get arounds in inset, the inside become extrude loops and the outside below loops _speed
#
#
-# add hook _extrusion
# integral thin width _extrusion
# layer color, for multilayer start http://reprap.org/pub/Main/MultipleMaterialsFiles/legend.xml _extrusion
# maybe raft triple layer base, middle interface with hot loop or ties
# maybe split into source code and documentation sections
# transform plugins, start with sarrus http://www.thingiverse.com/thing:1425
# maybe make setting backups
-# move skeinforge_utilities to fabmetheus_utilities
# maybe lathe cutting
# maybe lathe extrusion
# maybe lathe milling
def limitIndex(self):
'Limit the index so it is not below zero or above the top.'
- self.repository.layer.value = max( 0, self.repository.layer.value )
- self.repository.layer.value = min( len( self.skeinPanes ) - 1, self.repository.layer.value )
+ self.repository.layer.value = max(0, self.repository.layer.value)
+ self.repository.layer.value = min(len(self.skeinPanes) - 1, self.repository.layer.value)
def limitIndexSetArrowMouseDeleteCanvas(self):
'Limit the index, set the arrow type, and delete all the canvas items.'
def getColoredLines(self):
"Get the colored lines from the skein pane."
+ if len(self.skeinPanes) == 0:
+ return []
return self.skeinPanes[ self.repository.layer.value ].coloredLines
def getCopy(self):
def getColoredLines(self):
"Get the colored lines from the skein pane."
+ if len(self.skeinPanes) == 0:
+ return []
return self.skeinPanes[self.repository.layer.value]
def getCopy(self):
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
-def getCraftedText( fileName, text, clipRepository = None ):
+def getCraftedText(fileName, text, repository=None):
"Clip a gcode linear move file or text."
- return getCraftedTextFromText( archive.getTextIfEmpty(fileName, text), clipRepository )
+ return getCraftedTextFromText(archive.getTextIfEmpty(fileName, text), repository)
-def getCraftedTextFromText( gcodeText, clipRepository = None ):
+def getCraftedTextFromText(gcodeText, repository=None):
"Clip a gcode linear move text."
- if gcodec.isProcedureDoneOrFileIsEmpty( gcodeText, 'clip'):
+ if gcodec.isProcedureDoneOrFileIsEmpty(gcodeText, 'clip'):
return gcodeText
- if clipRepository == None:
- clipRepository = settings.getReadRepository( ClipRepository() )
- if not clipRepository.activateClip.value:
+ if repository == None:
+ repository = settings.getReadRepository(ClipRepository())
+ if not repository.activateClip.value:
return gcodeText
- return ClipSkein().getCraftedGcode( clipRepository, gcodeText )
+ return ClipSkein().getCraftedGcode(gcodeText, repository)
def getNewRepository():
'Get new repository.'
"A class to handle the clip settings."
def __init__(self):
"Set the default settings, execute title & settings fileName."
- skeinforge_profile.addListsToCraftTypeRepository('skeinforge_application.skeinforge_plugins.craft_plugins.clip.html', self )
- self.fileNameInput = settings.FileNameInput().getFromFileName( fabmetheus_interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File for Clip', self, '')
+ skeinforge_profile.addListsToCraftTypeRepository('skeinforge_application.skeinforge_plugins.craft_plugins.clip.html', self)
+ self.fileNameInput = settings.FileNameInput().getFromFileName(fabmetheus_interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File for Clip', self, '')
self.openWikiManualHelpPage = settings.HelpPage().getOpenFromAbsolute('http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Clip')
- self.activateClip = settings.BooleanSetting().getFromValue('Activate Clip', self, False )
- self.clipOverEdgeWidth = settings.FloatSpin().getFromValue( 0.1, 'Clip Over Perimeter Width (ratio):', self, 0.8, 0.5 )
- self.maximumConnectionDistanceOverEdgeWidth = settings.FloatSpin().getFromValue( 1.0, 'Maximum Connection Distance Over Perimeter Width (ratio):', self, 20.0, 10.0 )
+ self.activateClip = settings.BooleanSetting().getFromValue('Activate Clip', self, False)
+ self.clipOverEdgeWidth = settings.FloatSpin().getFromValue(0.1, 'Clip Over Perimeter Width (ratio):', self, 0.8, 0.5)
+ self.maximumConnectionDistanceOverEdgeWidth = settings.FloatSpin().getFromValue(1.0, 'Maximum Connection Distance Over Perimeter Width (ratio):', self, 20.0, 10.0)
self.executeTitle = 'Clip'
def execute(self):
euclidean.addValueSegmentToPixelTable( path[-1], locationComplex, self.layerPixelTable, None, self.layerPixelWidth )
return True
- def getCraftedGcode( self, clipRepository, gcodeText ):
+ def getCraftedGcode(self, gcodeText, repository):
"Parse gcode text and store the clip gcode."
self.lines = archive.getTextLines(gcodeText)
- self.parseInitialization( clipRepository )
+ self.repository = repository
+ self.parseInitialization()
for self.lineIndex in xrange(self.lineIndex, len(self.lines)):
line = self.lines[self.lineIndex]
self.parseLine(line)
self.loopPath.path.append(location.dropAxis())
self.oldLocation = location
- def parseInitialization(self, clipRepository):
+ def parseInitialization(self):
'Parse gcode initialization and store the parameters.'
for self.lineIndex in xrange(len(self.lines)):
line = self.lines[self.lineIndex]
self.distanceFeedRate.addTagBracketedProcedure('clip')
return
elif firstWord == '(<edgeWidth>':
- self.distanceFeedRate.addTagBracketedLine('clipOverEdgeWidth', clipRepository.clipOverEdgeWidth.value)
+ self.distanceFeedRate.addTagBracketedLine('clipOverEdgeWidth', self.repository.clipOverEdgeWidth.value)
self.edgeWidth = float(splitLine[1])
absoluteEdgeWidth = abs(self.edgeWidth)
- self.clipLength = clipRepository.clipOverEdgeWidth * self.edgeWidth
+ self.clipLength = self.repository.clipOverEdgeWidth.value * self.edgeWidth
self.connectingStepLength = 0.5 * absoluteEdgeWidth
self.layerPixelWidth = 0.34321 * absoluteEdgeWidth
- self.maximumConnectionDistance = clipRepository.maximumConnectionDistanceOverEdgeWidth.value * absoluteEdgeWidth
+ self.maximumConnectionDistance = self.repository.maximumConnectionDistanceOverEdgeWidth.value * absoluteEdgeWidth
elif firstWord == '(<travelFeedRatePerSecond>':
self.travelFeedRateMinute = 60.0 * float(splitLine[1])
self.distanceFeedRate.addLine(line)
"A class to comb a skein of extrusions."
def __init__(self):
'Initialize'
- self.betweenTable = {}
+# self.betweenTable = {}
self.boundaryLoop = None
self.distanceFeedRate = gcodec.DistanceFeedRate()
self.extruderActive = False
def getAroundBetweenPath(self, begin, end):
'Get the path around the loops in the way of the original line segment.'
aroundBetweenPath = []
- betweens = self.getBetweens()
+# betweens = self.getBetweens()
boundaries = self.getBoundaries()
boundarySegments = self.getBoundarySegments(begin, boundaries, end)
for boundarySegmentIndex, boundarySegment in enumerate(boundarySegments):
afterIndex = pointIndex + 1
if afterIndex < len(aroundBetweenPath):
pointAfter = aroundBetweenPath[afterIndex]
- if not euclidean.isLineIntersectingLoops(betweens, pointBefore, pointAfter):
+ if not euclidean.isLineIntersectingLoops(boundaries, pointBefore, pointAfter):
del aroundBetweenPath[pointIndex]
return aroundBetweenPath
- def getBetweens(self):
- 'Get betweens for the layer.'
- if not self.layerZ in self.betweenTable:
- self.betweenTable[self.layerZ] = []
- for boundary in self.getBoundaries():
- self.betweenTable[self.layerZ] += intercircle.getInsetLoopsFromLoop(boundary, self.betweenInset)
- return self.betweenTable[self.layerZ]
-
+# def getBetweens(self):
+# 'Get betweens for the layer.'
+# if not self.layerZ in self.betweenTable:
+# self.betweenTable[self.layerZ] = []
+# for boundary in self.getBoundaries():
+# self.betweenTable[self.layerZ] += intercircle.getInsetLoopsFromLoop(boundary, self.betweenInset)
+# return self.betweenTable[self.layerZ]
+#
def getBoundaries(self):
"Get boundaries for the layer."
if self.layerZ in self.layerTable:
return
elif firstWord == '(<edgeWidth>':
self.edgeWidth = float(splitLine[1])
- self.betweenInset = 0.7 * self.edgeWidth
+# self.betweenInset = 0.7 * self.edgeWidth
self.doubleEdgeWidth = self.edgeWidth + self.edgeWidth
self.halfEdgeWidth = 0.5 * self.edgeWidth
self.quadrupleEdgeWidth = self.doubleEdgeWidth + self.doubleEdgeWidth
--- /dev/null
+"""
+This page is in the table of contents.
+Dwindle is a plugin to smooth the surface dwindle of an object by replacing the edge surface with a surface printed at a fraction of the carve
+height. This gives the impression that the object was carved at a much thinner height giving a high-quality finish, but still prints
+in a relatively short time. The latest process has some similarities with a description at:
+
+The dwindle manual page is at:
+http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Dwindle
+
+==Operation==
+The default 'Activate Dwindle' checkbox is off. When it is on, the functions described below will work, when it is off, nothing will be done.
+
+==Settings==
+====Vertical Divisions====
+Default: 2
+
+Defines the number of times the dwindle infill and edges are divided vertically.
+
+==Examples==
+The following examples dwindle the file Screw Holder Bottom.stl. The examples are run in a terminal in the folder which contains Screw Holder Bottom.stl and dwindle.py.
+
+> python dwindle.py
+This brings up the dwindle dialog.
+
+> python dwindle.py Screw Holder Bottom.stl
+The dwindle tool is parsing the file:
+Screw Holder Bottom.stl
+..
+The dwindle tool has created the file:
+.. Screw Holder Bottom_dwindle.gcode
+
+"""
+
+from __future__ import absolute_import
+#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module.
+import __init__
+
+from fabmetheus_utilities.fabmetheus_tools import fabmetheus_interpret
+from fabmetheus_utilities.vector3 import Vector3
+from fabmetheus_utilities import archive
+from fabmetheus_utilities import euclidean
+from fabmetheus_utilities import gcodec
+from fabmetheus_utilities import settings
+from skeinforge_application.skeinforge_utilities import skeinforge_craft
+from skeinforge_application.skeinforge_utilities import skeinforge_polyfile
+from skeinforge_application.skeinforge_utilities import skeinforge_profile
+import math
+import sys
+
+
+__author__ = 'Enrique Perez (perez_enrique aht yahoo.com)'
+__date__ = '$Date: 2008/21/04 $'
+__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
+
+
+def getCraftedText(fileName, gcodeText, repository=None):
+ 'Dwindle a gcode linear move text.'
+ return getCraftedTextFromText(archive.getTextIfEmpty(fileName, gcodeText), repository)
+
+def getCraftedTextFromText(gcodeText, repository=None):
+ 'Dwindle a gcode linear move text.'
+ if gcodec.isProcedureDoneOrFileIsEmpty(gcodeText, 'dwindle'):
+ return gcodeText
+ if repository == None:
+ repository = settings.getReadRepository(DwindleRepository())
+ if not repository.activateDwindle.value:
+ return gcodeText
+ return DwindleSkein().getCraftedGcode(gcodeText, repository)
+
+def getNewRepository():
+ 'Get new repository.'
+ return DwindleRepository()
+
+def writeOutput(fileName, shouldAnalyze=True):
+ 'Dwindle a gcode linear move file. Chain dwindle the gcode if it is not already dwindle.'
+ skeinforge_craft.writeChainTextWithNounMessage(fileName, 'dwindle', shouldAnalyze)
+
+
+class DwindleRepository:
+ 'A class to handle the dwindle settings.'
+ def __init__(self):
+ 'Set the default settings, execute title & settings fileName.'
+ skeinforge_profile.addListsToCraftTypeRepository('skeinforge_application.skeinforge_plugins.craft_plugins.dwindle.html', self )
+ self.fileNameInput = settings.FileNameInput().getFromFileName( fabmetheus_interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File for Dwindle', self, '')
+ self.openWikiManualHelpPage = settings.HelpPage().getOpenFromAbsolute('http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Dwindle')
+ self.activateDwindle = settings.BooleanSetting().getFromValue('Activate Dwindle', self, False)
+ settings.LabelSeparator().getFromRepository(self)
+ self.endRateMultiplier = settings.FloatSpin().getFromValue(0.4, 'End Rate Multiplier (ratio):', self, 0.8, 0.5)
+ self.pentUpVolume = settings.FloatSpin().getFromValue(0.1, 'Pent Up Volume (cubic millimeters):', self, 1.0, 0.4)
+ self.slowdownSteps = settings.IntSpin().getFromValue(2, 'Slowdown Steps (positive integer):', self, 10, 3)
+ self.slowdownVolume = settings.FloatSpin().getFromValue(0.4, 'Slowdown Volume (cubic millimeters):', self, 4.0, 2.0)
+ self.executeTitle = 'Dwindle'
+
+ def execute(self):
+ 'Dwindle button has been clicked.'
+ fileNames = skeinforge_polyfile.getFileOrDirectoryTypesUnmodifiedGcode(self.fileNameInput.value, fabmetheus_interpret.getImportPluginFileNames(), self.fileNameInput.wasCancelled)
+ for fileName in fileNames:
+ writeOutput(fileName)
+
+
+class DwindleSkein:
+ 'A class to dwindle a skein of extrusions.'
+ def __init__(self):
+ 'Initialize.'
+ self.distanceFeedRate = gcodec.DistanceFeedRate()
+ self.feedRateMinute = 959.0
+ self.isActive = False
+ self.layerIndex = -1
+ self.lineIndex = 0
+ self.lines = None
+ self.oldFlowRate = None
+ self.oldLocation = None
+ self.threadSections = []
+
+ def addThread(self):
+ 'Add the thread sections to the gcode.'
+ if len(self.threadSections) == 0:
+ return
+ area = self.area
+ dwindlePortion = 0.0
+ endRateMultiplier = self.repository.endRateMultiplier.value
+ halfOverSteps = self.halfOverSteps
+ oneOverSteps = self.oneOverSteps
+ currentPentUpVolume = self.repository.pentUpVolume.value * self.oldFlowRate / self.operatingFlowRate
+ slowdownFlowRateMultiplier = 1.0 - (currentPentUpVolume / self.repository.slowdownVolume.value)
+ operatingFeedRateMinute = self.operatingFeedRateMinute
+ slowdownVolume = self.repository.slowdownVolume.value
+ for threadSectionIndex in xrange(len(self.threadSections) - 1, -1, -1):
+ threadSection = self.threadSections[threadSectionIndex]
+ dwindlePortion = threadSection.getDwindlePortion(area, dwindlePortion, operatingFeedRateMinute, self.operatingFlowRate, slowdownVolume)
+ for threadSection in self.threadSections:
+ threadSection.addGcodeThreadSection(self.distanceFeedRate, endRateMultiplier, halfOverSteps, oneOverSteps, slowdownFlowRateMultiplier)
+ self.distanceFeedRate.addFlowRateLine(self.oldFlowRate)
+ self.threadSections = []
+
+ def getCraftedGcode(self, gcodeText, repository):
+ 'Parse gcode text and store the dwindle gcode.'
+ self.lines = archive.getTextLines(gcodeText)
+ self.repository = repository
+ self.parseInitialization()
+ self.area = self.infillWidth * self.layerHeight
+ self.oneOverSteps = 1.0 / float(repository.slowdownSteps.value)
+ self.halfOverSteps = 0.5 * self.oneOverSteps
+ for self.lineIndex in xrange(self.lineIndex, len(self.lines)):
+ line = self.lines[self.lineIndex]
+ self.parseLine(line)
+ return gcodec.getGcodeWithoutDuplication('M108', self.distanceFeedRate.output.getvalue())
+
+ def parseInitialization(self):
+ 'Parse gcode initialization and store the parameters.'
+ for self.lineIndex in xrange(len(self.lines)):
+ line = self.lines[self.lineIndex]
+ splitLine = gcodec.getSplitLineBeforeBracketSemicolon(line)
+ firstWord = gcodec.getFirstWord(splitLine)
+ self.distanceFeedRate.parseSplitLine(firstWord, splitLine)
+ if firstWord == '(</extruderInitialization>)':
+ self.distanceFeedRate.addTagBracketedProcedure('dwindle')
+ return
+ elif firstWord == '(<infillWidth>':
+ self.infillWidth = float(splitLine[1])
+ elif firstWord == '(<layerHeight>':
+ self.layerHeight = float(splitLine[1])
+ elif firstWord == '(<operatingFeedRatePerSecond>':
+ self.operatingFeedRateMinute = 60.0 * float(splitLine[1])
+ elif firstWord == '(<operatingFlowRate>':
+ self.operatingFlowRate = float(splitLine[1])
+ self.oldFlowRate = self.operatingFlowRate
+ self.distanceFeedRate.addLine(line)
+
+ def parseLine(self, line):
+ 'Parse a gcode line and add it to the dwindle skein.'
+ splitLine = gcodec.getSplitLineBeforeBracketSemicolon(line)
+ if len(splitLine) < 1:
+ return
+ firstWord = splitLine[0]
+ if firstWord == 'G1':
+ self.feedRateMinute = gcodec.getFeedRateMinute(self.feedRateMinute, splitLine)
+ location = gcodec.getLocationFromSplitLine(self.oldLocation, splitLine)
+ if self.isActive:
+ self.threadSections.append(ThreadSection(self.feedRateMinute, self.oldFlowRate, location, self.oldLocation))
+ self.oldLocation = location
+ elif firstWord == '(<layer>':
+ self.layerIndex += 1
+ settings.printProgress(self.layerIndex, 'dwindle')
+ elif firstWord == 'M101':
+ self.isActive = True
+ elif firstWord == 'M103':
+ self.isActive = False
+ self.addThread()
+ elif firstWord == 'M108':
+ self.oldFlowRate = gcodec.getDoubleAfterFirstLetter(splitLine[1])
+ if len(self.threadSections) == 0:
+ self.distanceFeedRate.addLine(line)
+
+
+class ThreadSection:
+ 'A class to handle a volumetric section of a thread.'
+ def __init__(self, feedRateMinute, flowRate, location, oldLocation):
+ 'Initialize.'
+ self.feedRateMinute = feedRateMinute
+ self.flowRate = flowRate
+ self.location = location
+ self.oldLocation = oldLocation
+
+ def addGcodeMovementByRate(self, distanceFeedRate, endRateMultiplier, location, rateMultiplier, slowdownFlowRateMultiplier):
+ 'Add gcode movement by rate multiplier.'
+ flowRate = self.flowRate
+ rateMultiplier = rateMultiplier + endRateMultiplier * (1.0 - rateMultiplier)
+ if rateMultiplier < 1.0:
+ flowRate *= slowdownFlowRateMultiplier
+ distanceFeedRate.addFlowRateLine(flowRate * rateMultiplier)
+ distanceFeedRate.addGcodeMovementZWithFeedRateVector3(self.feedRateMinute * rateMultiplier, location)
+
+ def addGcodeThreadSection(self, distanceFeedRate, endRateMultiplier, halfOverSteps, oneOverSteps, slowdownFlowRateMultiplier):
+ 'Add gcode thread section.'
+ if self.dwindlePortionEnd > 1.0 - halfOverSteps:
+ distanceFeedRate.addFlowRateLine(self.flowRate)
+ distanceFeedRate.addGcodeMovementZWithFeedRateVector3(self.feedRateMinute, self.location)
+ return
+ dwindleDifference = self.dwindlePortionBegin - self.dwindlePortionEnd
+ if self.dwindlePortionBegin < 1.0 and dwindleDifference > oneOverSteps:
+ numberOfStepsFloat = math.ceil(dwindleDifference / oneOverSteps)
+ numberOfSteps = int(numberOfStepsFloat)
+ for stepIndex in xrange(numberOfSteps):
+ alongBetween = (float(stepIndex) + 0.5) / numberOfStepsFloat
+ location = self.getLocation(float(stepIndex + 1) / numberOfStepsFloat)
+ rateMultiplier = self.dwindlePortionEnd * alongBetween + self.dwindlePortionBegin * (1.0 - alongBetween)
+ self.addGcodeMovementByRate(distanceFeedRate, endRateMultiplier, location, rateMultiplier, slowdownFlowRateMultiplier)
+ return
+ if self.dwindlePortionBegin > 1.0 and self.dwindlePortionEnd < 1.0:
+ alongDwindle = 0.0
+ if self.dwindlePortionBegin > 1.0 + halfOverSteps:
+ alongDwindle = (self.dwindlePortionBegin - 1.0) / dwindleDifference
+ self.addGcodeMovementByRate(distanceFeedRate, endRateMultiplier, self.getLocation(alongDwindle), 1.0, slowdownFlowRateMultiplier)
+ alongDwindlePortion = self.dwindlePortionEnd * alongDwindle + self.dwindlePortionBegin * (1.0 - alongDwindle)
+ alongDwindleDifference = alongDwindlePortion - self.dwindlePortionEnd
+ numberOfStepsFloat = math.ceil(alongDwindleDifference / oneOverSteps)
+ numberOfSteps = int(numberOfStepsFloat)
+ for stepIndex in xrange(numberOfSteps):
+ alongBetween = (float(stepIndex) + 0.5) / numberOfStepsFloat
+ alongDwindleLocation = float(stepIndex + 1) / numberOfStepsFloat
+ location = self.getLocation(alongDwindleLocation + alongDwindle * (1.0 - alongDwindleLocation))
+ rateMultiplier = self.dwindlePortionEnd * alongBetween + alongDwindlePortion * (1.0 - alongBetween)
+ self.addGcodeMovementByRate(distanceFeedRate, endRateMultiplier, location, rateMultiplier, slowdownFlowRateMultiplier)
+ return
+ rateMultiplier = min(0.5 * (self.dwindlePortionBegin + self.dwindlePortionEnd), 1.0)
+ self.addGcodeMovementByRate(distanceFeedRate, endRateMultiplier, self.location, rateMultiplier, slowdownFlowRateMultiplier)
+
+ def getDwindlePortion(self, area, dwindlePortion, operatingFeedRateMinute, operatingFlowRate, slowdownVolume):
+ 'Get cumulative dwindle portion.'
+ self.dwindlePortionEnd = dwindlePortion
+ distance = abs(self.oldLocation - self.location)
+ volume = area * distance
+ self.dwindlePortionBegin = dwindlePortion + volume / slowdownVolume
+ return self.dwindlePortionBegin
+
+ def getLocation(self, along):
+ 'Get location along way.'
+ return self.location * along + self.oldLocation * (1.0 - along)
+
+
+def main():
+ 'Display the dwindle dialog.'
+ if len(sys.argv) > 1:
+ writeOutput(' '.join(sys.argv[1 :]))
+ else:
+ settings.startMainLoopFromConstructor(getNewRepository())
+
+if __name__ == '__main__':
+ main()
self.loopOrderDescendingArea = settings.MenuRadio().getFromMenuButtonDisplay(self.loopOrderChoice, 'Descending Area', self, False)
self.overlapRemovalWidthOverEdgeWidth = settings.FloatSpin().getFromValue(0.3, 'Overlap Removal Width over Perimeter Width (ratio):', self, 0.9, 0.6)
self.turnExtruderHeaterOffAtShutDown = settings.BooleanSetting().getFromValue('Turn Extruder Heater Off at Shut Down', self, True)
+ self.volumeFraction = settings.FloatSpin().getFromValue(0.7, 'Volume Fraction (ratio):', self, 0.9, 0.82)
self.executeTitle = 'Inset'
def execute(self):
layerHeight = float(splitLine[1])
self.infillWidth = self.repository.infillWidthOverThickness.value * layerHeight
self.distanceFeedRate.addTagRoundedLine('infillWidth', self.infillWidth)
+ self.distanceFeedRate.addTagRoundedLine('volumeFraction', self.repository.volumeFraction.value)
elif firstWord == '(<edgeWidth>':
self.edgeWidth = float(splitLine[1])
self.halfEdgeWidth = 0.5 * self.edgeWidth
self.oldLocation = None
self.oldTemperatureOutputString = None
self.operatingFeedRateMinute = None
+ self.operatingFlowRate = None
self.operatingLayerEndLine = '(<operatingLayerEnd> </operatingLayerEnd>)'
self.operatingJump = None
self.orbitalFeedRatePerSecond = 2.01
aroundWidth = 0.34321 * step
paths = euclidean.getPathsFromEndpoints(endpoints, 1.5 * step, aroundPixelTable, aroundWidth)
self.addLayerLine(z)
- if self.oldFlowRate != None:
- self.addFlowRate(flowRateMultiplier * self.oldFlowRate)
+ if self.operatingFlowRate != None:
+ self.addFlowRate(flowRateMultiplier * self.operatingFlowRate)
for path in paths:
simplifiedPath = euclidean.getSimplifiedPath(path, step)
self.distanceFeedRate.addGcodeFromFeedRateThreadZ(feedRateMinute, simplifiedPath, self.travelFeedRateMinute, z)
return
elif firstWord == '(<layerHeight>':
self.layerHeight = float(splitLine[1])
+ elif firstWord == 'M108':
+ self.oldFlowRate = float(splitLine[1][1 :])
elif firstWord == '(<objectFirstLayerFeedRateInfillMultiplier>':
self.objectFirstLayerFeedRateInfillMultiplier = float(splitLine[1])
elif firstWord == '(<objectFirstLayerFlowRateInfillMultiplier>':
self.operatingFeedRateMinute = 60.0 * float(splitLine[1])
self.feedRateMinute = self.operatingFeedRateMinute
elif firstWord == '(<operatingFlowRate>':
- self.oldFlowRate = float(splitLine[1])
- self.supportFlowRate = self.oldFlowRate * self.repository.supportFlowRateOverOperatingFlowRate.value
+ self.operatingFlowRate = float(splitLine[1])
+ self.oldFlowRate = self.operatingFlowRate
+ self.supportFlowRate = self.operatingFlowRate * self.repository.supportFlowRateOverOperatingFlowRate.value
elif firstWord == '(<edgeWidth>':
self.edgeWidth = float(splitLine[1])
self.halfEdgeWidth = 0.5 * self.edgeWidth
settings.LabelDisplay().getFromName('- Operating -', self )
self.operatingLiftOverExtraThickness = settings.FloatSpin().getFromValue( 0.5, 'Operating Lift over Extra Thickness (ratio):', self, 1.5, 1.0 )
self.operatingSplodgeFeedRate = settings.FloatSpin().getFromValue( 0.4, 'Operating Splodge Feed Rate (mm/s):', self, 2.4, 1.0 )
- self.operatingSplodgeQuantityLength = settings.FloatSpin().getFromValue( 0.4, 'Operating Splodge Quantity Length (millimeters):', self, 2.4, 1.0 )
+ self.operatingSplodgeQuantityLength = settings.FloatSpin().getFromValue(0.4, 'Operating Splodge Quantity Length (millimeters):', self, 2.4, 1.0)
settings.LabelSeparator().getFromRepository(self)
self.executeTitle = 'Splodge'
def getCraftSequence():
'Get the extrusion craft sequence.'
- return 'carve scale bottom preface widen inset fill multiply speed temperature raft skirt chamber tower jitter clip smooth stretch skin comb cool hop wipe oozebane splodge home lash fillet limit unpause dimension alteration export'.split()
+ return 'carve scale bottom preface widen inset fill multiply speed temperature raft skirt chamber tower jitter clip smooth stretch skin comb cool hop wipe oozebane dwindle splodge home lash fillet limit unpause dimension alteration export'.split()
def getNewRepository():
'Get new repository.'
def getProcedures( procedure, text ):
"Get the procedures up to and including the given procedure."
craftSequence = getReadCraftSequence()
+ sequenceIndexFromProcedure = 0
+ if procedure in craftSequence:
+ sequenceIndexFromProcedure = craftSequence.index(procedure)
sequenceIndexPlusOneFromText = getSequenceIndexPlusOneFromText(text)
- sequenceIndexFromProcedure = getSequenceIndexFromProcedure(procedure)
return craftSequence[ sequenceIndexPlusOneFromText : sequenceIndexFromProcedure + 1 ]
def getReadCraftSequence():
"Get profile sequence."
return skeinforge_profile.getCraftTypePluginModule().getCraftSequence()
-def getSequenceIndexFromProcedure(procedure):
- "Get the profile sequence index of the procedure. Return None if the procedure is not in the sequence"
- craftSequence = getReadCraftSequence()
- if procedure not in craftSequence:
- return 0
- return craftSequence.index(procedure)
-
def getSequenceIndexPlusOneFromText(fileText):
"Get the profile sequence index of the file plus one. Return zero if the procedure is not in the file"
craftSequence = getReadCraftSequence()