discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

difference leaves color from object behind

S
Scalpel78
Thu, Dec 18, 2014 8:53 PM

Hi, this is probably by design, but I was a bit puzzled after all.

od = 6;
width=3;
$fn=20;
difference() {
color("grey") cylinder(d=od, h=width, center=true);
color("red") cylinder(d=od-1, h=width+1, center=true);
}

http://forum.openscad.org/file/n10615/greyRedCylinder.png

When I remove the red cylinder the inside of the grey one becomes red. Is it
supposed to be like that?

--
View this message in context: http://forum.openscad.org/difference-leaves-color-from-object-behind-tp10615.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Hi, this is probably by design, but I was a bit puzzled after all. od = 6; width=3; $fn=20; difference() { color("grey") cylinder(d=od, h=width, center=true); color("red") cylinder(d=od-1, h=width+1, center=true); } <http://forum.openscad.org/file/n10615/greyRedCylinder.png> When I remove the red cylinder the inside of the grey one becomes red. Is it supposed to be like that? -- View this message in context: http://forum.openscad.org/difference-leaves-color-from-object-behind-tp10615.html Sent from the OpenSCAD mailing list archive at Nabble.com.
PF
Peter Falke
Fri, Dec 19, 2014 4:20 PM

The trick of F5 for displaying the subtracted cylinder is to draw the
backside of the subtracted cylinder over the front side of the first
cylinder. Now the color of the subtracted cylinder is red. Thats why cutouts get colored with the color of the subtracted object. No actual geometry data is ever computed with F5. Thats what makes F5 so fast.

Sincerely,

TakeItAndRun

2014-12-18 21:53 GMT+01:00 Scalpel78 frode@lillerud.no:

Hi, this is probably by design, but I was a bit puzzled after all.

od = 6;
width=3;
$fn=20;
difference() {
color("grey") cylinder(d=od, h=width, center=true);
color("red") cylinder(d=od-1, h=width+1, center=true);
}

http://forum.openscad.org/file/n10615/greyRedCylinder.png

When I remove the red cylinder the inside of the grey one becomes red. Is
it
supposed to be like that?

--
View this message in context:
http://forum.openscad.org/difference-leaves-color-from-object-behind-tp10615.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

--
stempeldergeschichte@googlemail.com karsten@rohrbach.de

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu
schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!

The trick of F5 for displaying the subtracted cylinder is to draw the backside of the subtracted cylinder over the front side of the first cylinder. Now the color of the subtracted cylinder is red. That`s why cutouts get colored with the color of the subtracted object. No actual geometry data is ever computed with F5. That`s what makes F5 so fast. Sincerely, TakeItAndRun 2014-12-18 21:53 GMT+01:00 Scalpel78 <frode@lillerud.no>: > Hi, this is probably by design, but I was a bit puzzled after all. > > od = 6; > width=3; > $fn=20; > difference() { > color("grey") cylinder(d=od, h=width, center=true); > color("red") cylinder(d=od-1, h=width+1, center=true); > } > > <http://forum.openscad.org/file/n10615/greyRedCylinder.png> > > When I remove the red cylinder the inside of the grey one becomes red. Is > it > supposed to be like that? > > > > -- > View this message in context: > http://forum.openscad.org/difference-leaves-color-from-object-behind-tp10615.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > -- stempeldergeschichte@googlemail.com <karsten@rohrbach.de> P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist: Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu schreiben. Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen. P.S. In case my e-mail is shorter than you enjoy: I am currently trying short replies instead of no replies at all. Please let me know, if you like to read more. Enjoy!
M
MichaelAtOz
Sat, Dec 20, 2014 8:04 AM

Ah, thanks for that, I had wondered why. Sort of obvious in hindsight.


Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/

View this message in context: http://forum.openscad.org/difference-leaves-color-from-object-behind-tp10615p10656.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Ah, thanks for that, I had wondered why. Sort of obvious in hindsight. ----- Unless specifically shown otherwise above, my contribution is in the Public Domain; To the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. This work is published globally via the internet. :) Inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ -- View this message in context: http://forum.openscad.org/difference-leaves-color-from-object-behind-tp10615p10656.html Sent from the OpenSCAD mailing list archive at Nabble.com.