Gradient Generator Tool for U1 Fullspectrum fork

Inspired by a post I saw on the Snapmaker subreddit the other day, I created a webapp you can use to create custom color gradients for use with the fullspectrum Snapmaker Orca fork.

It lets you make smooth gradients using any kind of filament, to get results similar to ones you could get with rainbow filament (but with more control as you can specify the exact start and end colors and speed). You can interpolate between as many colors as you like, and also use color mixes containing multiple filaments as nodes on the gradient.

If anyone would like to test it and give any feedback on how it works with real life prints that would be great, as I don’t have a U1 (only a single color printer).

Here’s the link: https://gradients.garden

Hope this is useful to someone!

EDIT: You can now search for a filament name to import its color directly, courtesy of the colorimetry data from filamentcolors.xyz

6 Likes

Interesting project. I wonder which scenarios could seamlessly make use of this great idea. Anyone who sees this, feel free to share your thoughts.

A very intresting idea.
One question, I can see the TD parameter in the https://filamentcolors.xyz/ database but I don’t see it in https://gradients.garden/ when I check the info about the filament. Is it an hidden parameter imported ?

On the main page you can hover over the small (i) icon next to the filament type to see the TD value, you can also click the info button next to any filament and it should be displayed on the details page, underneath the filament name.

2 Likes

Cool project, adding to the list…

You could use somthing like driver.js to add a “how to use” tour…

2 Likes

I’ve added a feature so you can now see a 3d preview of the gradient, either with basic shapes or you can upload a 3mf or other type of 3d model to preview on:

