Software

Pleasant Future

Posted in Experimental, Software on March 1st, 2010 by Zaggo – 13 Comments

As mentioned earlier, Pleasant3D is a spin-off from another, larger project.

Today, I release Pleasant3D v2.0 to the public and when reading the list of changes, most people might ask why there’s such a big step in the version number:

What’s new in Pleasant3D v2.0:

  • More intuitive (trackball) view rotation
  • Panning views with right mouse button drags

Well, as you might have guessed already, that’s not all. The main change is that I finally merged the former other, larger project and Pleasant3D to … well, Pleasant3D v2.0. So the missing point in the above list is:

  • Initial release of “the real Pleasant3D”

Foreplay

Back in June 2009, after I ordered my MakerBot Deluxe Kit, I was in state of anticipation and impatience, most of you other MakerBot operators probably know from own experience: The order’s finally placed, but it takes 4 to 6 weeks until the kit eventually ships.

I read all reports on building and operating a MakerBot in the internet (there wasn’t that much blogs on this back then) and of course, I downloaded ReplicatorG and Skeinforge to play around with them.

As a (very) long time and hardcore Mac user and developer, I quickly thought about a nicer, cleaner and faster way to produce GCode and eventually print objects than ReplicatorG and Skeinforge.

Don’t get me wrong: I think Skeinforge is a really amazing piece of software, it’s ability to process “incorrect” 3D objects and the GCode it creates is just great. I also think that MakerBot Industrie’s decision to provide cross platform support on the software side with ReplicatorG as printing software and Skeinforge as GCode generator is absolutely great and important (I’m still struggling with my Mendel because the native Reprap software currently doesn’t really support Macs).

But I also think, that it would be nice to have an alternative – not that universal, but maybe better – way to handle 3D processing for printing stuff.

That’s why I started to develop Pleasant3D, to play around with something during waiting for the MakerBot Kit to arrive.

My plan was to create a tool to not only provide a native way to preview STL and GCode files, but also to transform STL files to GCode.

I didn’t (and don’t) want to provide another cross platform tool for those tasks, struggling with GUI and performance tradeoffs caused by the need of portable code. I explicitly decided to develop a high performance, native GUI tool for the system I’m working on (which is obviously Mac OS X, sorry Windows and Linux users), using all cutting edge technologies available in the most recent OS (which is Mac OS X 10.6, sorry PPC and Leopard users).

Failure

My first approach was, to port Skeinforge’s open source Python code to native Objective-C code. I started with Skeinforge’s Carve tool and it was a disaster. Not only it was kind of uncreative and boring to port existing code to another programming language, but the resulting code was also even slower than the original code.

The reason for that is, that each programming language has it’s pros and cons. One of Python’s pros is, that it’s very fast in creating objects. Unfortunately, creating objects in Objective-C (like C++ also based on C) isn’t its fastest feature. So by porting the Carve code 1:1 to Objective-C, the code still used the original algorithms, based on the creation of zillions of objects during carving a 3D object. Not a good idea in ObjC.

The Carve tool is the first step in processing a 3D object for 3D printing. It slices the object horizontally. For comparison I used a nice object from Thingiverse: Eggcup With Salt & Shell Trays

Carving this STL file (containing 5486 triangles) takes about 9 seconds in Skeinforge (0.4mm layer thickness, 2.8GHz Intel Core 2 Duo MacBook Pro):


When carving the same file with my first version of the ported Carve tool, it took more than 12 seconds with the native code!

So I started to optimize the ported code, implemented caching collection classes, reusing memory and objects whenever possible and so on.

I finally got a version of the native Carve tool, running faster than the Python script:

Speeding up the carving process by factor 2.3 doesn’t sound too bad, but I couldn’t believe that this would be the best possible result. Especially since the porting process was really boring!

So I threw away the whole thing and started from scratch again. This time by creating my own, new algorithms and pulling all the stops Snow Leopard provides: GCD & OpenCL.

Success

I called the new tool “Slice”. Changing to a new algorithm and OpenCL really paid off. But see for yourself:

That’s more like it: 39ms, 230x the speed of Skeinforge…

Present and future

Please don’t throw away Skeinforge yet! Pleasant3D is at a very, very early stage. It’s fragile. It needs clean STL files with normals. And there’s not a complete set of tools yet. The whole thing still needs a lot work.

Pleasant3D v2.0 is still the same tool we love and know for viewing STL and GCode files (including moving/rotating/resizing STL objects). It also contains the same QuickLook plugins for STL and GCode. All these features are more or less stable.

