discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Models with overlapping parts

ME
Mark Erbaugh
Mon, Apr 20, 2026 6:49 PM

I’m using OpenSCAD to create multi color plaques for 3D printing. The model consists of a solid color base with inlaid text and graphics of different colors.

The base is basically a cube (or cuboid) of a solid color.

I was using difference() to create a pocket in the top of the base and then filling that in with a union of the part with the other color. Sometimes when I slice that, there are small gaps between the pocket and inlay that causes strange behavior in the slicer. I assume that is due to rounding errors.

The slicer seems to work better if I don’t create the pocket and just union() in the colored parts.

Is this something that I can rely on? What does OpenSCAD do when there are multiple parts with different colors for the same volume?

Thanks,
Mark

I’m using OpenSCAD to create multi color plaques for 3D printing. The model consists of a solid color base with inlaid text and graphics of different colors. The base is basically a cube (or cuboid) of a solid color. I was using difference() to create a pocket in the top of the base and then filling that in with a union of the part with the other color. Sometimes when I slice that, there are small gaps between the pocket and inlay that causes strange behavior in the slicer. I assume that is due to rounding errors. The slicer seems to work better if I don’t create the pocket and just union() in the colored parts. Is this something that I can rely on? What does OpenSCAD do when there are multiple parts with different colors for the same volume? Thanks, Mark
NS
Nathan Sokalski
Mon, Apr 20, 2026 7:12 PM

I'm not one of the developers of OpenSCAD, but I believe that color is 100% irrelevant when rendering, it is simply for display and debugging purposes. I have also been told that difference should be used sparingly. If I understand your goals, it might be best to skip the difference() and refactor your code to use intersection() instead. But once again, I am not one of the developers, and I could of course be misunderstanding your goal.

Nathan Sokalski
njsokalski@hotmail.commailto:njsokalski@hotmail.com


From: Mark Erbaugh via Discuss discuss@lists.openscad.org
Sent: Monday, April 20, 2026 2:49 PM
To: OpenSCAD general discussion Mailing-list discuss@lists.openscad.org
Cc: Mark Erbaugh mark.election@gmail.com
Subject: [OpenSCAD] Models with overlapping parts

I’m using OpenSCAD to create multi color plaques for 3D printing. The model consists of a solid color base with inlaid text and graphics of different colors.

The base is basically a cube (or cuboid) of a solid color.

I was using difference() to create a pocket in the top of the base and then filling that in with a union of the part with the other color. Sometimes when I slice that, there are small gaps between the pocket and inlay that causes strange behavior in the slicer. I assume that is due to rounding errors.

The slicer seems to work better if I don’t create the pocket and just union() in the colored parts.

Is this something that I can rely on? What does OpenSCAD do when there are multiple parts with different colors for the same volume?

Thanks,
Mark


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

I'm not one of the developers of OpenSCAD, but I believe that color is 100% irrelevant when rendering, it is simply for display and debugging purposes. I have also been told that difference should be used sparingly. If I understand your goals, it might be best to skip the difference() and refactor your code to use intersection() instead. But once again, I am not one of the developers, and I could of course be misunderstanding your goal. Nathan Sokalski njsokalski@hotmail.com<mailto:njsokalski@hotmail.com> ________________________________ From: Mark Erbaugh via Discuss <discuss@lists.openscad.org> Sent: Monday, April 20, 2026 2:49 PM To: OpenSCAD general discussion Mailing-list <discuss@lists.openscad.org> Cc: Mark Erbaugh <mark.election@gmail.com> Subject: [OpenSCAD] Models with overlapping parts I’m using OpenSCAD to create multi color plaques for 3D printing. The model consists of a solid color base with inlaid text and graphics of different colors. The base is basically a cube (or cuboid) of a solid color. I was using difference() to create a pocket in the top of the base and then filling that in with a union of the part with the other color. Sometimes when I slice that, there are small gaps between the pocket and inlay that causes strange behavior in the slicer. I assume that is due to rounding errors. The slicer seems to work better if I don’t create the pocket and just union() in the colored parts. Is this something that I can rely on? What does OpenSCAD do when there are multiple parts with different colors for the same volume? Thanks, Mark _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org
DP
Dan Perry
Mon, Apr 20, 2026 7:57 PM

I do the same thing, difference() the text from my main part, then use lazy
union to export the main part and the text in a separate color.  Using
PrusaSlicer, I've never experienced any issues in the slicer with this
approach.  I did have some problems when I tried skipping the difference().
Dan

