Design voids so slicer will keep them open (inserting magnets, etc)

Just a quick note that I found a way to design objects so Bambu Slicer will respect internal voids.

(This is done in OpenSCAD, but I assume would work in any design platform.)

I have a cylinder with a cylindrical void inside it for inserting a magnet. Using a standard import and then Split to Objects, Bambu Slicer will separate the void out as its own object, leaving the main cylinder solid.

I could instead manually split to parts, find the part corresponding to the void, and change its type to negative part.

But there’s a better way that avoids the manual step.

I created a cylinder with diameter = .001 (my “ff” value) that runs through the center of the cylinder, passes through the void, and out the bottom. Next I subtracted that from the rest of the work. Now I have a cylinder with a magnet void in the middle and a second hairline void passthrough connecting outside main cylinder to inside void. Export from OpenSCAD, pull into Bambu Slicer, and now it respects the void!!

Slice, insert pause to allow inserting the magnet, resume print, and done!

While I don’t yet have a way to insert pauses automatically, at least now I can do a normal import/split to objects/arrange in Bambu Labs and don’t have to eyeball adding voids as separate volumes.

(edited for clarity)

I’m confused as to why you would need to do any of this. If in OpenSCAD you properly subtracted the inner recess from the object then why would you want to split to objects, you should just be able to slice the object normally and then use the slider on the right to go down and verify the void is actually in the gcode.

My design from OpenSCAD is a large number of assembled individual objects that I export as a single 3MF file. (Think gearing, assemblies, etc.) Only one is a closed volume with a void in it, and Bambu Slicer considers the void to be its own object when splitting to objects. (The code is too simple to be the problem, but as extra confirmation, if it wasn’t actually a void, the trick I’ve used above wouldn’t have worked.)

Its totally possible that there’s something about the way OpenSCAD exports to 3mf that causes the void to not be a void? Regardless, this helped me, so its worth publishing!

I have to agree with @sprior, you should not need to go through so much effort to create a void.
image

In Fusion, I created a block, created a disc, moved the disc into position inside the block and combined the two with a cut operation, using the disc as the “cutting tool”. It took about 20 seconds, though I was not concerned with exact positioning.

Studio has no problem respecting the void. After slicing, pull down the slider on the right and right click to insert a pause at the appropriate layer.

1 Like

It sounds like you should be telling OpenSCAD to binary subtract those voids from the object that it is building, but instead you are defining those objects as a collection and trying to do that subtraction in the slicer.

1 Like

I agree with you both! And yet – here’s the sample code:

difference() {
    cylinder(d=10,h=10,center=true);
    cylinder(d=2,h=2,center=true);
}

Couldn’t possibly be more simple. With that model:

  1. Render.
  2. Export as 3mf.
  3. Import into Bambu.
  4. Split to Objects
  5. Arrange (see there are two solid cylinders on the plate)
  6. Slice
  7. Two solid objects.

Now same procedure, only with this:

difference() {
    cylinder(d=10,h=10,center=true);
    cylinder(d=2,h=2,center=true);
    cylinder(d=.001, h=12, center=true);
}

Slices into single object with void.

I just loaded your first 2 cylinder code into OpenSCAD (installed just for you, I use Fusion) and here is the result I got in Bambu Studio. It’s very small object and I guess the OpenSCAD detail settings were low so it came out as a pentagon, but it did create a void inside the larger cylinder - I did NOT split it into objects as that doesn’t make sense. I did scale up all the dimensions by 10x in OpenSCAD and it looked fine.

I changed your first example to:
$fs = 0.01;
difference() {
cylinder(d=10,h=10,center=true);
cylinder(d=2,h=2,center=true);
}

And it looks much better. I also switched to standard 0.2 layer settings in BS.

Your second example with 3 cylinders doesn’t make sense to me, you’re defining a cylinder that’s 1/1000 of a milimeter in diameter and a height greater than the first cylinder you’re subtracting from?

I appreciate your willingness to look into this, and its good to know its working properly for you without the split to objects. I have too many different objects separately in this single import, so I can’t choose to not split to objects.

Try splitting to objects, then add the fix cylinder and try it again – you should see the behavior I’m mentioning. I haven’t tried digging into whatever code is in the 3mf to understand what’s happening, but adding the thin cylinder either joins the objects into one, or lets Bambu know the void is a void or… ? I may try digging in further over the weekend.

I think its probably relatively rare that designers want a completely surrounded void inside a modeled object, so its likely this doesn’t come up too often. Maybe its particular to the way OpenSCAD exports to 3mf? Its also possible there’s some setting or process I’m missing that would allow me to pull everything in and get it all to the bed surface without doing the split to objects, but I haven’t found it yet. Luckily, this thin cylinder trick works for me! :slight_smile: