Jump to content

Skeinforge_PyPy for windows!


Daid

Recommended Posts

Posted · Skeinforge_PyPy for windows!

I've created a skeinforge version, based on SF41 which runs on windows, but 4x faster. And ready for the ultimaker with Marlin or Sprinter without many configuration changes. It should need only a little configuration (all the defaults have been updated). It's also packaged with everything you need (Python and PyPy) so it's ready to run.

You can download it at:

https://github.com/daid/SkeinPyPy/downloads

The github page also contains the patch I applied on Skeinforge, and the scripts needed to rebuild the same package.

You should be able to:

 

  • [*:dbl7ku2b]Download Skeinforge_pypy.zip
    [*:dbl7ku2b]Extract the zip.
    [*:dbl7ku2b]Run SF41.bat
    [*:dbl7ku2b]Change the Filament Diameter (but the default should work pretty ok)
    [*:dbl7ku2b][optional if using PLA]Change the Filament Packing Density to 1.0 (default is set for ABS)
    [*:dbl7ku2b]Setup start.gcode and end.gcode in .skeinforge_pypy/alterations/
    [*:dbl7ku2b]Press the [skeinforge a file...] button to select an STL file.
    [*:dbl7ku2b]Print the resulting GCode

 

List of changes:

 

  • [*:dbl7ku2b]All settings are saved in .skeinforge_pypy, so it won't mess up your normal profiles.
    [*:dbl7ku2b]Uses PyPy instead of Python to do the actual slicing. Which is a lot faster.
    [*:dbl7ku2b]Updated all defaults to make sense for an Ultimaker with Marlin/Sprinter
    [*:dbl7ku2b]Contains the dimension fix needed against stutter.
    [*:dbl7ku2b]Contains the slice speedup fix found in SF43
    [*:dbl7ku2b]"Width over thickness" has been changed into "Width" with 5D firmware this makes more sense. And won't require you to change any other settings if you change the layer thickness.

 

ToDo:

 

  • [*:dbl7ku2b]Skeinlayer and Skeiniso don't work.
    [*:dbl7ku2b]A good start.gcode and end.gcode are not included yet.
    [*:dbl7ku2b]Other versions then SF41 (which versions should I do?)

 