On Mon, Apr 20, 2026 at 7:49 PM Mark Erbaugh via Discuss <
discuss@lists.openscad.org> wrote:

I’m using OpenSCAD to create multi color plaques for 3D printing. The
model consists of a solid color base with inlaid text and graphics of
different colors.

The base is basically a cube (or cuboid) of a solid color.

I was using difference() to create a pocket in the top of the base and
then filling that in with a union of the part with the other color.
Sometimes when I slice that, there are small gaps between the pocket and
inlay that causes strange behavior in the slicer. I assume that is due to
rounding errors.

The slicer seems to work better if I don’t create the pocket and just
union() in the colored parts.

Is this something that I can rely on? What does OpenSCAD do when there are
multiple parts with different colors for the same volume?

Thanks,
Mark


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

I do the same thing, difference() the text from my main part, then use lazy union to export the main part and the text in a separate color. Using PrusaSlicer, I've never experienced any issues in the slicer with this approach. I did have some problems when I tried skipping the difference(). Dan On Mon, Apr 20, 2026 at 7:49 PM Mark Erbaugh via Discuss < discuss@lists.openscad.org> wrote: > I’m using OpenSCAD to create multi color plaques for 3D printing. The > model consists of a solid color base with inlaid text and graphics of > different colors. > > The base is basically a cube (or cuboid) of a solid color. > > I was using difference() to create a pocket in the top of the base and > then filling that in with a union of the part with the other color. > Sometimes when I slice that, there are small gaps between the pocket and > inlay that causes strange behavior in the slicer. I assume that is due to > rounding errors. > > The slicer seems to work better if I don’t create the pocket and just > union() in the colored parts. > > Is this something that I can rely on? What does OpenSCAD do when there are > multiple parts with different colors for the same volume? > > Thanks, > Mark > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
JB
Jon Bondy
Mon, Apr 20, 2026 8:09 PM

I do something similar, but I export the base and the text as two
separate STL files and then combine them in the slicer, assigning
materials and colors there.

If there is a smarter/easier way to do this, exporting both in a single
.3MF, then I would like to learn how to do that

Jon

On 4/20/2026 3:57 PM, Dan Perry via Discuss wrote:

I do the same thing, difference() the text from my main part, then use
lazy union to export the main part and the text in a separate color. 
Using PrusaSlicer, I've never experienced any issues in the slicer
with this approach.  I did have some problems when I tried skipping
the difference().
Dan

On Mon, Apr 20, 2026 at 7:49 PM Mark Erbaugh via Discuss
discuss@lists.openscad.org wrote:

 I’m using OpenSCAD to create multi color plaques for 3D printing.
 The model consists of a solid color base with inlaid text and
 graphics of different colors.

 The base is basically a cube (or cuboid) of a solid color.

 I was using difference() to create a pocket in the top of the base
 and then filling that in with a union of the part with the other
 color. Sometimes when I slice that, there are small gaps between
 the pocket and inlay that causes strange behavior in the slicer. I
 assume that is due to rounding errors.

 The slicer seems to work better if I don’t create the pocket and
 just union() in the colored parts.

 Is this something that I can rely on? What does OpenSCAD do when
 there are multiple parts with different colors for the same volume?

 Thanks,
 Mark
 _______________________________________________
 OpenSCAD mailing list
 To unsubscribe send an email to discuss-leave@lists.openscad.org

OpenSCAD mailing list
To unsubscribe send an email todiscuss-leave@lists.openscad.org

--
This email has been checked for viruses by AVG antivirus software.
www.avg.com

I do something similar, but I export the base and the text as two separate STL files and then combine them in the slicer, assigning materials and colors there. If there is a smarter/easier way to do this, exporting both in a single .3MF, then I would like to learn how to do that Jon On 4/20/2026 3:57 PM, Dan Perry via Discuss wrote: > I do the same thing, difference() the text from my main part, then use > lazy union to export the main part and the text in a separate color.  > Using PrusaSlicer, I've never experienced any issues in the slicer > with this approach.  I did have some problems when I tried skipping > the difference(). > Dan > > > On Mon, Apr 20, 2026 at 7:49 PM Mark Erbaugh via Discuss > <discuss@lists.openscad.org> wrote: > > I’m using OpenSCAD to create multi color plaques for 3D printing. > The model consists of a solid color base with inlaid text and > graphics of different colors. > > The base is basically a cube (or cuboid) of a solid color. > > I was using difference() to create a pocket in the top of the base > and then filling that in with a union of the part with the other > color. Sometimes when I slice that, there are small gaps between > the pocket and inlay that causes strange behavior in the slicer. I > assume that is due to rounding errors. > > The slicer seems to work better if I don’t create the pocket and > just union() in the colored parts. > > Is this something that I can rely on? What does OpenSCAD do when > there are multiple parts with different colors for the same volume? > > Thanks, > Mark > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email todiscuss-leave@lists.openscad.org -- This email has been checked for viruses by AVG antivirus software. www.avg.com
ME
Mark Erbaugh
Mon, Apr 20, 2026 9:11 PM

