From 183aed4dd053a2a10dc96f292206d5993b3c2e75 Mon Sep 17 00:00:00 2001 From: daid Date: Mon, 12 Mar 2012 11:03:27 +0100 Subject: [PATCH 01/10] Removed debug message from Joris plugin --- .../skeinforge_plugins/craft_plugins/joris.py | 1 - 1 file changed, 1 deletion(-) diff --git a/SkeinPyPy_NewUI/skeinforge_application/skeinforge_plugins/craft_plugins/joris.py b/SkeinPyPy_NewUI/skeinforge_application/skeinforge_plugins/craft_plugins/joris.py index 42c6856c..cd6ba5bf 100644 --- a/SkeinPyPy_NewUI/skeinforge_application/skeinforge_plugins/craft_plugins/joris.py +++ b/SkeinPyPy_NewUI/skeinforge_application/skeinforge_plugins/craft_plugins/joris.py @@ -134,7 +134,6 @@ class JorisSkein: if len(splitLine) < 1: return firstWord = splitLine[0] - print 'joris:' + firstWord if firstWord == 'G1': self.feedRateMinute = gcodec.getFeedRateMinute(self.feedRateMinute, splitLine) location = gcodec.getLocationFromSplitLine(self.oldLocation, splitLine) From e20799ffef04f9fdce98ad1dabb8e481debd1ea2 Mon Sep 17 00:00:00 2001 From: daid Date: Mon, 12 Mar 2012 12:18:17 +0100 Subject: [PATCH 02/10] Removed useless G21 in start code --- SkeinPyPy_NewUI/skeinforge_application/alterations/start.gcode | 1 - 1 file changed, 1 deletion(-) diff --git a/SkeinPyPy_NewUI/skeinforge_application/alterations/start.gcode b/SkeinPyPy_NewUI/skeinforge_application/alterations/start.gcode index 563b42f5..7db5699c 100644 --- a/SkeinPyPy_NewUI/skeinforge_application/alterations/start.gcode +++ b/SkeinPyPy_NewUI/skeinforge_application/alterations/start.gcode @@ -9,7 +9,6 @@ G28 Z0 ;move Z to min endstops ; height of the nozzle in mm. This can take some messing around ; with to get just right... G92 X0 Y0 Z0 E0 ;reset software position to front/left/z=0.0 -G21 G1 Z15.0 F400 ;move the platform down 15mm G92 E0 ;zero the extruded length From dc339de63802875c9ef0f87c081038416bba5168 Mon Sep 17 00:00:00 2001 From: daid Date: Mon, 12 Mar 2012 12:23:21 +0100 Subject: [PATCH 03/10] Fixing issue 6: rerunning the calibration wizard does not update the filament diameter in the main window --- SkeinPyPy_NewUI/newui/mainWindow.py | 1 + 1 file changed, 1 insertion(+) diff --git a/SkeinPyPy_NewUI/newui/mainWindow.py b/SkeinPyPy_NewUI/newui/mainWindow.py index e1cc265b..0ea254f6 100644 --- a/SkeinPyPy_NewUI/newui/mainWindow.py +++ b/SkeinPyPy_NewUI/newui/mainWindow.py @@ -239,6 +239,7 @@ class mainWindow(configBase.configWindowBase): def OnFirstRunWizard(self, e): configWizard.configWizard() + self.updateProfileToControls() def OnLoadSTL(self, e): dlg=wx.FileDialog(self, "Open file to print", self.lastPath, style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST) From a8ec211df96a463efc477824be89749412151cac Mon Sep 17 00:00:00 2001 From: daid Date: Mon, 12 Mar 2012 12:31:27 +0100 Subject: [PATCH 04/10] Changed the way the default background colour for controls is set after validation. The documented way of setting wx.NullColour does not work correctly on windows XP style and MacOS --- SkeinPyPy_NewUI/newui/configBase.py | 4 +++- SkeinPyPy_NewUI/newui/mainWindow.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/SkeinPyPy_NewUI/newui/configBase.py b/SkeinPyPy_NewUI/newui/configBase.py index 0f939de3..7f55448c 100644 --- a/SkeinPyPy_NewUI/newui/configBase.py +++ b/SkeinPyPy_NewUI/newui/configBase.py @@ -125,6 +125,8 @@ class SettingRow(): self.ctrl.Bind(wx.EVT_ENTER_WINDOW, lambda e: panel.main.OnPopupDisplay(self)) self.ctrl.Bind(wx.EVT_LEAVE_WINDOW, panel.main.OnPopupHide) + self.defaultBGColour = self.ctrl.GetBackgroundColour() + panel.main.settingControlList.append(self) sizer.Add(self.label, (x,y), flag=wx.ALIGN_CENTER_VERTICAL) @@ -151,7 +153,7 @@ class SettingRow(): elif result == validators.WARNING: self.ctrl.SetBackgroundColour('Yellow') else: - self.ctrl.SetBackgroundColour(wx.NullColour) + self.ctrl.SetBackgroundColour(self.defaultBGColour) self.ctrl.Refresh() self.validationMsg = '\n'.join(msgs) diff --git a/SkeinPyPy_NewUI/newui/mainWindow.py b/SkeinPyPy_NewUI/newui/mainWindow.py index 0ea254f6..960a0ff6 100644 --- a/SkeinPyPy_NewUI/newui/mainWindow.py +++ b/SkeinPyPy_NewUI/newui/mainWindow.py @@ -110,6 +110,7 @@ class mainWindow(configBase.configWindowBase): configBase.TitleRow(right, "Filament") c = configBase.SettingRow(right, "Diameter (mm)", 'filament_diameter', '2.89', 'Diameter of your filament, as accurately as possible.\nIf you cannot measure this value you will have to callibrate it, a higher number means less extrusion, a smaller number generates more extrusion.') validators.validFloat(c, 1.0) + validators.warningAbove(c, 3.5, "Are you sure your filament is that thick? Normal filament is around 3mm or 1.75mm.") c = configBase.SettingRow(right, "Packing Density", 'filament_density', '1.00', 'Packing density of your filament. This should be 1.00 for PLA and 0.85 for ABS') validators.validFloat(c, 0.5, 1.5) From ef278b6b1d6ba61f361eaf51e1858ee90d3c15df Mon Sep 17 00:00:00 2001 From: Daid Date: Mon, 12 Mar 2012 19:52:55 +0100 Subject: [PATCH 05/10] Possibly fix the popups for MacOS --- SkeinPyPy_NewUI/newui/configBase.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/SkeinPyPy_NewUI/newui/configBase.py b/SkeinPyPy_NewUI/newui/configBase.py index 7f55448c..f1a66421 100644 --- a/SkeinPyPy_NewUI/newui/configBase.py +++ b/SkeinPyPy_NewUI/newui/configBase.py @@ -1,7 +1,7 @@ from __future__ import absolute_import import __init__ -import wx, os, platform, types +import wx, os, sys, platform, types from fabmetheus_utilities import settings @@ -18,7 +18,7 @@ class configWindowBase(wx.Frame): super(configWindowBase, self).__init__(None, title=title) self.settingControlList = [] - + #Create the popup window self.popup = wx.PopupWindow(self, wx.BORDER_SIMPLE) self.popup.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_INFOBK)) @@ -27,7 +27,10 @@ class configWindowBase(wx.Frame): self.popup.sizer = wx.BoxSizer() self.popup.sizer.Add(self.popup.text, flag=wx.EXPAND|wx.ALL, border=1) self.popup.SetSizer(self.popup.sizer) - + + self.popup.Bind(wx.EVT_MOTION, self.OnPopupHide) + self.popup.text.Bind(wx.EVT_MOTION, self.OnPopupHide) + def CreateConfigTab(self, nb, name): leftConfigPanel, rightConfigPanel, configPanel = self.CreateConfigPanel(nb) nb.AddPage(configPanel, name) @@ -48,7 +51,7 @@ class configWindowBase(wx.Frame): leftConfigPanel.main = self rightConfigPanel.main = self return leftConfigPanel, rightConfigPanel, configPanel - + def OnPopupDisplay(self, setting): self.popup.setting = setting self.UpdatePopup(setting) @@ -125,6 +128,10 @@ class SettingRow(): self.ctrl.Bind(wx.EVT_ENTER_WINDOW, lambda e: panel.main.OnPopupDisplay(self)) self.ctrl.Bind(wx.EVT_LEAVE_WINDOW, panel.main.OnPopupHide) + #MacOS X doesn't get EVT_ENTER/LEAVE_WINDOW for controls. So we use the motion event then. This results in slightly less good popups, but it works. + if sys.platform == 'darwin': + self.ctrl.Bind(wx.EVT_MOTION, lambda e: panel.main.OnPopupDisplay(self)) + self.defaultBGColour = self.ctrl.GetBackgroundColour() panel.main.settingControlList.append(self) From 8a8be87a751dd25083662257d1e17bae1d25b942 Mon Sep 17 00:00:00 2001 From: Daid Date: Mon, 12 Mar 2012 20:15:26 +0100 Subject: [PATCH 06/10] Workaround for STL loading problem. Really need to refactor this. --- SkeinPyPy_NewUI/newui/preview3d.py | 1 + 1 file changed, 1 insertion(+) diff --git a/SkeinPyPy_NewUI/newui/preview3d.py b/SkeinPyPy_NewUI/newui/preview3d.py index f3f3ade8..537ba329 100644 --- a/SkeinPyPy_NewUI/newui/preview3d.py +++ b/SkeinPyPy_NewUI/newui/preview3d.py @@ -113,6 +113,7 @@ class previewPanel(wx.Panel): triangleMesh.origonalVertexes = list(triangleMesh.vertexes) for i in xrange(0, len(triangleMesh.origonalVertexes)): triangleMesh.origonalVertexes[i] = triangleMesh.origonalVertexes[i].copy() + triangleMesh.getMinimumZ() self.triangleMesh = triangleMesh self.gcode = None self.updateModelTransform() From d7d543e199ca05f8e45546384d78e5b2a6318b6f Mon Sep 17 00:00:00 2001 From: Bill Bumgarner Date: Sun, 11 Mar 2012 03:01:46 +0800 Subject: [PATCH 07/10] - build.sh can now take an optional argument that is the architecture of the target platform. I.e.: ./build.sh osx64 - updated to use the latest nightly pypy as it both seems relatively stable and the URL is subject to less rot - updated pronterface.sh to push user to installing Cocoa variant of wxPython and to no longer launch in 32 bit mode --- build.sh | 6 +++--- scripts/osx64/pronterface.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index e6981c5e..51a08c63 100755 --- a/build.sh +++ b/build.sh @@ -9,7 +9,7 @@ ##Select the build target -BUILD_TARGET=win32 +BUILD_TARGET=${1:-win32} #BUILD_TARGET=linux #BUILD_TARGET=osx64 @@ -20,7 +20,7 @@ BUILD_NAME=NewUI-Beta4 TARGET_DIR=${BUILD_TARGET}-SkeinPyPy-${BUILD_NAME} ##Which versions of external programs to use -PYPY_VERSION=c-jit-53274-487174b08100 +PYPY_VERSION=c-jit-latest WIN_PORTABLE_PY_VERSION=2.7.2.1 WIN_PYSERIAL_VERSION=2.5 @@ -126,7 +126,7 @@ if [ $BUILD_TARGET = "win32" ]; then 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 + mv ${TARGET_DIR}/pypy-*-${BUILD_TARGET} ${TARGET_DIR}/pypy fi #Cleanup pypy rm -rf ${TARGET_DIR}/pypy/lib-python/2.7/test diff --git a/scripts/osx64/pronterface.sh b/scripts/osx64/pronterface.sh index 93005942..83896aa0 100644 --- a/scripts/osx64/pronterface.sh +++ b/scripts/osx64/pronterface.sh @@ -1,8 +1,8 @@ #!/bin/bash -arch -arch i386 python2.7 -c 'import wx' +python2.7 -c 'import wx' if [ $? != 0 ]; then - echo "Requires wx. Download and install from:" + echo "Requires wx. Download and install (the Cocoa/64-bit variant) from:" echo " http://www.wxpython.org/download.php" exit 1 fi @@ -15,5 +15,5 @@ if [ $? != 0 ]; then fi SCRIPT_DIR=`dirname $0` -arch -arch i386 python2.7 ${SCRIPT_DIR}/Printrun/pronterface.py +python2.7 ${SCRIPT_DIR}/Printrun/pronterface.py From 6e01b9cd3dc1ef8ced656efcbbed6a20b40a6701 Mon Sep 17 00:00:00 2001 From: Bill Bumgarner Date: Sun, 11 Mar 2012 03:25:11 +0800 Subject: [PATCH 08/10] - build.sh now copies just the startup scripts, and not any editor turds. - startup scripts on Mac OS X are marked executable - startup scripts now make sure that PyOpenGL is installed --- build.sh | 6 +++++- scripts/osx64/pronterface.sh | 0 scripts/osx64/skeinpypy.sh | 26 ++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) mode change 100644 => 100755 scripts/osx64/pronterface.sh create mode 100755 scripts/osx64/skeinpypy.sh diff --git a/build.sh b/build.sh index 51a08c63..d3e1acd4 100755 --- a/build.sh +++ b/build.sh @@ -138,7 +138,11 @@ cp -a SkeinPyPy_NewUI ${TARGET_DIR}/SkeinPyPy mv Printrun ${TARGET_DIR}/Printrun #add script files -cp -a scripts/${BUILD_TARGET}/* $TARGET_DIR/ +if [ $BUILD_TARGET = "win32" ]; then + cp -a scripts/${BUILD_TARGET}/*.bat $TARGET_DIR/ +else + cp -a scripts/${BUILD_TARGET}/*.sh $TARGET_DIR/ +fi #add readme file cp README ${TARGET_DIR}/README.txt diff --git a/scripts/osx64/pronterface.sh b/scripts/osx64/pronterface.sh old mode 100644 new mode 100755 diff --git a/scripts/osx64/skeinpypy.sh b/scripts/osx64/skeinpypy.sh new file mode 100755 index 00000000..736b3018 --- /dev/null +++ b/scripts/osx64/skeinpypy.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +python2.7 -c 'import OpenGL' +if [ $? != 0 ]; then + echo "Requires PyOpenGL" + echo " sudo easy_install-2.7 PyOpenGL" + exit 1 +fi + +python2.7 -c 'import wx' +if [ $? != 0 ]; then + echo "Requires wx. Download and install (the Cocoa/64-bit variant) 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` +python2.7 ${SCRIPT_DIR}/SkeinPyPy/skeinpypy.py + From 3b558eac5266e039d6e37248f9f3bdf98c0dab9d Mon Sep 17 00:00:00 2001 From: Bill Bumgarner Date: Mon, 12 Mar 2012 02:23:44 +0800 Subject: [PATCH 09/10] updated readme --- README | 81 ++++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 53 insertions(+), 28 deletions(-) diff --git a/README b/README index 735b4df9..e087e1a9 100644 --- a/README +++ b/README @@ -1,45 +1,70 @@ For documentation check: https://github.com/daid/SkeinPyPy/wiki For downloads check: https://github.com/daid/SkeinPyPy/downloads +This package includes two programs: +Pronterface: + An application for both manually controlling and automatically feeding gcode to a 3D printer. +SkeinPyPy: + A easy to use program for slicing STL files using SkeinForge. SkeinPyPy can also visualize the 3D models in a variety of ways. -(Old README, is outdated!) + On first run, SkeinPyPy will ask to go through a set of calibration steps that will perform a series of operations on your 3D printer. + One of those steps involves extruding a bit of filament where the filament is initially nearly fully extracted. As such, it you will + probably need to run Pronterface first, heat up the extruder enough to be able to extract the filament and then use the Pronterface + interface to reverse the extruder motor until the filament is at the right position (specifically, until the filament end is even with + where the Bowden tube leaves the extuder motor assembly, on an Ultimaker). -SkeinPyPy is a patched version of Skeinforge. Made to make use of PyPy in combination with Skeinforge easier. -It's also packaged with a customized version of PrintRun. To make a compleet software package. +======== +BUILDING +======== -It's best to use this package with the Marlin firmware. See: http://wiki.ultimaker.com/Skeinforge_PyPy + ./build.sh + +The build script defaults to building for Windows. If you want to build for Mac OS X or Linux, choose one of: -====How to use=== -Download the package for your operating system. + ./build.sh osx64 + ./build.sh linux -Windows: - Double click the "skeinforge.bat" for Skeinforge, this can be used to slice your models into GCode. - Double click the "Printrun.bat" for "PrintRun" this is a graphical command&control interface for your printer. This can run the generated GCode. +Note that Mac OS X currently requires the manual installation of wxPython, PySerial, and PyOpenGL: -Linux/MacOSX: (experimental, no packaged python) - First you'll need to have python installed on your system! With pyserial when you want to use PrintRun. You do not need pypy, this is packaged with SkeinPyPy - Then run SkeinPyPy/skeinforge_application/skeinforge.py for skeinforge to slice your model - Or run printrun\\pronterface.py for the PrintRun interface to print your model + sudo easy_install-2.7 pyserial + sudo easy_install-2.7 PyOpenGL -====What is changed==== -* Do not show settings when ran from command line -* Run PyPy to slice a model instead of normal python -* Changing "Perimeter width over thickness (ratio)" into "Perimeter width". - With 5D machines this makes more sense, as you have good control over the width. -* Save settings in .skeinforge_pypy to not mess up normal skeinforge profiles. -* Default settings changed to match Ultimaker with dimension firmware (Marlin or Sprinter) and PLA. -* Modified "Object first layer speed" settings to work on the first 3 layers (configurable) -* Added "Object first layer travel speed" setting, to slow down the travel on the first layers. - Reduces the chance that a travel pulls the first layer lose. +You will need to download the appropriate wxPython Installer package and install it. It is available from: -====Bugs==== -The graphical analize plugins don't work (Skeinlayer and Skeiniso) + http://www.wxpython.org/download.php -====How does it work==== -The user interface still runs in normal python (as PyPy with TK is a bit hard to build, especially for windows), - and when you slice it will run command line PyPy to slice the model. +Specifically, install "wxPython2.9-osx-cocoa-py2.7" as it is the build that supports 64-bit execution. + +======= +RUNNING +======= + +Windows +------- + +Double-click skeinforge.bat and Printrun.bat. + +Mac OS X & Linux +---------------- + +Once built, the two apps -- Pronterface and SkeinPyPy -- must be started from the command line (for now): + + # open a new terminal window and.... + cd osx64-SkeinPyPy-NewUI-Beta4 + ./pronterface.sh & + ./skeinpypy.sh & + +This will start both applications with their console logging output directed into the terminal window. + +======== +FIRMWARE +======== + +For Ultimaker users, it is highly recommended -- nearly required -- that you upgrade your firmware to the latest Marlin builds. See: + + http://wiki.ultimaker.com/Skeinforge_PyPy From 6de282f4b7c2a8d17fe5371d54b6a7825f55a120 Mon Sep 17 00:00:00 2001 From: Bill Bumgarner Date: Mon, 12 Mar 2012 02:26:43 +0800 Subject: [PATCH 10/10] update format --- README | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README b/README index e087e1a9..20f2b209 100644 --- a/README +++ b/README @@ -11,11 +11,7 @@ SkeinPyPy: A easy to use program for slicing STL files using SkeinForge. SkeinPyPy can also visualize the 3D models in a variety of ways. - On first run, SkeinPyPy will ask to go through a set of calibration steps that will perform a series of operations on your 3D printer. - One of those steps involves extruding a bit of filament where the filament is initially nearly fully extracted. As such, it you will - probably need to run Pronterface first, heat up the extruder enough to be able to extract the filament and then use the Pronterface - interface to reverse the extruder motor until the filament is at the right position (specifically, until the filament end is even with - where the Bowden tube leaves the extuder motor assembly, on an Ultimaker). + On first run, SkeinPyPy will ask to go through a set of calibration steps that will perform a series of operations on your 3D printer. One of those steps involves extruding a bit of filament where the filament is initially nearly fully extracted. As such, it you will probably need to run Pronterface first, heat up the extruder enough to be able to extract the filament and then use the Pronterface interface to reverse the extruder motor until the filament is at the right position (specifically, until the filament end is even with where the Bowden tube leaves the extuder motor assembly, on an Ultimaker). ======== BUILDING