Loading

Generate wood patterns with temperature changes

by MoonCactus, published

Generate wood patterns with temperature changes by MoonCactus Feb 11, 2013

Description

Script to generate texture via temperature gradients to get horizontal stripes that "look like wood".

**Update**: this script is also available as a simpler webservice here: tecrd.com/page/liens/stl_wood&lang=fr (it will refuse and fail too big input files though as long as I have to pay for my CPU, sorry).

The owl is Cushwa's popular design at thingiverse.com/thing:18218

It was printed here with LAYWOO-D3 wood filament thingiverse.com/thing:30552
It works also somehow with some other filament (just tweak the temperature), with a less drastic effect.

This is a piece of source code of mine, originally made for Skeinforge within Cura 12.08, now part of the official releases, and is now also an independent standalone Python script.

Recent Comments

view all

Glad it worked fine :) This material is really outstanding for art and good-looking prints compared to regular plastics!

Yea! Tanks a lot! I have already printed with it now but I used a 0.5mm Nozzle and it works just fine and the results are great!

I tried it for a very few parts. It worked for me but many people complains about jams with 0.4 mm already (I never experiences jams with mine though). So be prepared for some annoying cleanup. Also, it is not really worth in my opinion, because the filament really welds to itself smoothly (excellet properties that regular filament do not have), so a bigger nozzle is usually enough imo

Liked By

view all

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag. Print Thing Tag

Instructions

This is the code of my post here: betterprinter.blogspot.fr/2012/10/shades-of-brown-with-wood-filament-via.html


Last updates:
Fri Jan 10 14:32:52 CET 2014
wood31 Fixed obsolete syntax that made Python3 fail (thanks @Mysli)
wood32 is for Python3, should work also on Python2 but untested by me!
Thu Jan 9 23:10:51 CET 2014
Added some more options, and a Windows-friendly zipped version with windows line ends and zipped so that it does not get corrupted when downloaded or opened (this OS sucks so much that you have to pay for it, and you get a notepad as useful as an ashtray on a motorbike, so ridiculous!)

Sun Jul 7 21:43:12 UTC 2013
- web service hosted on tecrd.com/page/liens/stl_wood&lang=fr
Tue Feb 12 08:35:53 UTC 2013
- more readable ASCII art plot
- can be re-run on itself, it will no more duplicate the commands and graph
- fixed a bug in the numeric arguments (thanks to Fused3D)


This script was an official plugin in Cura (version 12.11+). Check it here: wiki.ultimaker.com/CuraPlugin:_Wood Thanks to Daid for porting my old Skeinforge/Cura version to the new and much cleaner plugin system. The tgz archive could be useful only to Skeinforge users or old-timers of Cura. Better ignore it ;)

After multiple requests and at last, I finally converted it to a standalone Python script that no more needs Cura nor Skeinforge. I documented the process here by the way: betterprinter.blogspot.fr/2013/02/how-tun-run-python-cura-plugin-without.html

You'll need Python on your computer. Then run the wood_standalone.py script as follows:

python wood_standalone.py --min minTemp --max maxTemp --grain grainSize --file gcodeFile

or in brief mode:

python wood_standalone.py -i minTemp -a maxTemp -g grainSize -f gcodeFile

This will "patch" your gcode file in place (it will be modified), so keep a backup if you need one.
- minTemp is the minimum temperature to use (the code ensures that it is reached)
- maxTemp is the maximum temperature to use (the code ensures that it is reached)
- grainSize lets you tweak the "average thickness" of the layers
The gcodeFile is the only compulsory parameter.

Initial temperature settings will be overridden by the varying pattern that is generated by this script (a variant of recursive Perlin noise). You can run it multiple times to test different values and generated temperature curve until you like it.

Default values are minTemp=190, maxTemp=240 and grainSize=3. Higher themperature give darker bands (due to the wood being burnt). Do not let the wood stay too long in your nozzle else you will most probably clog it with carbon!

Finally, to run it on windows you may want to check the FAQ here: docs.python.org/2/faq/windows.html

Comments

You must be logged in to post a comment.

Grimgork1349 on Apr 8, 2014 said:

I have a Question in general about Laywood is it possible to print it with a 0.3mm Nozzle ?

MoonCactus on Apr 9, 2014 said:

I tried it for a very few parts. It worked for me but many people complains about jams with 0.4 mm already (I never experiences jams with mine though). So be prepared for some annoying cleanup. Also, it is not really worth in my opinion, because the filament really welds to itself smoothly (excellet properties that regular filament do not have), so a bigger nozzle is usually enough imo

plexus on Jan 11, 2014 said:

Just tried this script on my mac OS10.9. It ran and processed my gcode file but only Z10! the M104 commands were in the gcode but only up to Z10. help? its a Kisslicer gcode file.

MoonCactus on Jan 11, 2014 said:

If it stopped printing at some height, it could be the firmware protection that halts when it sees an increase of +10 degrees C (then use the proper argument).
Now as you say, if the M104 disappear after Z10 from the gcode I have no clue... may be hopping makes it fail (though it should handle it)! Could you upload the gcode file somehwere so I see better?

Mysli on Jan 8, 2014 said:

MoonCactus, awesome idea :D But i cant get this straight... here you link to your site and your site links back here for the standalone python script :S
And the ones i found got me a syntax error in the "print usage" line.

So could you please simplify this in any way, it would be greatly appreciated :D