A chance for me to contribute to the forum 😊.

I used to do the same, multiple STL files, but I’ve been trying different ways to use just one import.

I’ve attached Flag Shield.svg and USA 250.scad. Flag Sield.scad is a four color image. It has five layers, one for each color labeled with the color name and a fifth layer labeled outline with the overall outline.

USA 250.scad reads in that information and can create a .3mf file with color information that can be read by Bambu Studio as a single import. Here are some notes:

When exporting the .3mf file, you have to use the export function and then read that into Bambu Studio, you can’t use the 3d print button. If you hold down shift while clicking the .3mf export button, OpenSCAD brings up the export options dialog. Make sure that format (in the middle) is set to export colors as Color. Once you have set this, OpenSCAD will remember this setting so you can just click the export button in the future. The issue is that if you click the 3d Print button, there is no option to configure the export colors. They are always exported as Base Material. While Base Material still contains color information, Bambu Slicer doesn’t use that, colors must be exported as color.

At the top of the file are variables black, cobalt_blue, jade_white and red. These contain the hex representation of the colors of Bambu Lab PLA BASIC filaments with those colors. If you use those color codes, Bambu Slicer will automatically map the color to the corresponding filament.

These are the parts I’m still working on (see my other recent posts). Even though the .scad file creates the top and bottom colored layers with one 0.2mm layers each, Bambu Studio uses the “Top Paint Penetration Layers” and “Bottom Paint Penetration Layers"settings to determine the number of layers with color. Also, and I think this is an issue where due to rounding the color layers don’t exactly match one another and there can be small gaps between them. If the gap is large enough, it confuses the slicer and there can be artifacts in the interior layers.



I hope this helps. Feel free to fine tune the process.

Mark

On Apr 20, 2026, at 4:09 PM, Jon Bondy via Discuss discuss@lists.openscad.org wrote:

I do something similar, but I export the base and the text as two separate STL files and then combine them in the slicer, assigning materials and colors there.

If there is a smarter/easier way to do this, exporting both in a single .3MF, then I would like to learn how to do that

Jon

A chance for me to contribute to the forum 😊. I used to do the same, multiple STL files, but I’ve been trying different ways to use just one import. I’ve attached Flag Shield.svg and USA 250.scad. Flag Sield.scad is a four color image. It has five layers, one for each color labeled with the color name and a fifth layer labeled outline with the overall outline. USA 250.scad reads in that information and can create a .3mf file with color information that can be read by Bambu Studio as a single import. Here are some notes: When exporting the .3mf file, you have to use the export function and then read that into Bambu Studio, you can’t use the 3d print button. If you hold down shift while clicking the .3mf export button, OpenSCAD brings up the export options dialog. Make sure that format (in the middle) is set to export colors as Color. Once you have set this, OpenSCAD will remember this setting so you can just click the export button in the future. The issue is that if you click the 3d Print button, there is no option to configure the export colors. They are always exported as Base Material. While Base Material still contains color information, Bambu Slicer doesn’t use that, colors must be exported as color. At the top of the file are variables black, cobalt_blue, jade_white and red. These contain the hex representation of the colors of Bambu Lab PLA BASIC filaments with those colors. If you use those color codes, Bambu Slicer will automatically map the color to the corresponding filament. These are the parts I’m still working on (see my other recent posts). Even though the .scad file creates the top and bottom colored layers with one 0.2mm layers each, Bambu Studio uses the “Top Paint Penetration Layers” and “Bottom Paint Penetration Layers"settings to determine the number of layers with color. Also, and I think this is an issue where due to rounding the color layers don’t exactly match one another and there can be small gaps between them. If the gap is large enough, it confuses the slicer and there can be artifacts in the interior layers.  I hope this helps. Feel free to fine tune the process. Mark > On Apr 20, 2026, at 4:09 PM, Jon Bondy via Discuss <discuss@lists.openscad.org> wrote: > > I do something similar, but I export the base and the text as two separate STL files and then combine them in the slicer, assigning materials and colors there. > > If there is a smarter/easier way to do this, exporting both in a single .3MF, then I would like to learn how to do that > > Jon >
CC
Cory Cross
Mon, Apr 20, 2026 11:55 PM

