master
Daid 2012-02-19 16:47:57 +01:00
commit a6f1c941f1
32 changed files with 527 additions and 164 deletions

View File

@ -1 +1 @@
48
49

View File

@ -53,6 +53,7 @@ Previous / <a href="fabmetheus_utilities.html">Next</a> / Contents
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="skeinforge_application.skeinforge_plugins.craft_plugins.cool.html">Cool</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="skeinforge_application.skeinforge_plugins.craft_plugins.dimension.html">Dimension</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="skeinforge_application.skeinforge_plugins.craft_plugins.drill.html">Drill</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="skeinforge_application.skeinforge_plugins.craft_plugins.dwindle.html">Dwindle</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="skeinforge_application.skeinforge_plugins.craft_plugins.export.html">Export</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="skeinforge_application.skeinforge_plugins.craft_plugins.export_plugins.binary_16_byte.html">Binary 16 Byte</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="skeinforge_application.skeinforge_plugins.craft_plugins.export_plugins.gcode_step.html">Gcode Step</a><br>

View File

@ -88,6 +88,8 @@ many lines of text<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&nbsp;a&nbsp;flow&nbsp;rate&nbsp;line.</tt></dd></dl>
<dl><dt><a name="DistanceFeedRate-addGcodeFromFeedRateThreadZ"><strong>addGcodeFromFeedRateThreadZ</strong></a>(self, feedRateMinute, thread, travelFeedRateMinute, z)</dt><dd><tt>Add&nbsp;a&nbsp;thread&nbsp;to&nbsp;the&nbsp;output.</tt></dd></dl>
<dl><dt><a name="DistanceFeedRate-addGcodeFromLoop"><strong>addGcodeFromLoop</strong></a>(self, loop, z)</dt><dd><tt>Add&nbsp;the&nbsp;gcode&nbsp;loop.</tt></dd></dl>
@ -98,6 +100,8 @@ many lines of text<br>
<dl><dt><a name="DistanceFeedRate-addGcodeMovementZWithFeedRate"><strong>addGcodeMovementZWithFeedRate</strong></a>(self, feedRateMinute, point, z)</dt><dd><tt>Add&nbsp;a&nbsp;movement&nbsp;to&nbsp;the&nbsp;output.</tt></dd></dl>
<dl><dt><a name="DistanceFeedRate-addGcodeMovementZWithFeedRateVector3"><strong>addGcodeMovementZWithFeedRateVector3</strong></a>(self, feedRateMinute, vector3)</dt><dd><tt>Add&nbsp;a&nbsp;movement&nbsp;to&nbsp;the&nbsp;output&nbsp;by&nbsp;Vector3.</tt></dd></dl>
<dl><dt><a name="DistanceFeedRate-addLine"><strong>addLine</strong></a>(self, line)</dt><dd><tt>Add&nbsp;a&nbsp;line&nbsp;of&nbsp;text&nbsp;and&nbsp;a&nbsp;newline&nbsp;to&nbsp;the&nbsp;output.</tt></dd></dl>
<dl><dt><a name="DistanceFeedRate-addLineCheckAlteration"><strong>addLineCheckAlteration</strong></a>(self, line)</dt><dd><tt>Add&nbsp;a&nbsp;line&nbsp;of&nbsp;text&nbsp;and&nbsp;a&nbsp;newline&nbsp;to&nbsp;the&nbsp;output&nbsp;and&nbsp;check&nbsp;to&nbsp;see&nbsp;if&nbsp;it&nbsp;is&nbsp;an&nbsp;alteration&nbsp;line.</tt></dd></dl>

View File

