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?
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);
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);