On 4/20/26 11:49 AM, Mark Erbaugh via Discuss wrote:

I’m using OpenSCAD to create multi color plaques for 3D printing. The model consists of a solid color base with inlaid text and graphics of different colors.

The base is basically a cube (or cuboid) of a solid color.

I was using difference() to create a pocket in the top of the base and then filling that in with a union of the part with the other color. Sometimes when I slice that, there are small gaps between the pocket and inlay that causes strange behavior in the slicer. I assume that is due to rounding errors.

Maybe, but try "arachne" wall instead.

The slicer seems to work better if I don’t create the pocket and just union() in the colored parts.

Is this something that I can rely on? What does OpenSCAD do when there are multiple parts with different colors for the same volume?

OpenSCAD does not have volumetric coloring (use that term to search the
list). You should treat each object exported by OpenSCAD as a single
color -- web search for "colorscad" for how it handles multi-color
objects; even if you don't use it, it explains the limitations.

Cory

On 4/20/26 11:49 AM, Mark Erbaugh via Discuss wrote: > I’m using OpenSCAD to create multi color plaques for 3D printing. The model consists of a solid color base with inlaid text and graphics of different colors. > > The base is basically a cube (or cuboid) of a solid color. > > I was using difference() to create a pocket in the top of the base and then filling that in with a union of the part with the other color. Sometimes when I slice that, there are small gaps between the pocket and inlay that causes strange behavior in the slicer. I assume that is due to rounding errors. Maybe, but try "arachne" wall instead. > The slicer seems to work better if I don’t create the pocket and just union() in the colored parts. > > Is this something that I can rely on? What does OpenSCAD do when there are multiple parts with different colors for the same volume? OpenSCAD does not have volumetric coloring (use that term to search the list). You should treat each object exported by OpenSCAD as a single color -- web search for "colorscad" for how it handles multi-color objects; even if you don't use it, it explains the limitations. Cory
JB
Jon Bondy
Tue, Apr 21, 2026 1:14 AM

"You should treat each object exported by OpenSCAD as a single color"

And yet, I JUST learned how to export what is essentially two different
objects by coloring them.

I imagine there is a lot more that I do not understand.

On 4/20/2026 7:55 PM, Cory Cross via Discuss wrote:

On 4/20/26 11:49 AM, Mark Erbaugh via Discuss wrote:

I’m using OpenSCAD to create multi color plaques for 3D printing. The
model consists of a solid color base with inlaid text and graphics of
different colors.

The base is basically a cube (or cuboid) of a solid color.

I was using difference() to create a pocket in the top of the base
and then filling that in with a union of the part with the other
color. Sometimes when I slice that, there are small gaps between the
pocket and inlay that causes strange behavior in the slicer. I assume
that is due to rounding errors.

Maybe, but try "arachne" wall instead.

The slicer seems to work better if I don’t create the pocket and just
union() in the colored parts.

Is this something that I can rely on? What does OpenSCAD do when
there are multiple parts with different colors for the same volume?

OpenSCAD does not have volumetric coloring (use that term to search
the list). You should treat each object exported by OpenSCAD as a
single color -- web search for "colorscad" for how it handles
multi-color objects; even if you don't use it, it explains the
limitations.

Cory


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

--
This email has been checked for viruses by AVG antivirus software.
www.avg.com

"You should treat each object exported by OpenSCAD as a single color" And yet, I JUST learned how to export what is essentially two different objects by coloring them. I imagine there is a lot more that I do not understand. On 4/20/2026 7:55 PM, Cory Cross via Discuss wrote: > On 4/20/26 11:49 AM, Mark Erbaugh via Discuss wrote: >> I’m using OpenSCAD to create multi color plaques for 3D printing. The >> model consists of a solid color base with inlaid text and graphics of >> different colors. >> >> The base is basically a cube (or cuboid) of a solid color. >> >> I was using difference() to create a pocket in the top of the base >> and then filling that in with a union of the part with the other >> color. Sometimes when I slice that, there are small gaps between the >> pocket and inlay that causes strange behavior in the slicer. I assume >> that is due to rounding errors. > > Maybe, but try "arachne" wall instead. > >> The slicer seems to work better if I don’t create the pocket and just >> union() in the colored parts. >> >> Is this something that I can rely on? What does OpenSCAD do when >> there are multiple parts with different colors for the same volume? > > OpenSCAD does not have volumetric coloring (use that term to search > the list). You should treat each object exported by OpenSCAD as a > single color -- web search for "colorscad" for how it handles > multi-color objects; even if you don't use it, it explains the > limitations. > > Cory > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org -- This email has been checked for viruses by AVG antivirus software. www.avg.com
JB
Jordan Brown
Tue, Apr 21, 2026 2:26 AM