(example model in photo is https://www.thingiverse.com/thing:2013157 by William_Additive / CC BY 4.0)

You can also automatically calculate the layer count for an imported model so that the gradient is the right length, by clicking ‘Set output to fit model height’ (assuming you’ve set the layer height you’re using in the Output Code panel).

@nweolu Thanks, I haven’t used driver.js before but I’ll look into it

3 Likes

Update:

I saw a post by u/spoonchild on reddit where their model came out with different colors on each side due to a misaligned toolhead, and they suggested the idea of doing it on purpose to recreate this effect.

Based on that idea I added a function where you can upload an already sliced G-code file and intentionally add a small offset to each toolhead to recreate this effect (while excluding the prime tower from being affected).

This is using just two colors of filament:

You could theoretically even add more colors at different offset angles, to create a 3 color gradient for example, though the effect might not look as strong.

This has not been tested with a physical printer and using it is completely at your own risk. But if you don’t mind being a guinea pig feel free to try it out.

It’s on the main page if you scroll down, but here’s a link which will scroll to this tool directly: Gradients Garden

I do think this feature seems more suited to being implemented in the slicer directly (it could even have an option to hide layer seams on the opposite color side, for example), but I didn’t feel like digging around in the slicer code since I’m not familiar with it. So I made this for anyone who’d like to play around with the idea until there is a native slicer version.

P.S. this was the post by u/zklein12345 I mentioned in the OP, who came up with the idea which inspired the creation of this gradient tool (I was going to to edit it in but I don’t seem to be able to anymore, from googling I think I need to be a higher trust level to edit after 24h)

1 Like

Recently I thought of an idea which I’ve been playing around with, which is to vary the offset of each toolhead depending on the Z height in the print, in order to create two-dimensional gradients.

Just thought I’d share a few samples:

(For the three color prints it’s possible the effect may need to be viewed at a slight angle since there will be a larger 2-layer gap between each color)

2 Likes

Thanks to 3D Stisk on YouTube for featuring a brief tour of this tool in their video here today: https://youtu.be/hiJIiIIvzb0?t=592 (it’s in Czech but has auto-translated subtitles for any language).

By the way these are the parameters I used to create the two and three color 2D gradients in my previous post (in case anyone is interested in recreating this effect). You can use any model in theory, just make sure to slice it with a two or three-color filament pattern in FullSpectrum SnOrca (just type a 2/3-digit code including each toolhead index you want to use, i.e. 123 for the first 3 toolheads). In the horizontal gradient creator just enable rotation, adjust the rotation count, and also set the angle offset for each toolhead (if making a three-color gradient).

Also @nweolu I added a driver.js tour on your suggestion, you can start it by clicking the button on the top right side of the page.

2 Likes

Someone sent a message on discord that they had some trouble figuring out how to use the app, so I wrote a short guide, which I’ll repost here.

How to use https://gradients.garden:

If you want to create vertical gradients like these, just use the top sections of the app (not the horizontal gradients / G-code modifier section):

(model in photo is Tucano_brazilian bird by William_Additive on Thingiverse / CC BY 4.0)

The gradient lines are shown harshly in the preview so you can see the results in detail, but when printed at 0.08mm layer height the filaments will blend together, which is the core idea of ratdoux’s full spectrum orcaslicer fork (related: see Wombley’s great videos https://www.youtube.com/watch?v=uE1Su-FUvls and https://www.youtube.com/watch?v=tKfpaVk8jEw for a exploration of what filament types to use and how to get the best layer mixing).

To create these kind of gradients, first you need to set your filament colors at the top of the page. You can either do this by using the color picker, or by clicking the magnifying glass icon on each slot to search for a real filament (data from filamentcolors.xyz). Set all the filaments you are going to be using in the gradient, and make sure they are in the same slot you are loading them in your machine.

After that you can skip past the blend color creator and 3D preview for now, go down to the gradient creator. Here, by default, it will have a smooth gradient between two filaments (the left side will be the base of the object).

You can change the filaments at each point in the gradient, and add extra colors to the gradient to create multi-color transitions (like the 3d preview earlier in this post).

To customize the gradient further you can drag the hollow circular nodes on the gradient display to move the position of each color within the gradient. The handle to the right of each node controls the transition speed between colors, drag the white handle down on the cyan node for example to make the gradient mostly cyan and only reach magenta near the end.

While you’re doing this you can use the 3D preview to see how the gradient will look on a real object. You can upload your own 3d model/3mf file to get a better idea of how the gradient will look when printed.

Then when you’re happy with the gradient you have created, go down to the Gradient Output Code panel (you’ll want to leave the dithering strategy panel set to its default unless you’re experimenting).

Here in the output panel you can set how long the dithered output pattern should be. Either type in the height of your model and the layer height you’re printing with and it will calculate how long the output code should be, or you can click ‘Layer count’ and type it in manually (if you know how many layers your model has from your slicer).

Alternatively if you imported your 3D model/3mf in the 3D preview panel you can click ‘Set output to fit model height’ there, and it will calculate the code output length automatically (assuming you’ve still set the layer height you’re printing with in the output panel).

Next you can click ‘Copy to Clipboard’ and bring this code into ratdoux’s Full Spectrum fork of Orca Slicer. In the ‘Mixed Filaments’ section first click ‘Add Pattern’ to create a pattern filament. Then click on the new pattern filament to expand it, and paste the output code into the ‘Pattern’ field.

Now you can assign the gradient filament to your model the same way you would any other filament. Either paint it on, remap an existing color, or right click an object and click ‘Change Filament’ in the dropdown menu if you want to color the whole object. You can use as many gradients in the same object/print as you like.

There are also some extra options around the UI you can play with to get slightly different results. For example the ‘repeats’ option in the Gradient Creator allows you to loop the gradient pattern multiple times in the same output length (and the ‘flip repeats’ checkbox will mirror each repeated gradient). ‘Reverse’ in the output panel flips the code, you could use that if you wanted to have the same gradient twice in a print but flipped vertically.

=== Advanced/2D gradients: ===

The horizontal gradient creator / G-code modifier is experimental and allows creating left-right gradients and even 2d gradients by offsetting each toolhead by a dynamic amount depending on the Z position in the model. The G-code 3d preview in this panel isn’t as good here due to the way the extrusion is rendered in the browser - it’s better if you export the G-code and preview it in your slicer to see the results more clearly (to see a little better in the browser you can drag the camera angle and zoom in/out until you can see more colors).

To use this you first have to slice a model in ratdoux’s full spectrum orcaslicer fork, by creating a Mixed Filament pattern like above, but instead of using a long code like with vertical gradients just enter the indexes of the filaments you want to use (i.e. 123 for the first 3 filaments you have loaded, or 12 for the first two). Slice the model, then click the arrow next to ‘Print’ and export the G-code instead. Click ‘Load G-code’ in this panel to import your model.

I might write a more detailed explanation of every option in this panel later, but for now a quick overview. If rotation is off, the offset will be fixed in the direction you specify (creating a static horizontal gradient, and no vertical gradient). If rotation is enabled, the offset will rotate the number of times you specify from the base of the model to the top, so 2 will rotate twice and reach the original offset at the top again. This will create a 2d gradient effect, with gradients in both horizontal and vertical directions simultaneously (like in this screenshot).

If you are making a two color gradient you only have to set an offset distance for a single toolhead and can ignore the angle offset, etc. If you want to make a three-color gradient you can copy the parameters from the screenshot above, it just sets each CMY toolhead to be offset at an equal angle from each other (at 0, 120, and 240 degrees from the X axis) and then rotates this gradient 1.5 times over the model height.

You can also use the ‘fade’ option to fade in and out this effect over the height of the model, for example having a gradient that slowly emerges from a solid color at the base of the model.

3 Likes