In addition to that, there’s a new kind of document: The P3D document

Pleasant3D.png

You create a tool chain by dragging & dropping available tools from the toolbox panel to the tool bin. Each tool gets its input from the previous tool’s output. If you change settings in a tool at the begin of the tool chain, the results of these changes automatically “ripple” through the whole tool chain. With the current speed of the few available tools, this happens almost instantly.

Here’s a teaser video of the whole thing:

The deal

The Slice&Dice part of Pleasant3D isn’t ready for prime time yet! It’s work in progress.

I decided to publish it anyway, since I’d appreciate any help with the tools and printer drivers.

So here’s the deal:

Pleasant3D is a free download (as usual). The GUI part of the project is still kind of semi-closed source (more on this some other time).

However, all tools are implemented as plugins. So are the printer drivers. And they will be will be open source. I’m currently working on a way to publish the sources. Very likely they’ll be available through public access to a Mercurial repository.

You can start developing tools right away. All you need is a copy of Pleasant3D v2.0 (or later), a working installation of Xcode v3.2.1 (or later) and the following shell script:

InstallDevSupport.zip

Copy Pleasant3D to your /Applications folder (no subfolders!). Then run the InstallDevSupport script:

  • Open a Terminal window
  • Go to the folder containing the InstallDevSupport script (cd <path to InstallDevSupport.sh>)
  • Run the script (sh InstallDevSupport.sh)
  • Enter your admin password

Re-launch Xcode after that. When you now create a new project in Xcode, there should be a Pleasant3D project template available. Use this template to create a new Pleasant3D tool project. Please read the ReadMe.txt file inside the new project folder for important additional information.

In addition to the sources of the current tools, I’ll try to provide some additional sample code as soon as possible.

You can download Pleasant3D v2.0 from the Pleasant3D download page.

That’s it for now. Stay tuned for more shortly.

Pleasant3D, again…

Posted in Software on January 11th, 2010 by Zaggo – 1 Comment

Ok, this is earlier than expected: Pleasant3D v1.2 is out.

The quick update was necessary due to a nasty bug in v1.1 which caused wrong positioning of STL objects in some cases. This issue is fixed in v1.2. I also smoothed out some remaining problems with the 64-bit build. So if your computer supports 64-bit applications, Pleasant3D v1.2 will be one of them…

Finally I added automatic update checking (thanks to the Sparkle framework). From now on, when I  screw up a version (as I did with v1.1), you won’t need to manually download a new versions a few days later. The automatic update window will pop up and offer an easy one-click update. :)

However, if you’re still on v1.0 or v1.1, you definitely want download Pleasant3D v1.2 manually.

Pleasant3D v1.1 released

Posted in Movie, Software on January 9th, 2010 by Zaggo – 13 Comments

Pleasant3DQL.png

I’m happy to announce the release of Pleasant3D v1.1.

There are some awesome new features in the new version:

  • Pleasant3D now includes QuickLook plugins for STL and GCode files!
  • The preview views are now zoomable.
  • Objects can now be rotated by arbitrary angles.
  • … and many more.

Check out Pleasant3D’s brand new home page for a full feature list.

I recorded a short movie, showing off the new features of Pleasant3D v1.1:

Thanks’s to all of you, sending me feedback!

Pleasant3D v1.1 is available for free download here: http://www.pleasantsoftware.com/developer/pleasant3d

Raftless

Posted in Experimental, Movie, Software on December 5th, 2009 by Zaggo – 10 Comments

layer 1 As reported previously, printing on a heated build surface not only permits (almost) warp-free printing, but also eliminates the need for rafts for simple shaped objects (simple as in rectangular footprint).

As soon as the base shape of an object becomes more complex, things go likely wrong: Most of the time, the more complex perimeter lines don’t stick and ripped off the build surface by the passing nozzle.

To solve this problem, I played around with several parameters of the gcode files, like feed rate and flow rate.

It turns out that, if extruded “slow enough”, also complex shapes are easily printable without a raft.

IMG_4709 After testing this for a while by post-processing gcode files manually (i.e. editing the gcode files in a text editor), I started to write a new tool for the skeinforge tool chain.

By integrating a ‘Raftless’ tool into skeinforge, I not only save a lot of time (it’s rather time consuming to edit gcode files each time before printing), but I’ve also much more (and easy!) control over what to slow down. Although it’s possible to change each single line of gcode in a text editor, it’s quite a challenge to navigate through thousands of ‘G1 X Y Z F’ lines without getting lost or insane.