@ -136,7 +136,7 @@ The clip tool has created the file:<br>
<dl><dt><a name="ClipSkein-getConnectionIsCloseWithoutOverlap"><strong>getConnectionIsCloseWithoutOverlap</strong></a>(self, location, path)</dt><dd><tt>Determine&nbsp;if&nbsp;the&nbsp;connection&nbsp;is&nbsp;close&nbsp;enough&nbsp;and&nbsp;does&nbsp;not&nbsp;overlap&nbsp;another&nbsp;thread.</tt></dd></dl>
<dl><dt><a name="ClipSkein-getCraftedGcode"><strong>getCraftedGcode</strong></a>(self, clipRepository, gcodeText)</dt><dd><tt>Parse&nbsp;gcode&nbsp;text&nbsp;and&nbsp;store&nbsp;the&nbsp;clip&nbsp;gcode.</tt></dd></dl>
<dl><dt><a name="ClipSkein-getCraftedGcode"><strong>getCraftedGcode</strong></a>(self, gcodeText, repository)</dt><dd><tt>Parse&nbsp;gcode&nbsp;text&nbsp;and&nbsp;store&nbsp;the&nbsp;clip&nbsp;gcode.</tt></dd></dl>
<dl><dt><a name="ClipSkein-getNextThreadIsACloseLoop"><strong>getNextThreadIsACloseLoop</strong></a>(self, path)</dt><dd><tt>Determine&nbsp;if&nbsp;the&nbsp;next&nbsp;thread&nbsp;is&nbsp;a&nbsp;loop.</tt></dd></dl>
@ -144,7 +144,7 @@ The clip tool has created the file:<br>
<dl><dt><a name="ClipSkein-linearMove"><strong>linearMove</strong></a>(self, splitLine)</dt><dd><tt>Add&nbsp;to&nbsp;loop&nbsp;path&nbsp;if&nbsp;this&nbsp;is&nbsp;a&nbsp;loop&nbsp;or&nbsp;path.</tt></dd></dl>
<dl><dt><a name="ClipSkein-parseInitialization"><strong>parseInitialization</strong></a>(self, clipRepository)</dt><dd><tt>Parse&nbsp;gcode&nbsp;initialization&nbsp;and&nbsp;store&nbsp;the&nbsp;parameters.</tt></dd></dl>
<dl><dt><a name="ClipSkein-parseInitialization"><strong>parseInitialization</strong></a>(self)</dt><dd><tt>Parse&nbsp;gcode&nbsp;initialization&nbsp;and&nbsp;store&nbsp;the&nbsp;parameters.</tt></dd></dl>
<dl><dt><a name="ClipSkein-parseLine"><strong>parseLine</strong></a>(self, line)</dt><dd><tt>Parse&nbsp;a&nbsp;gcode&nbsp;line&nbsp;and&nbsp;add&nbsp;it&nbsp;to&nbsp;the&nbsp;clip&nbsp;skein.</tt></dd></dl>
@ -157,8 +157,8 @@ The clip tool has created the file:<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</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&nbsp;a&nbsp;gcode&nbsp;linear&nbsp;move&nbsp;file&nbsp;or&nbsp;text.</tt></dd></dl>
<dl><dt><a name="-getCraftedTextFromText"><strong>getCraftedTextFromText</strong></a>(gcodeText, clipRepository<font color="#909090">=None</font>)</dt><dd><tt>Clip&nbsp;a&nbsp;gcode&nbsp;linear&nbsp;move&nbsp;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&nbsp;a&nbsp;gcode&nbsp;linear&nbsp;move&nbsp;file&nbsp;or&nbsp;text.</tt></dd></dl>
<dl><dt><a name="-getCraftedTextFromText"><strong>getCraftedTextFromText</strong></a>(gcodeText, repository<font color="#909090">=None</font>)</dt><dd><tt>Clip&nbsp;a&nbsp;gcode&nbsp;linear&nbsp;move&nbsp;text.</tt></dd></dl>
<dl><dt><a name="-getNewRepository"><strong>getNewRepository</strong></a>()</dt><dd><tt>Get&nbsp;new&nbsp;repository.</tt></dd></dl>
<dl><dt><a name="-main"><strong>main</strong></a>()</dt><dd><tt>Display&nbsp;the&nbsp;clip&nbsp;dialog.</tt></dd></dl>
<dl><dt><a name="-writeOutput"><strong>writeOutput</strong></a>(fileName, shouldAnalyze<font color="#909090">=True</font>)</dt><dd><tt>Clip&nbsp;a&nbsp;gcode&nbsp;linear&nbsp;move&nbsp;file.&nbsp;&nbsp;Chain&nbsp;clip&nbsp;the&nbsp;gcode&nbsp;if&nbsp;it&nbsp;is&nbsp;not&nbsp;already&nbsp;clipped.</tt></dd></dl>

