discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Colours of negative objects affect positive ones

G
Gadgetmind
Wed, Aug 9, 2017 1:05 PM

It's taken me a while to boil this down to simple example code, but here
it is.

module Part1 () {
color ("red")
union () {
cube ([10, 20, 30], center=true);
cylinder (r=8, h=60, center=true);
}
}

module Part2 () {
color ("white")
difference () {
sphere (r=15);
rotate ([0, 0, 0]) cube ([10, 20, 30], center=true); // Rotate
me and see what happens to colours!
}
}

Part1 ();
Part2 ();

Part1 is a union of a cube(oid) and a cylinder. It's red.

Part2 is a sphere with a cuboid removed. It's white.

When the two cubiods are (close to) incident, the colour of Part2
"bleeds" into Part 1. This means that my complex objects that do a lot
of adding and subtracting of common underlying elements can't be coloured.

Known issue? Open bug? Me being stupid?

It's taken me a while to boil this down to simple example code, but here it is. module Part1 () { color ("red") union () { cube ([10, 20, 30], center=true); cylinder (r=8, h=60, center=true); } } module Part2 () { color ("white") difference () { sphere (r=15); rotate ([0, 0, 0]) cube ([10, 20, 30], center=true); // Rotate me and see what happens to colours! } } Part1 (); Part2 (); Part1 is a union of a cube(oid) and a cylinder. It's red. Part2 is a sphere with a cuboid removed. It's white. When the two cubiods are (close to) incident, the colour of Part2 "bleeds" into Part 1. This means that my complex objects that do a lot of adding and subtracting of common underlying elements can't be coloured. Known issue? Open bug? Me being stupid?
G
Gadgetmind
Wed, Aug 9, 2017 2:09 PM

On 2017-08-09 14:05, Gadgetmind wrote:

When the two cubiods are (close to) incident, the colour of Part2
"bleeds" into Part 1. This means that my complex objects that do a lot
of adding and subtracting of common underlying elements can't be coloured.

Hmmm, this might be this issue.

https://github.com/openscad/openscad/issues/1000

Sadly, adding render() in various places gives me a 5 minute preview
time on my model even with just 5% of it being drawn and at low
"resolution".

On 2017-08-09 14:05, Gadgetmind wrote: > > When the two cubiods are (close to) incident, the colour of Part2 > "bleeds" into Part 1. This means that my complex objects that do a lot > of adding and subtracting of common underlying elements can't be coloured. > Hmmm, this might be this issue. https://github.com/openscad/openscad/issues/1000 Sadly, adding render() in various places gives me a 5 minute preview time on my model even with just 5% of it being drawn and at low "resolution".
G
Gadgetmind
Wed, Aug 9, 2017 2:10 PM

On 2017-08-09 14:05, Gadgetmind wrote:

When the two cubiods are (close to) incident, the colour of Part2
"bleeds" into Part 1. This means that my complex objects that do a lot
of adding and subtracting of common underlying elements can't be coloured.

Hmmm, this might be this issue.

https://github.com/openscad/openscad/issues/1000

Sadly, adding render() in various places gives me a 5 minute preview
time on my model even with just 5% of it being drawn and at low
"resolution".

On 2017-08-09 14:05, Gadgetmind wrote: > > When the two cubiods are (close to) incident, the colour of Part2 > "bleeds" into Part 1. This means that my complex objects that do a lot > of adding and subtracting of common underlying elements can't be coloured. > Hmmm, this might be this issue. https://github.com/openscad/openscad/issues/1000 Sadly, adding render() in various places gives me a 5 minute preview time on my model even with just 5% of it being drawn and at low "resolution".