Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nested transparency in OpenSCAD output

Transparency in OpenSCAD output can be achieved by prepending % to elements, but this doesn't allow to put a transparent element in a surrounding element with a higher degree (e.g. expressed in percentage) of transparency and make it possible to see an (opaque) element in a transparent element inside a transparent element. How to do that?

like image 946
Kalle Richter Avatar asked Sep 12 '25 12:09

Kalle Richter


1 Answers

the a-value of color([r,g,b,a]) can be used to control transparency, e.g.:

color([0.5,0.5,0,0.8]) cube(size=[10,10,10], center=true);
%cube(size=[20,20,20], center=true);

combination of background-modifier and color()

or with different colors:

color([0.5,0.5,0,0.8]) cube(size=[10,10,10], center=true);
color([0,0.5,0.5,0.3]) cube(size=[20,20,20], center=true);

nested transparency

like image 184
a_manthey_67 Avatar answered Sep 15 '25 12:09

a_manthey_67