View File

@ -141,8 +141,6 @@ The comb tool has created the file:<br>
<dl><dt><a name="CombSkein-getAroundBetweenPath"><strong>getAroundBetweenPath</strong></a>(self, begin, end)</dt><dd><tt>Get&nbsp;the&nbsp;path&nbsp;around&nbsp;the&nbsp;loops&nbsp;in&nbsp;the&nbsp;way&nbsp;of&nbsp;the&nbsp;original&nbsp;line&nbsp;segment.</tt></dd></dl>
<dl><dt><a name="CombSkein-getBetweens"><strong>getBetweens</strong></a>(self)</dt><dd><tt>Get&nbsp;betweens&nbsp;for&nbsp;the&nbsp;layer.</tt></dd></dl>
<dl><dt><a name="CombSkein-getBoundaries"><strong>getBoundaries</strong></a>(self)</dt><dd><tt>Get&nbsp;boundaries&nbsp;for&nbsp;the&nbsp;layer.</tt></dd></dl>
<dl><dt><a name="CombSkein-getBoundaryIndexes"><strong>getBoundaryIndexes</strong></a>(self, begin, boundaries, end, points)</dt><dd><tt>Get&nbsp;boundary&nbsp;indexes&nbsp;and&nbsp;set&nbsp;the&nbsp;points&nbsp;in&nbsp;the&nbsp;way&nbsp;of&nbsp;the&nbsp;original&nbsp;line&nbsp;segment.</tt></dd></dl>

View File

@ -10,7 +10,7 @@
><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>
@ -60,7 +60,7 @@ The drill tool has created the file:<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>

View File

@ -10,7 +10,7 @@
><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>
@ -149,7 +149,7 @@ The export tool has created the file:<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>

View File

@ -28,7 +28,8 @@
<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>&nbsp;(package)</a><br>
<a href="skeinforge_application.skeinforge_plugins.craft_plugins.feed.html">feed</a><br>
@ -39,8 +40,8 @@
<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>
@ -50,9 +51,9 @@
<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>

View File

@ -92,7 +92,6 @@ The plugin buttons which are commonly used are bolded and the ones which are rar
<dl><dt><a name="-getPluginsDirectoryPath"><strong>getPluginsDirectoryPath</strong></a>()</dt><dd><tt>Get&nbsp;the&nbsp;plugins&nbsp;directory&nbsp;path.</tt></dd></dl>
<dl><dt><a name="-getProcedures"><strong>getProcedures</strong></a>(procedure, text)</dt><dd><tt>Get&nbsp;the&nbsp;procedures&nbsp;up&nbsp;to&nbsp;and&nbsp;including&nbsp;the&nbsp;given&nbsp;procedure.</tt></dd></dl>
<dl><dt><a name="-getReadCraftSequence"><strong>getReadCraftSequence</strong></a>()</dt><dd><tt>Get&nbsp;profile&nbsp;sequence.</tt></dd></dl>
<dl><dt><a name="-getSequenceIndexFromProcedure"><strong>getSequenceIndexFromProcedure</strong></a>(procedure)</dt><dd><tt>Get&nbsp;the&nbsp;profile&nbsp;sequence&nbsp;index&nbsp;of&nbsp;the&nbsp;procedure.&nbsp;&nbsp;Return&nbsp;None&nbsp;if&nbsp;the&nbsp;procedure&nbsp;is&nbsp;not&nbsp;in&nbsp;the&nbsp;sequence</tt></dd></dl>
<dl><dt><a name="-getSequenceIndexPlusOneFromText"><strong>getSequenceIndexPlusOneFromText</strong></a>(fileText)</dt><dd><tt>Get&nbsp;the&nbsp;profile&nbsp;sequence&nbsp;index&nbsp;of&nbsp;the&nbsp;file&nbsp;plus&nbsp;one.&nbsp;&nbsp;Return&nbsp;zero&nbsp;if&nbsp;the&nbsp;procedure&nbsp;is&nbsp;not&nbsp;in&nbsp;the&nbsp;file</tt></dd></dl>
<dl><dt><a name="-main"><strong>main</strong></a>()</dt><dd><tt>Write&nbsp;craft&nbsp;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&nbsp;and&nbsp;write&nbsp;a&nbsp;crafted&nbsp;shape&nbsp;file.</tt></dd></dl>