On 4/20/2026 11:49 AM, Mark Erbaugh via Discuss wrote:

I was using difference() to create a pocket in the top of the base and then filling that in with a union of the part with the other color. Sometimes when I slice that, there are small gaps between the pocket and inlay that causes strange behavior in the slicer. I assume that is due to rounding errors.

Entirely possible, though if it causes problems for the slicer I would
consider it to be a problem with the slicer. That is, if it's ending up
as multiple parts/objects in the slicer.

If it's ending up as a single part in the slicer, and it's the result of
lazy union, then it may be a case that I've been worried about since I
heard about lazy union.  People say that slicers are ready to handle
models with overlapping pieces, but I think it's a very gray area where
I wouldn't be surprised if there are problems.  STL in particular is
ill-suited for representing such cases.

Is this something that I can rely on? What does OpenSCAD do when there are multiple parts with different colors for the same volume?

Other than lazy union - which, as I said, I don't think you can rely on

  • it isn't meaningful to talk about "multiple parts for the same
    volume".  If you union overlapping shapes, the result is one shape.  The
    now-internal boundaries are lost.  Color of faces is preserved on
    preview.  Historically, with CGAL, color of faces was lost on render. 
    Manifold preserves some face coloring but I don't think the result ends
    up the same as preview... and it does not do volume coloring; it is
    not meaningful to talk about the color inside the shape.

On 4/20/2026 12:12 PM, Nathan Sokalski via Discuss wrote:

I'm not one of the developers of OpenSCAD, but I believe that color is
100% irrelevant when rendering, it is simply for display and debugging
purposes.

Historically, yes.  Manifold preserves come color, and I think some of
it may be exported into 3MF.  But as I noted above, it's face coloring
only; it doesn't tell you about the interior of the shape.

I have also been told that difference should be used sparingly. If I
understand your goals, it might be best to skip the difference() and
refactor your code to use intersection() instead.

I have not heard that; in fact, if anything, the reverse:  avoid
intersection.  Intersection can apparently cause the previewing
mechanism to explode in complexity.

I have not heard of any difference between the two for rendering.

On 4/20/2026 11:49 AM, Mark Erbaugh via Discuss wrote: > I was using difference() to create a pocket in the top of the base and then filling that in with a union of the part with the other color. Sometimes when I slice that, there are small gaps between the pocket and inlay that causes strange behavior in the slicer. I assume that is due to rounding errors. Entirely possible, though if it causes problems for the slicer I would consider it to be a problem with the slicer. That is, if it's ending up as multiple parts/objects in the slicer. If it's ending up as a single part in the slicer, and it's the result of lazy union, then it may be a case that I've been worried about since I heard about lazy union.  People say that slicers are ready to handle models with overlapping pieces, but I think it's a very gray area where I wouldn't be surprised if there are problems.  STL in particular is ill-suited for representing such cases. > Is this something that I can rely on? What does OpenSCAD do when there are multiple parts with different colors for the same volume? Other than lazy union - which, as I said, I don't think you can rely on - it isn't meaningful to talk about "multiple parts for the same volume".  If you union overlapping shapes, the result is one shape.  The now-internal boundaries are lost.  Color of faces is preserved on preview.  Historically, with CGAL, color of faces was lost on render.  Manifold preserves some face coloring but I don't think the result ends up the same as preview... and it does *not* do volume coloring; it is not meaningful to talk about the color *inside* the shape. On 4/20/2026 12:12 PM, Nathan Sokalski via Discuss wrote: > I'm not one of the developers of OpenSCAD, but I believe that color is > 100% irrelevant when rendering, it is simply for display and debugging > purposes. Historically, yes.  Manifold preserves come color, and I think some of it may be exported into 3MF.  But as I noted above, it's face coloring only; it doesn't tell you about the interior of the shape. > I have also been told that difference should be used sparingly. If I > understand your goals, it might be best to skip the difference() and > refactor your code to use intersection() instead. I have not heard that; in fact, if anything, the reverse:  avoid intersection.  Intersection can apparently cause the previewing mechanism to explode in complexity. I have not heard of any difference between the two for rendering.