I hope this helps some people with the very long taking Skeinforge slices. I've been using this setup for a few days now, and it works great for me. So far I've measured a 4x speed increase (compared to stock python). With the only problem being that Skeinlayer no longer works.

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!

    great idea... I attempted something similar, but failed miserably.

    I'd suggest you compile SF45 (or 46 when it comes out), and upload it to the UM wiki. it would be even nicer if you could create a pypy SF45 mac executable for download

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!
    I'd suggest you compile SF45 (or 46 when it comes out), and upload it to the UM wiki.
    I picked SF41 because that what I'm using right now. But I planned to do multiple versions. (just want to know this works first)

     

    it would be even nicer if you could create a pypy SF45 mac executable for download
    I don't own a Mac. And from experience I know that you better not try to make anything for a Mac without testing it on a Mac. Also, this SF is not compiled, it's just the scripts packaged with portable versions of python and pypy.

    But if you have python installed on your Mac. You could download the zip package for windows. Extract it, then remove the /python/ and /pypy-1.7/ directories. Get pypy for from

    http://pypy.org/download.html

    and extract it to the same location. (should create a pypy-1.7 directory again). Change line 580 in target/SF41/skeinforge_application/skeinforge.py: (the /bin/ is not needed for the windows version)

     

    pypyExe = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../pypy-1.7/bin/pypy"));

     

    And then run skeinforge with:

     

    python SF41/skeinforge_application/skeinforge.py

     

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!

    The batch file uses forward slashes "/" instead of the Microsoft sanctified backslash "\"

    SF41.BAT exits with a "python: can't open file '/python.exe': [Errno 2] No such file or directory"

    Since (on my XP system) it sees that first python/python.exe as:

    python /python.exe

    python (installed in my path) complains that it can't find the file /python.exe.

    change to \ and it seems to work fine.

    -b

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!

    Spoke too soon.

    It also doesn't like directory names with spaces in them.

    Went to skein a file and it complained about where I had the SF41_pypy sitting. I had to move the sf41_pypy folder to the root, and then it didn't like the space in the filename were the STL file was sitting.

    Moved the STL to the SF41_PYPY folder and it complained that :

    Traceback (most recent call last):

    File "app_main.py", line 51, in run_toplevel

    IOError: [Errno 22] Invalid argument: "'C:/SF41_pypy/Tie_Advanced_X1_Back.STL'"

    And I've no idea why it doesn't like that.

    -b

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!

    Ah, yes. Guess I know what's going wrong there. I forgot to push some changes to git, and those failed to make it in the alpha.

    I'm using "os.system" but it's much better to use "subprocess.call" which handles parameters better (solving the spaces and file not found problem)

    If you want to fix it, the problem is in SF41/skeinforce_application/skeinforge.py

    Replace:

     

    os.system(pypyExe + " '" + fileName + "'")

     

    with

     

    subprocess.call([pypyExe, fileName])

     

    And add an "import subprocess" at the imports somewhere at the top.

    I've also adapted the changes to SF45 (so both SF41 and SF45 will be packaged in the next version). Added a patch to let the first layer slowdown work for the first 3 (configurable) layers, speeding up each layer. Adding some preliminary support for Linux&MacOS. Added "Tiny GCode" export option, which saves a bit more GCode space while sacrificing compability (still works fine on Ultimaker firmware) And I'm working on adding Printrun as GUI to print (and to run SF from). And adding a firmware update feature in Printrun. So you'll have a complete package.

    I've removed the ALPHA1 download, as it's clearly broken. I'll see if I can package a new one tomorrow (disadvantage of forgetting to push your changes into git)

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!

    I'm glad to see this get made, I tried to get PyPy working on my system (for use with SF) and had no luck.

    I made the couple of changes but then it complained about the syntax of my ASCII STL, so I made a binary

    one and it complains that there is an unknown character. I know the Bin one works on the regular SF so I'll

    just wait for the updated version.

    Thanks for doing this, it might get be back using SF again. :-)

    -b

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!

    Slice time in Python for Roy.stl with SF41: 4:47

    Slice time in PyPy for Roy.stl with SF41: 1:55

    Slice time in PyPy for Roy.stl with SF45: 1:20

    At least twice at fast for this file.

    It will get better if you slice larger files. (and can get worse if you slice really small files, I've seen Python taking 15 seconds and PyPy 20 seconds)

    But best of all, I made a working package this time! (took extra time to verify it)

    https://github.com/daid/Skeinforge_PyPy/downloads

    It also contains printrun. So, you don't even need to download the RepG from Ultimaker with this package. If you have the USB driver installed, and the firmware updated (2 things I should add I guess)

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!
    Slice time in Python for Roy.stl with SF41: 4:47

    Slice time in PyPy for Roy.stl with SF41: 1:55

    Slice time in PyPy for Roy.stl with SF45: 1:20

    At least twice at fast for this file.

    It will get better if you slice larger files. (and can get worse if you slice really small files, I've seen Python taking 15 seconds and PyPy 20 seconds)

    But best of all, I made a working package this time! (took extra time to verify it)

    https://github.com/daid/Skeinforge_PyPy/downloads

    It also contains printrun. So, you don't even need to download the RepG from Ultimaker with this package. If you have the USB driver installed, and the firmware updated (2 things I should add I guess)

    can you please add 2 pieces of information to the readme:

    - where and how to run the .sh files and which order should the 2 of them run (I assume first the build, and then the build patches)

    - how and what to launch after successful install to do actual slicing

    (forgive me if this sounds stupid, but i am a mac user, and I would run a .sh in terminal, but i don't know if windows has such a thing)

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!
    can you please add 2 pieces of information to the readme:

    - where and how to run the .sh files and which order should the 2 of them run (I assume first the build, and then the build patches)

    - how and what to launch after successful install to do actual slicing

    (forgive me if this sounds stupid, but i am a mac user, and I would run a .sh in terminal, but i don't know if windows has such a thing)

    Doesn't sound stupid.

    Just a few pieces of information:

     

    • [*:29ocv47f]build.sh builds the package for Windows.

      [*:29ocv47f]build_patches.sh generates the patches/XX files from the target/SFXX skeinforge files (so it does the reverse of build.sh)

      [*:29ocv47f]Both scripts are run from linux.

      [*:29ocv47f]The package is for Windows. Yes I build a Windows package in linux (I'm kinda crazy). If you want to run for MAC you're on your own right now. The patches work, but you'll have to add python and pypy yourself.

     

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!
    Just a few pieces of information:

     

    • [*:26197q3z]build.sh builds the package for Windows.

      [*:26197q3z]build_patches.sh generates the patches/XX files from the target/SFXX skeinforge files (so it does the reverse of build.sh)

      [*:26197q3z]Both scripts are run from linux.

      [*:26197q3z]The package is for Windows. Yes I build a Windows package in linux (I'm kinda crazy). If you want to run for MAC you're on your own right now. The patches work, but you'll have to add python and pypy yourself.

     

    I did try to get your pypy thing working under win7 (running via parallels on my mac), but if you say that I need also some linux install (which isn't mentioned anywhere in your instructions), then I have to say that some potential users will throw their arms into the air and give up.

    I really appreciate your work, but it would be really nice if you could dial the inherent geekyness down by about 2-3 notches, and present it in a way stupid people like me could replicate your steps, which may include steps like not doing a shell script (which I understand windows can't run natively, needs some other app to do that), but a windows bat file. and also, how do I launch this new SF then?

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!

    But to use it you don't need a linux install. Only to generate a new version you would need linux (or cygwin might work).

    The release, downloadable at:

    https://github.com/daid/Skeinforge_PyPy/downloads

    is ready to run. Extract it and run one of the batch files and you're off. No shell scripts, no other installs, just the zip and you're good to go.

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!
    The release, downloadable at:

    https://github.com/daid/Skeinforge_PyPy/downloads

    is ready to run. Extract it and run one of the batch files and you're off. No shell scripts, no other installs, just the zip and you're good to go.

    I apologize, it must have been some mistake on my end, since the archive I had downloaded had only 6 files, but the one you have posted above has all the files necessary: download, unzip, open, slice, done.

    Related, can you remove the . for the folder name where the actual profiles are saved (user folder)... I hate the fact that it is hidden.

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!

    SF51? I've been asleep at the wheel again... Weren't we just on 44? :)

    -b

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!
    SF51? I've been asleep at the wheel again... Weren't we just on 44? :)

    -b

    You must be dreaming then, because SF45 is the latest. (and in my version you get SF41 and SF45)

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!

    So there is still some quirk with sf41, it complains about an ASCII STL. I thought SF always supported ASCII STLs am I wrong? Anyway I don't really use 41 so I then looked at sf45.

    The speed difference is shocking to say the least. I copied the default settings from pypySF into a clean .skeinforge folder trying to get the same output from both but still something came out wrong. Anyway:

    I used the Tie Advanced front from thingiverse.

    SF45 - 2 hours 55 minutes 1 second

    pypy SF45 - 7 minutes 20 seconds

    For some reason, the pypy code is only 5 meg while the standard sf45 is 19 meg.

    Also pypysf45 barfed a few times that stand SF45 didn't. A few "this should never happen"

    Looking at the gcode in printrun they look similar, the first layer is different and printrun

    slows down to a crawl trying to view the standard SF45 code. So something very different

    apparently. Interestingly the time estimate is about 2 hours longer on the pypy gcode.

    Which I think is weird.

    I can post the errors but it would probably be best if you ran it yourself.

    Great work though, very promising.

    I'm interested is this speedup just from pypy or have you made some low level changes to how

    SF runs? If it is mostly pypy then do the Python coders know their stuff is crappy slow? :)

    -b

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!

    I don't know why it would complain about ascii stl files. OpenSCAD generates ascii STL files by default and I've sliced those... but... yes, SF41 is bugged... (*#%@#$@ myself)

    I wouldn't recommend copying over your settings. I changed the "width over thickness (ratio)" into a "line thickness" (so you no longer need to change the ratio when you change layer thickness). This might cause problems if you copy profiles over. Other then that the code is the same.

    2 hours to 7 minutes... now that's a speedup! I haven't changed any real code things in SF45. I only start it with PyPy, modified the line width, and added the slowdown on the first 3 layers patch.

    PyPy is so much faster because it has a JustInTime compiler. It's quite technical, and a real challenge to get working reliably. So it's no wonder that normal Python doesn't go that route. Also, it gives a higher "startup" cost in time. But with the number crunching that skeinforge is doing you don't notice this.

    And I get this error with the Tie Advance:

     

    This should never happen, there is a hole in the triangle mesh, each edge should

    have two faces.

    270530 [180121] [5964, 90357]

    Something will still be printed, but there is no guarantee that it will be the c

    orrect shape.

    Which happens when an object is not fully manifold. Maybe you had the "meshtype" set to unproven in the other version. That has a chance to remove the error. But if the resulting GCode looks ok then there is no real issue.

    I also see a

    This should never happen, deltaX in addSegmentToPixelTable in euclidean is 0.
    I'll have a look into those. But there are only a few errors in lots of layers, so I guess it will print fine.

    To compare the code to official SF45, make sure you have the settings the same. A raft could add a lot of gcode for example, and my SF has a lot of things disabled by default, where they are enabled on official SF. My export from SF45_pypy is also 5MB.

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!

    From "Download's for daid's Skeinforge_PyPy - Github"

     

    Skeinforge_PyPy_Alpha2.zip — Contains python, pypy, SF41, SF51 and Printrun. All ready to run. Everything you need!

     

    I'm not the one dreaming. :D

    So settings are incompatible between pypy_SF45 and regular SF45. That's a mild annoyance but only in that it makes comparing them a little harder.

    Yeah there is like one hole. (reg SF45 complains about that hole as well) The "euclidean is 0" errors are the ones unique to pypy SF45. I got 6 during Fill.

    I need to go ever the settings to figure out why there was such a discrepency in the gcode filesizes. They sliced the same # of layers. but the pypy version was 1/4 the size of the regular and yet the (highly in accurate) time estimate from printrun said the much large gcode file would complete 2 hours sooner.

    Obviously different.

    I suppose the proof is in the print. I'll print them both and see what's what.

    But seriously good work. SF wasn't useful as I'm printing big stuff and taking hours to slice is just crazy. This let's me go back to some of the nice features SF has that Netfabb hasn't thought about adding. (*Ahem* Cool,Comb,Fill %,Fill Pattern...)

    -b

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!

    I've uploaded alpha3

    https://github.com/daid/SkeinPyPy/downloads

    Which solves the problem with SF41. Add SF46. And has defaults that work with the latest Marlin version.

    I've also started work on a firmware update option inside Printrun, however that's not done yet.

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!

    I've updated my Skeinforge_PyPy to Alpha4. From now on it's called

    SkeinPyPy.

    The download URL has been changed to:

    https://github.com/daid/SkeinPyPy/downloads

    (I figured I better rename this now, when the URL is even more common this will be even harder)

    The major feature is an Linux and MacOS build for this release. I could not test the MacOS build. And both require python installed on the system. You manually need to start the right python file, as I don't know how to make shortcuts for MacOS, and I didn't add a proper shellscript for Linux.

    This version is also build with PyPy-1.8 instead of PyPy-1.7, which might give a bit of extra speed in the slicer.

    Changes are:

    * Added experimental Linux and MacOS builds (requires python+pyserial on your system)

    * Updated to only include Skeinforge 48 (latest as of today)

    * Updated default settings to REALLY have the temperature plugin off.

    * Defaults are now for PLA. Removed all other profile names, to avoid confusion (new defaults might not be visible if you used Alpha3)

    * PrintRun now has a "Set Speed" feature, which mimics the direct speed control from RepG.

    * Fixed print estimate in PrintRun.

    Plans for Beta1:

    * Make sure Linux/MacOS works (let me know please!)

    * [Maybe] add better shortcuts to run it, instead of batch files.

    * Add firmware update in PrintRun

    * Add "no infill top" feature and "Joris" plugin for vases.

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!

    Having some trouble using the package (Alpha4 for Win). Very likely something simple I am missing. I believe I have all the software installed per the instructions. Here's whats happening

    I run printrun.bat

    Printer interface opens. If I click connect and I have manual controls of the machine.

    Click Skeinpypy and select a *.stl file

    bottom of window says "slicing"

    Seems to sit there forever

    Something similar when I open SF on its own. If I SKienforge a file directly form SF, it never indicates its working progress or completion. Where are the gcodes supposed to be writen?

    Thanks

    Matt

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!

    OK, so I went back to Skeinpypy Alpha3. Now I get a message in the dialogue box "You do not have Tkinter, which is needed for..." and a windows error "pypy has encountered a problem and..."

    That being said, I just installed Tkinter form here:

    http://sourceforge.net/projects/visualt ... p/download

    .

    I am guessing that is the same problem for me with SkeinforgepypyAlpha3 and alpha4. Tkinter is not recognized for some reason or I have the wrong program or ver.

    Matt

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!

    You can ignore the TK message. It reports that TK is missing during the PyPy slicing, but that's normal (I should have removed the message).

    The real problem is that PyPy crashes. Which version of Windows are you using? And how old is the computer? Because PyPy need SSE2 instructions.

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!

    I'm using a laptop w/ xp. Computer is about 6 years young. It'll be a bummer if that precludes using your software package, but I'll be forced to understand. Is there hope?

    Matt

  • Link to post
    Share on other sites

    Posted · Skeinforge_PyPy for windows!

    6 years. SSE2 was introduced in 2001 with the Pentium 4.

    CPUs without SSE2 are:

     

    • [*:2wz8cbn9]AMD CPUs prior to Athlon 64, including all Socket A-based CPUs
      [*:2wz8cbn9]Intel CPUs prior to Pentium 4
      [*:2wz8cbn9]VIA C3

     

    From that list, only the C3 is the only thing I still have (in a box somewhere). So it might not be an SSE2 problem.

    I'm also running winXP myself. So don't think that's causing it. Maybe it's an out of memory problem? I got 4GB of ram in my machine. And skeinforge can use up a lot of memory.

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • UltiMaker Cura 5.7 stable released
        Cura 5.7 is here and it brings a handy new workflow improvement when using Thingiverse and Cura together, as well as additional capabilities for Method series printers, and a powerful way of sharing print settings using new printer-agnostic project files! Read on to find out about all of these improvements and more. 
         
          • Like
        • 18 replies
      • S-Line Firmware 8.3.0 was released Nov. 20th on the "Latest" firmware branch.
        (Sorry, was out of office when this released)

        This update is for...
        All UltiMaker S series  
        New features
         
        Temperature status. During print preparation, the temperatures of the print cores and build plate will be shown on the display. This gives a better indication of the progress and remaining wait time. Save log files in paused state. It is now possible to save the printer's log files to USB if the currently active print job is paused. Previously, the Dump logs to USB option was only enabled if the printer was in idle state. Confirm print removal via Digital Factory. If the printer is connected to the Digital Factory, it is now possible to confirm the removal of a previous print job via the Digital Factory interface. This is useful in situations where the build plate is clear, but the operator forgot to select Confirm removal on the printer’s display. Visit this page for more information about this feature.
          • Like
        • 0 replies
    ×
    ×
    • Create New...