Anyway, I just finished a new tool for the skeinforge tool chain:

“Raftless”

Raftless is a script to prepare a gcode file for raftless printing.

Raftless settings

The default ‘Activate Raftless’ checkbox is off, since the mutual exclusive ‘Raft’ script is activated by default. In order to use the Raftless script, you want to desactivate the Raft script first. If both scripts, Raft and Raftless, are activated, the Raftless script (which runs after the Raft script) automatically detects the already created raft. In this case, the Raftless script is skipped and a warning message is printed to the console.

The “1st Perimeter Feed Rate over Feed Rate” preference defines the feed rate during the extrusion of the 1st layer’s perimeter lines. The preference is a ratio of the normal extrusion feed rate as configured in the ‘Speed’ script. The default value is .5, which means half the normal feed rate.

The “1st Perimeter Flow Rate over Flow Rate” preference is the ratio of the filament feedrate during the extrusion of the 1st layer’s perimeter lines. Since the feed rate is slower than normal, you might want to reduce also the flow rate in this case. This preference is a ratio of the normal flow rate (as configured in the ‘Speed’ script). The default is 1. (same flow rate as normal).

If “Add Extrusion Intro” is on, an additional straight extrusion line is added to the start of the first perimeter. This line starts at the coordinates ‘Extrusion Intro Max X Absolute’/'Extrusion Intro Max Y Absolute’. These both values are absolute (positive) values. The script automatically negates one or both of these values, according to the location of the first regular extrusion.

Please note, that Add Extrusion Intro doesn’t check for collisions with the perimeter lines. If necessary, you want to change the max X/Y values manually.

Here’s a video of printing an object without a raft (yes, the gcode file was created with the Raftless tool…):

If you’re interested in raft-less printing, you should definitely give the ‘Raftless’ tool a try.

Download the Raftless Python source

I wrote the Raftless script based on the most recent version of skeinforge (“created at 2009-11-06″) as included in the not-released-yet newest Replicator G version. In the meantime, you can download this version of skeinforge from the public Makerbot GITHub repository. Please note, that all unreleased software in this repository is per definition ”beta”. So: no guarantees.

In order to install the Raftless script within the skeinforge tool chain, copy raftless.py in the skeinforge_tool/craft_plugins folder. Then edit  skeinforge_tool/profile_plugins/extrusion.py and add the Raftless script to the tool chain sequence by inserting ‘raftless’ into the tool sequence  in getCraftSequence(). The best place is at the end of the sequence, right before ‘export’.

Any feedback is highly appreciated!

IMG_4706

More LCD testing

Posted in Experimental, Hardware, MakerBot enhancements, Software on November 27th, 2009 by Zaggo – Be the first to comment

I did some real world testing (i.e. print some objects with the modified firmware) with the I2C-LC-Display setup on my MakerBot.

Here’s another short movie of the display in action:

I cleaned up my modifications in the extruder controller firmware and pushed my changes to a branch on the makerbot/G3Firmware github repository. You find the modifications in the “zaggoLCD” branch.

Next up: Trying an alternative solution with the LCD connected to the motherboard’s I2C bus…

Pleasant3D

Posted in MakerBot enhancements, Movie, Software on October 19th, 2009 by Zaggo – 14 Comments

IconVery often I had the problem, that downloaded STL files needed some minor editing in order to be printable on my MakerBot. Most of the time it was just a simple move to the center of the build platform or a resize.

In addition to that, I already wrote OpenGL code to visualize STL and GCode files a couple of months ago for another larger project.

Finally I had sometimes the problem that I downloaded a ASCII encoded STL file and wanted to open the file in my 3D/CAD application. Since this application can only read binary STL files I needed an easy way to convert ASCII STL to binary STL.

So I wrote Pleasant3D, a small utility which solves these problems and uses the above mentioned visualization code to display STL and GCode files:

Pleasant3D

There’s no zooming for now and the size of the “build platform” is fixed to 10×10cm (i.e. MakerBot’s build platform). I wrote the code in a way you’ll can choose different build platforms (e.g. RepRap Darwin, Mendel and so on) for visualization and adjustments in future revisions of the application . Since I only own a MakerBot, any feedback on your needs is appreciated.

You can watch a short screencast of Pleasant3D here:

Please note, that this is v1.0 of Pleasant3D and thus its initial release and first time in the wild. So please be gentle…

Pleasant3D requires Mac OS X 10.6 (Snow Leopard) or newer.

You can download Pleasant3D here for free:
zip