MoonCactus on Jan 9, 2014 said:

The wod3.py is the latest one, and (probably) the same as my website. Cura holds the latest also as a convenient GUI plugin, My website limits the file size to something barely usable in fact.

Otherwise, in a console, the error message you get about the "usage" probably means that you forgot to specify the arguments or have a bad value. You need to run this script through python in a console... and give it at least one gcode file prefixed with "-f" or "--file".

For example here is how you may run it

python wood3.py --file myobject.gcode

Check the printed indications when you run the script without any parameters for more options!

Hope it helps!

johannesbehr on Oct 24, 2013 said:

Very cool thing, but does anybody know how to use this with a makerbot? How can I edit the x3g file? Or an other way, how can I convert a gcode to x3g?
Thanks in advance!

BenRockhold on Nov 3, 2013 said:

Rather than attempt to modify the exported X3G file, export gcode from MakerWare instead. I can't be sure that this script will work correctly, but it's worth trying.
Once you have exported and modified the gcode, you can use MakerWare to "Print From File" on the gcode.

MoonCactus on Nov 2, 2013 said:

I do not know and I will even not try. Now my license allows anyone to adapt it to a format that was made to lock you on a much advertized closed-source printer... You'll get more detailed explanations on my blog, I hope you will understand: http://www.tridimake.com/2013/...

RealityInc on Oct 11, 2013 said:

Can't seem to get the online version to work. How do I incorporate this into Repetier-Host for Mac/Slic3r?

MoonCactus on Oct 18, 2013 said:

Hi sorry for the late answer. What kind of issue do you have?
Actually you don't have to "incorporate" the script anywhere, but only to run it on the "G-code" file that is produced by your slicers, and before it gets sent to the printer (ie. save the g-code, run the script on it, then load and print the modified g-code file).
Take car the first time in case something goes wrong.

TobiasR on Jul 24, 2013 said:

This would also look nice with sandstone filament!
https://igo3d.com/pla-abs-fila...

MoonCactus on Jul 25, 2013 said:

lol I'm copy/pasting: "Hm sure, but would you send some to me for this free advertising space? ;)"
I'd love to try it indeed, and I have another idea for this filament, but I have so much at home that I don't feel like buying more for now

VoxelFactory on Mar 19, 2013 said:

Wow! Will try it myself and link to your post on website! Thanks a lot!

Alzibiff on Feb 12, 2013 said:

This is top - thank you. Currently printing an Owl in Laywood scaled to 70% of the original size. This is the second Laywood print I have done - for the first, I had to sit next to the printer for a couple of hours tweaking away at the hot end temperature so this standalone script has enabled me to let it get on with things.

MoonCactus on Feb 12, 2013 said:

Glad you like it. One thing that makes it better also is the kind of variations applied to the temperature (these are not pure random).
I also fixed something absent from Cura 12.10+: every temperature found in the file was overridden by the plugin, including the last one. So at the end of the print, the nozzle was left hot, which is bad.
This version tries to keep the last temperature (usually something like M104 S0 = cool down).

Fused3D on Feb 12, 2013 said:

Make sure to take pictures and post. Any ideas what you'll be printing next?

MoonCactus on Feb 12, 2013 said:

Oops! Sorry for this, I fixed it on Tue Feb 12 08:35:53 UTC 2013
You can contact me at jeremie francois at gmail

Fused3D on Feb 12, 2013 said:

It would be cool if you could have the script show the graph before editing, then if you like it have it edit the file, and if you don't then redo the temperature gradients until you do like it

MoonCactus on Feb 12, 2013 said:

Good idea. I implemented this in the last version. I also transposed the graph so it easily be viewed in a text editor: now, simply run again the script to update the file. The previous generated temperatures will be overridden, no need to start again with the original file, much easier to tweak then.

Fused3D on Feb 12, 2013 said:

So if I don't like the wood temperature graph at the beginning of the gcode, I just run it again on the original gcode file I take it?

MoonCactus on Feb 12, 2013 said:

Now you just need to re-run the same command line (up arrow + enter in the console), the old temperatures will be discarded and a new plot is generated. Check it in a text editor, it's easier to view now :)

Fused3D on Feb 11, 2013 said:

Printed out a Bear with the Wood Filament: http://www.thingiverse.com/thi...
Didn't have the python script to run on the gcode before I printed it.

MoonCactus on Feb 11, 2013 said:

Hm sure, but would you send some to me for this free advertising space? ;)

Fused3D on Feb 11, 2013 said:

If you can get a skeinforge plugin made, or standalone plugin made to modify gcode for varying the colors of wood in a print I would happily send you a roll of it.

EricYoung on Feb 11, 2013 said:

Wow, awesome work man. Really, really awesome.

MoonCactus on Feb 11, 2013 said:

That was originally motivated by my laziness, as I quit did not want to insert M104 commands manually throughout an entire g-code file ;)
I'm glad you like it, but the material itself is the awesome stuff: except for chocolate or clay it is the first one that really looks and feel gorgeous and not like cheap plastic. Still a bit expensive and with its own set of "properties" but one major improvement imho.

laird on Feb 11, 2013 said:

SUch a cool idea!

What would it take to run it as a Skeinforge module rather than a Cura module? That way it would be usable by more people. :-)

Fused3D on Feb 11, 2013 said:

Yes please, Skeinforge!!

Top