View File

@ -201,6 +201,11 @@ def isProcedureDone(gcodeText, procedure):
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
@ -260,6 +265,10 @@ class DistanceFeedRate:
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:
@ -270,10 +279,10 @@ class DistanceFeedRate:
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.'
@ -292,18 +301,24 @@ class DistanceFeedRate:
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.'
@ -392,7 +407,7 @@ class DistanceFeedRate:
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.'

View File

@ -913,8 +913,8 @@ class FileHelpMenuBar:
addAcceleratorCommand('<Control-KeyPress-q>', quitWindows, self.root, self.fileMenu, 'Quit')
skeinforgePluginsPath = archive.getSkeinforgePath('skeinforge_plugins')
pluginFileNames = archive.getPluginFileNamesFromDirectoryPath(skeinforgePluginsPath)
for pluginFileName in pluginFileNames:
self.addPluginToMenuBar(os.path.join(skeinforgePluginsPath, pluginFileName), repository, window)
#for pluginFileName in pluginFileNames:
# self.addPluginToMenuBar(os.path.join(skeinforgePluginsPath, pluginFileName), repository, window)
def saveClose(self):
"Call the save function then the close function."
@ -1605,10 +1605,10 @@ class PluginFrame:
gridVertical.frameGridVertical = GridVertical( 0, 0 )
gridVertical.frameGridVertical.setExecutablesRepository( gridVertical.repository )
executeTitle = gridVertical.repository.executeTitle
if executeTitle != None:
executeButton = Tkinter.Button( gridVertical.master, activebackground = 'black', activeforeground = 'blue', text = executeTitle, command = gridVertical.frameGridVertical.execute )
executeButton.grid( row = gridVertical.row, column = gridVertical.column, sticky = Tkinter.W )
gridVertical.column += 1
#if executeTitle != None:
# executeButton = Tkinter.Button( gridVertical.master, activebackground = 'black', activeforeground = 'blue', text = executeTitle, command = gridVertical.frameGridVertical.execute )
# executeButton.grid( row = gridVertical.row, column = gridVertical.column, sticky = Tkinter.W )
# gridVertical.column += 1
self.helpButton = Tkinter.Button( gridVertical.master, activebackground = 'black', activeforeground = 'white', text = "?", command = HelpPageRepository( gridVertical.repository ).openPage )
self.helpButton.grid( row = gridVertical.row, column = gridVertical.column, sticky = Tkinter.W )
addEmptyRow( gridVertical )
@ -1713,12 +1713,12 @@ class PluginGroupFrame( PluginFrame ):
gridVertical.repository = getReadRepository( pluginModule.getNewRepository() )
gridVertical.setExecutablesRepository( gridVertical.repository )
executeTitle = gridVertical.repository.executeTitle
if executeTitle != None:
executeButton = Tkinter.Button( gridVertical.master, activebackground = 'black', activeforeground = 'blue', text = executeTitle, command = gridVertical.execute )
executeButton.grid( row = gridVertical.row, column = gridVertical.column, sticky = Tkinter.W )
gridVertical.column += 1
self.helpButton = Tkinter.Button( gridVertical.master, activebackground = 'black', activeforeground = 'white', text = "?", command = HelpPageRepository( gridVertical.repository ).openPage )
self.helpButton.grid( row = gridVertical.row, column = gridVertical.column, sticky = Tkinter.W )
#if executeTitle != None:
# executeButton = Tkinter.Button( gridVertical.master, activebackground = 'black', activeforeground = 'blue', text = executeTitle, command = gridVertical.execute )
# executeButton.grid( row = gridVertical.row, column = gridVertical.column, sticky = Tkinter.W )
# gridVertical.column += 1
#self.helpButton = Tkinter.Button( gridVertical.master, activebackground = 'black', activeforeground = 'white', text = "?", command = HelpPageRepository( gridVertical.repository ).openPage )
#self.helpButton.grid( row = gridVertical.row, column = gridVertical.column, sticky = Tkinter.W )
addEmptyRow( gridVertical )
gridVertical.increment()
for setting in gridVertical.repository.displayEntities:

