Is it possible to create multicolored prints using OpenSCAD? If not, is there a workaround to make it easier to achieve multicolor printing with Bambu Studio?
Thanks
Is it possible to create multicolored prints using OpenSCAD? If not, is there a workaround to make it easier to achieve multicolor printing with Bambu Studio?
Thanks
Iâve never used it but Thingiverse seems to have that ability. Maybe Bambu Lab can can do something like is described on this page. MakerBot Customizer
Ideally, it would be great to have tight integration between OpenSCAD and the slicer/print profile.
Right now, I think youâd have to get the user to download each part separately and then assemble them which would probably not turn out well.
What @jetpad suggests about requiring user to download each colored part separately is correct. Iâm doing this on my meeples project Details are in the description.
The user needs to download the separate STL files and import them as âPartsâ on the first STL. Fortunately, the additional STLs import exactly at the correct coordinates. Finally, the user must go into the âObjectsâ view and change the filament color for each âPartâ. Itâs a few steps, but itâs much easier than painting things by hand in the slicer.
Yes, and itâs easy as @jetpad and @JJTechPrints have already said.
I have published just under 400 models with the massive majority having two or more colours. Another 10 models due today, 30+ later this week.
The one things all but two of them have in common is they were created in OpenSCAD.
Be they desk organisers, fidget spinners, coasters, toys or musical instruments, I have created them in OpenSCAD. I am now adding some of my OpenSCAD scripts directly. Two so far, more to follow.
The key is to write your code into modules where you can selectively run them based on colour.
If you think of the OctoWilly & Monster (last two shown), that is actually one OpenSCAD file that creates every one of my (currently) 29 members of the Willies Collection. The code handles everything related to the size, properties, styles, adornments and more. It also keeps the different elements as different modules. I do use the colour method in my code, but, you must remember, this is for convenience whilst designing, it has no effect on exporting.
This way when I go to export the models, I export the base colour module, then each other colour section as necessary. Each one has the same filename with a different suffix for the colour. I do this for convenience for the next step.
Whilst in BS, select all the files that make up the single model and then drag them into BS. It will ask you if you want them to form a single object, yes, you do.
Now jump to the objects panel and expand your new model to see all the parts you provided. I now simply select the correct colour for the model based on the suffix I added.
You now have a multi colour model.
Some examples.
7 colours using a 4 colour AMS. This has some complicated layering to obtain those colour combinations, easy in OpenSCAD.
6 colours using two AMS units
4 colours
2 colours
2 colours
When the individual model files get loaded into BambuStudio, are they all lined up based on the (0,0) OpenSCAD location in each file? Do they still lineup if one is very wide and another is very deep?
Short answer, yes.
Longer answer.
This only occurs when you select all the separate STLs together, drag them into BS and agree they should be merged into a single object.
Sounds complicated, but, it takes seconds.
If you do that, everything is where it should be. If you add them individually or say no to the merge question, they all sit on the build plate and no z-axis coordinates are taken into account. That is the slicer making sure you do not try and print in the air, this is not a problem with either BS or OpenSCAD.
The merged model is simply the identical one you would have created yourself inside BS if you merged two or more objects.
All changes (think colour) can be done easily with the objects panel.
Itâs remarkably easy.
You might want to update that bit as you now know this incredibly easy and turns out perfectly.
Iâm not too worried about getting the multiple colors models lined up myself, itâs more about the average user running the customizer to generate the files and then getting them into Bambu Studio correctly. Based on some of the questions I get about models and printing, I think itâll still be challenging for a lot of people.
@jetpad Hereâs some quick example code for testing out separate stl load positioning:
objx = true;
objy = false;
objz = false;
if (objx) translate([40,0,0]) sphere(20);
if (objy) translate([0,40,0]) sphere(20);
if (objz) translate([0,0,40]) sphere(20);
Using this I was able to save off the three separate STLs. Then I loaded the first one into the slicer and the rest as âpartsâ and the relative positioning turned out fine.
In Parametric model maker:
In Bambu Slicer:
No positional adjustments needed after loading in the slicer.
If you selected all 3 at the same time you only need to answer yes to the merge and it does everything you need.
Omg, thank you @MalcTheOracle! This GREATLY simplifies what users need to do. I will be updating my instructions on future designs. This is wonderful!
Pinging @ypy
Feature request: Bambu would lead the openscad industry if Parametric Model Maker could do the following:
I have discussed this at length in other posts, this is the short version.
They provide the export view which greatly speeds up the rendering processing. I have models that cannot be created within OpenSCAD as they contain far too many elements - it just stops. The MW system takes the identical output and produces it in less than 10 seconds. I have a very fast machine and before my model options max out, the render can take 15 to 20 minutes.
Swapping it to a preview model would introduce the same issue the preview model of OpenSCAD exhibits.
OpenSCAD doesnât do this itself. There are two open projects by third parties attempting to add this ability. Unfortunately, both require changes in the code, and both have limiting factors that mean they are not even close to providing what is needed and certainly not at the scale MW would need.
We have what we have and it is a huge step forward.
You can improve this by doing the following:
module spheres(part = "") {
if (part == "yellow" || part == "all") translate([40,0,0]) sphere(20);
if (part == "white" || part == "all") translate([0,40,0]) sphere(20);
if (part == "red" || part == "all") translate([0,0,40]) sphere(20);
}
spheres("yellow");
This means you export only those things in the required colour. If you add this logic everywhere, it doesnât matter how complicated your model gets, yellow gives you all yellow, red gives you all red and so on. The all option lets you view/export everything in one go.
If you want this in the UIâŚ
/* [Render] */
// Which part do you want to export? ("all" will export everything as a single object ignoring any colour choices)
Part = "all"; // ["all", "yellow", "white", "red"]
/* [hidden] */
module spheres(part = "") {
if (part == "yellow" || part == "all") translate([40,0,0]) sphere(20);
if (part == "white" || part == "all") translate([0,40,0]) sphere(20);
if (part == "red" || part == "all") translate([0,0,40]) sphere(20);
}
spheres(part);
This will let the user (or you) simplify the export option. They (you) choose which colour (or part type if you prefer) to export.
Would you be willing to share one of your large openscad files with me? I also ran into a bottleneck with openscad early on, but it was just a settings issue.
The problem is complexity as I said.
WARNING: Normalized tree is growing past 200000 elements. Aborting normalization.
WARNING: CSG normalization resulted in an empty tree
Even if a setting gets past that, the render time is way beyond 20 minutes.
I think something is wrong with your setup @MalcTheOracle
Using this code I was able to hit the warning message you described
lower_bounds=-100;
upper_bounds=100;
for(i = [1 : 200000]) {
translate([
rands(lower_bounds,upper_bounds,1)[0],
rands(lower_bounds,upper_bounds,1)[0],
rands(lower_bounds,upper_bounds,1)[0]]) cube([1,1,1]);
}
Initial compile time on my laptop takes under 3 seconds, and clicking render also takes under 3 seconds.
Compiling design (CSG Products normalization)...
WARNING: Normalized tree has 200000 elements!
WARNING: OpenCSG rendering has been disabled.
Compile and preview finished.
Total rendering time: 0:00:02.622
Parsing design (AST generation)...
Compiling design (CSG Tree generation)...
Rendering Polygon Mesh using Manifold...
WARNING: GeometryEvaluator: Node didn't fit into cache.
Geometries in cache: 131072
Geometry cache size in bytes: 104857600
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Total rendering time: 0:00:02.931
Top level object is a list of objects:
Objects: 200000
Rendering finished.
Iâm running OpenSCAD version 2024.03.18 (git 5c78196b3) with the following options enabled:
To confirm, I have the latest release and the same settings as you.
It is a lot more complicated than 200,000 cubes.
It still breaks exactly as I said.
BTW, I have played with the turn off rendering at option and increased it to 4 million. (I got here by doubling the original value each time).
I still get the warning.
This time at 8 million (it also doubled each time I tried).
I see. Iâve been able to hit the exact issue youâre talking about with this code:
lower_bounds=-100;
upper_bounds=100;
module complex_object() {
difference() {
sphere(15);
translate([10,0,0]) sphere(12);
translate([-10,0,10]) sphere(11);
translate([0,10,10]) sphere(8);
translate([0,0,-10]) sphere(8);
}
}
for(i = [1 : 200000]) {
translate([
rands(lower_bounds,upper_bounds,1)[0],
rands(lower_bounds,upper_bounds,1)[0],
rands(lower_bounds,upper_bounds,1)[0]])
complex_object();
}
Quite frustrating. I canât get it to render on Makerworld either.
As I said, mine is a bit on the complex side.
Getting back to the colors⌠This should be easy to automate.
Letâs call that parameter Part_Selector (so it probably wonât interfere with a ânormalâ scad file).
If the websiteâs parser sees that specific parameter, instead of rendering the scad file with the specified value, it repeatedly runs the scad file with each of Part_Selectorâs option values (except âallâ), i.e. âyellowâ, âwhiteâ and âredâ in your example, outputting an stl each (e.g. with the value attached to the filename) and then combines all those STLs (with matching actual colors) into one multicolor 3mf.
This requires
That shouldnât be so difficult; I guess I could write a program to do the points 3&4 (in a language of my choice which wouldnât be suitable for a server backend).