View File

@ -1 +1 @@
12.01.21
12.02.10

View File

@ -232,6 +232,12 @@ import platform
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
@ -246,14 +252,9 @@ import subprocess
# 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
@ -261,7 +262,6 @@ import subprocess
# 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
@ -269,8 +269,8 @@ import subprocess
# 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
#
@ -279,7 +279,6 @@ import subprocess
# 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
@ -360,7 +359,6 @@ import subprocess
# 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
@ -404,7 +402,6 @@ import subprocess
# 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

View File

@ -526,8 +526,8 @@ class TableauWindow:
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.'

View File

@ -763,6 +763,8 @@ class SkeinWindow( tableau.TableauWindow ):
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):

View File

@ -463,6 +463,8 @@ class SkeinWindow( tableau.TableauWindow ):
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):

View File

@ -62,19 +62,19 @@ __date__ = '$Date: 2008/21/04 $'
__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.'
@ -89,12 +89,12 @@ class ClipRepository:
"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):
@ -180,10 +180,11 @@ class ClipSkein:
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)
@ -243,7 +244,7 @@ class ClipSkein:
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]
@ -254,13 +255,13 @@ class ClipSkein:
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)

View File

@ -175,7 +175,7 @@ class CombSkein:
"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
@ -241,7 +241,7 @@ class CombSkein:
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):
@ -261,18 +261,18 @@ class CombSkein:
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:
@ -440,7 +440,7 @@ class CombSkein:
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

View File

@ -374,7 +374,8 @@ class CoolSkein:
self.addOrbitsIfNecessary(remainingOrbitTime)
else:
self.setMultiplier(remainingOrbitTime)
self.addFlowRate(self.multiplier * self.oldFlowRate)
if self.oldFlowRate != None:
self.addFlowRate(self.multiplier * self.oldFlowRate)
z = float(splitLine[1])
self.boundaryLayer = euclidean.LoopLayer(z)
self.highestZ = max(z, self.highestZ)
@ -386,7 +387,8 @@ class CoolSkein:
if self.coolTemperature != None:
self.addTemperature(self.oldTemperature)
self.coolTemperature = None
self.addFlowRate(self.oldFlowRate)
if self.oldFlowRate != None:
self.addFlowRate(self.oldFlowRate)
elif firstWord == '(<nestedRing>)':
self.boundaryLoop = []
self.boundaryLayer.loops.append(self.boundaryLoop)

View File

@ -211,9 +211,6 @@ class DimensionSkein:
if not self.repository.retractWithinIsland.value:
self.parseBoundaries()
self.flowScaleSixty = 60.0 * self.layerHeight * self.edgeWidth / filamentPackingArea
if self.operatingFlowRate == None:
print('There is no operatingFlowRate so dimension will do nothing.')
return gcodeText
self.restartDistance = self.repository.retractionDistance.value + self.repository.restartExtraDistance.value
self.extruderRetractionSpeedMinuteString = self.distanceFeedRate.getRounded(60.0 * self.repository.extruderRetractionSpeed.value)
if self.maximumZFeedRatePerSecond != None and self.travelFeedRatePerSecond != None:
@ -287,8 +284,11 @@ class DimensionSkein:
print(distance)
print(splitLine)
return ''
scaledFlowRate = self.flowRate * self.flowScaleSixty
return self.getExtrusionDistanceStringFromExtrusionDistance(scaledFlowRate / self.feedRateMinute * distance)
if self.operatingFlowRate == None:
return self.getExtrusionDistanceStringFromExtrusionDistance(self.flowScaleSixty / 60.0 * distance)
else:
scaledFlowRate = self.flowRate * self.flowScaleSixty
return self.getExtrusionDistanceStringFromExtrusionDistance(scaledFlowRate / self.feedRateMinute * distance)
def getExtrusionDistanceStringFromExtrusionDistance(self, extrusionDistance):
'Get the extrusion distance string from the extrusion distance.'

View File

@ -0,0 +1,270 @@
"""
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()

View File

@ -302,6 +302,7 @@ class InsetRepository:
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):
@ -426,6 +427,7 @@ class InsetSkein:
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

View File

@ -439,6 +439,7 @@ class RaftSkein:
self.oldLocation = None
self.oldTemperatureOutputString = None
self.operatingFeedRateMinute = None
self.operatingFlowRate = None
self.operatingLayerEndLine = '(<operatingLayerEnd> </operatingLayerEnd>)'
self.operatingJump = None
self.orbitalFeedRatePerSecond = 2.01
@ -548,8 +549,8 @@ class RaftSkein:
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)
@ -903,6 +904,8 @@ class RaftSkein:
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>':
@ -919,8 +922,9 @@ class RaftSkein:
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

View File

@ -174,7 +174,7 @@ class SpeedRepository:
self.fileNameInput = settings.FileNameInput().getFromFileName( fabmetheus_interpret.getGNUTranslatorGcodeFileTypeTuples(), 'Open File for Speed', self, '')
self.openWikiManualHelpPage = settings.HelpPage().getOpenFromAbsolute('http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Speed')
self.activateSpeed = settings.BooleanSetting().getFromValue('Activate Speed', self, True )
self.addFlowRate = settings.BooleanSetting().getFromValue('Add Flow Rate:', self, True )
self.addFlowRate = settings.BooleanSetting().getFromValue('Add Flow Rate:', self, False )
settings.LabelSeparator().getFromRepository(self)
settings.LabelDisplay().getFromName('- Bridge -', self )
self.bridgeFeedRateMultiplier = settings.FloatSpin().getFromValue( 0.8, 'Bridge Feed Rate Multiplier (ratio):', self, 1.2, 1.0 )

View File

@ -117,7 +117,7 @@ class SplodgeRepository:
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'

View File

@ -28,7 +28,7 @@ __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agp
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.'

View File

@ -90,21 +90,16 @@ def getPluginsDirectoryPath():
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()

155
build.sh
View File

@ -1,47 +1,78 @@
#!/bin/sh
#!/bin/bash
#############################
# CONFIGURATION
#############################
##Select the build target
BUILD_TARGET=win32
#BUILD_TARGET=linux
#BUILD_TARGET=osx64
##Do we need to create the final archive
ARCHIVE_FOR_DISTRIBUTION=1
##Which version name are we appending to the final archive
BUILD_NAME=Alpha4
TARGET_DIR=${BUILD_TARGET}-SkeinPyPy-${BUILD_NAME}
##Which versions of external programs to use
PYPY_VERSION=1.8
WIN_PORTABLE_PY_VERSION=2.7.2.1
WIN_PYSERIAL_VERSION=2.5
BUILD_NAME=Alpha4
#############################
# Support functions
#############################
function checkTool
{
if [ -z `which $1` ]; then
echo "The $1 command must be somewhere in your \$PATH."
echo "Fix your \$PATH or install $2"
exit 1
fi
}
#############################
# Actual build script
#############################
#Check if we have 7zip, needed to extract and packup a bunch of packages.
7z > /dev/null 2>&1
if [ $? != 0 ]; then
echo $0 requires 7zip to run.
exit 1
checkTool git "git: http://git-scm.com/"
checkTool curl "curl: http://curl.haxx.se/"
if [ $BUILD_TARGET = "win32" ]; then
#Check if we have 7zip, needed to extract and packup a bunch of packages for windows.
checkTool 7z "7zip: http://www.7-zip.org/"
fi
#For building under MacOS we need gnutar instead of tar
if [ -z `which gnutar` ]; then
TAR=tar
else
TAR=gnutar
fi
#############################
# Download all needed files.
#############################
#Get portable python for windows and extract it. (Linux and Mac need to install python themselfs)
if [ ! -f "PortablePython_${WIN_PORTABLE_PY_VERSION}.exe" ]; then
wget http://ftp.nluug.nl/languages/python/portablepython/v2.7/PortablePython_${WIN_PORTABLE_PY_VERSION}.exe
fi
if [ ! -f pyserial-${WIN_PYSERIAL_VERSION}.exe ]; then
wget http://sourceforge.net/projects/pyserial/files/pyserial/${WIN_PYSERIAL_VERSION}/pyserial-${WIN_PYSERIAL_VERSION}.win32.exe/download
mv download pyserial-${WIN_PYSERIAL_VERSION}.exe
fi
#Get pypy
if [ ! -f "pypy-${PYPY_VERSION}-win32.zip" ]; then
wget https://bitbucket.org/pypy/pypy/downloads/pypy-${PYPY_VERSION}-win32.zip
fi
if [ ! -f "pypy-${PYPY_VERSION}-linux.tar.bz2" ]; then
wget https://bitbucket.org/pypy/pypy/downloads/pypy-${PYPY_VERSION}-linux.tar.bz2
fi
if [ ! -f "pypy-${PYPY_VERSION}-osx64.tar.bz2" ]; then
wget https://bitbucket.org/pypy/pypy/downloads/pypy-${PYPY_VERSION}-osx64.tar.bz2
if [ $BUILD_TARGET = "win32" ]; then
#Get portable python for windows and extract it. (Linux and Mac need to install python themselfs)
if [ ! -f "PortablePython_${WIN_PORTABLE_PY_VERSION}.exe" ]; then
curl -L -O http://ftp.nluug.nl/languages/python/portablepython/v2.7/PortablePython_${WIN_PORTABLE_PY_VERSION}.exe
fi
if [ ! -f pyserial-${WIN_PYSERIAL_VERSION}.exe ]; then
curl -L -O http://sourceforge.net/projects/pyserial/files/pyserial/${WIN_PYSERIAL_VERSION}/pyserial-${WIN_PYSERIAL_VERSION}.win32.exe/download
mv download pyserial-${WIN_PYSERIAL_VERSION}.exe
fi
#Get pypy
if [ ! -f "pypy-${PYPY_VERSION}-win32.zip" ]; then
curl -L -O https://bitbucket.org/pypy/pypy/downloads/pypy-${PYPY_VERSION}-win32.zip
fi
else
if [ ! -f "pypy-${PYPY_VERSION}-${BUILD_TARGET}.tar.bz2" ]; then
curl -L -O https://bitbucket.org/pypy/pypy/downloads/pypy-${PYPY_VERSION}-${BUILD_TARGET}.tar.bz2
fi
fi
#Get our own version of Printrun
rm -rf Printrun
git clone git://github.com/daid/Printrun.git
@ -50,55 +81,55 @@ rm -rf Printrun/.git
#############################
# Build the packages
#############################
rm -rf target_win32 target_linux target_osx64
mkdir -p target_win32 target_linux target_osx64
rm -rf ${TARGET_DIR}
mkdir -p ${TARGET_DIR}
7z x PortablePython_${WIN_PORTABLE_PY_VERSION}.exe \$_OUTDIR/App
7z x PortablePython_${WIN_PORTABLE_PY_VERSION}.exe \$_OUTDIR/Lib/site-packages
7z x pyserial-${WIN_PYSERIAL_VERSION}.exe PURELIB
if [ $BUILD_TARGET = "win32" ]; then
#For windows extract portable python to include it.
7z x PortablePython_${WIN_PORTABLE_PY_VERSION}.exe \$_OUTDIR/App
7z x PortablePython_${WIN_PORTABLE_PY_VERSION}.exe \$_OUTDIR/Lib/site-packages
7z x pyserial-${WIN_PYSERIAL_VERSION}.exe PURELIB
mkdir -p target_win32/python
mv \$_OUTDIR/App/* target_win32/python
mv \$_OUTDIR/Lib/site-packages/wx* target_win32/python/Lib/site-packages/
mv PURELIB/serial target_win32/python/Lib
rm -rf \$_OUTDIR
rm -rf PURELIB
mkdir -p ${TARGET_DIR}/python
mv \$_OUTDIR/App/* ${TARGET_DIR}/python
mv \$_OUTDIR/Lib/site-packages/wx* ${TARGET_DIR}/python/Lib/site-packages/
mv PURELIB/serial ${TARGET_DIR}/python/Lib
rm -rf \$_OUTDIR
rm -rf PURELIB
fi
#Extract pypy
7z x pypy-${PYPY_VERSION}-win32.zip -otarget_win32
mv target_win32/pypy-${PYPY_VERSION} target_win32/pypy
cd target_linux; tar -xjf ../pypy-${PYPY_VERSION}-linux.tar.bz2; cd ..
mv target_linux/pypy-${PYPY_VERSION} target_linux/pypy
cd target_osx64; tar -xjf ../pypy-${PYPY_VERSION}-osx64.tar.bz2; cd ..
mv target_linux/pypy-${PYPY_VERSION} target_osx64/pypy
if [ $BUILD_TARGET = "win32" ]; then
7z x pypy-${PYPY_VERSION}-win32.zip -o${TARGET_DIR}
mv ${TARGET_DIR}/pypy-${PYPY_VERSION} ${TARGET_DIR}/pypy
else
cd ${TARGET_DIR}; $TAR -xjf ../pypy-${PYPY_VERSION}-${BUILD_TARGET}.tar.bz2; cd ..
mv ${TARGET_DIR}/pypy-${PYPY_VERSION} ${TARGET_DIR}/pypy
fi
#add Skeinforge
cp -a SkeinPyPy target_win32/SkeinPyPy
cp -a SkeinPyPy target_linux/SkeinPyPy
cp -a SkeinPyPy target_osx64/SkeinPyPy
cp -a SkeinPyPy ${TARGET_DIR}/SkeinPyPy
#add printrun
cp -a Printrun target_win32/Printrun
cp -a Printrun target_linux/Printrun
cp -a Printrun target_osx64/Printrun
mv Printrun ${TARGET_DIR}/Printrun
#add windows batch files
echo "python\\python.exe SkeinPyPy\\skeinforge_application\\skeinforge.py" > target_win32/skeinforge.bat
echo "python\\python.exe printrun\\pronterface.py" > target_win32/printrun.bat
#add script files
cp -a scripts/${BUILD_TARGET}/* $TARGET_DIR/
#add readme file
cp README target_win32/README.txt
cp README target_linux/README.txt
cp README target_osx64/README.txt
cp README ${TARGET_DIR}/README.txt
#package the result
cd target_win32
7z a ../SkeinPyPy_Win32_${BUILD_NAME}.zip *
cd ..
cd target_linux
7z a ../SkeinPyPy_Linux_${BUILD_NAME}.zip *
cd ..
cd target_osx64
7z a ../SkeinPyPy_MacOSX_${BUILD_NAME}.zip *
cd ..
if (( ${ARCHIVE_FOR_DISTRIBUTION} )); then
if [ $BUILD_TARGET = "win32" ]; then
cd ${TARGET_DIR}
7z a ../${TARGET_DIR}.zip *
cd ..
else
echo "Archiving to ${TARGET_DIR}.tar.gz"
$TAR cfp - ${TARGET_DIR} | gzip --best -c > ${TARGET_DIR}.tar.gz
fi
else
echo "Installed into ${TARGET_DIR}"
fi

View File

@ -0,0 +1,17 @@
#!/bin/bash
python -c 'import wx'
if [ $? != 0 ]; then
echo "Requires wx python."
exit 1
fi
python -c 'import serial'
if [ $? != 0 ]; then
echo "Requires pyserial."
exit 1
fi
SCRIPT_DIR=`dirname $0`
python ${SCRIPT_DIR}/Printrun/pronterface.py

View File

@ -0,0 +1,19 @@
#!/bin/bash
arch -arch i386 python2.7 -c 'import wx'
if [ $? != 0 ]; then
echo "Requires wx. Download and install from:"
echo " http://www.wxpython.org/download.php"
exit 1
fi
python2.7 -c 'import serial'
if [ $? != 0 ]; then
echo "Requires pyserial."
echo " sudo easy_install-2.7 pyserial"
exit 1
fi
SCRIPT_DIR=`dirname $0`
arch -arch i386 python2.7 ${SCRIPT_DIR}/Printrun/pronterface.py

View File

@ -0,0 +1 @@
@python\python.exe printrun\pronterface.py

View File

@ -0,0 +1,2 @@
@python\python.exe SkeinPyPy\skeinforge_application\skeinforge.py