[OpenSCAD] Semantics CSG ops with respect to color, materials

bobc bobcousins42 at googlemail.com
Sun May 31 12:33:21 EDT 2015

Further adventures with color!

Firstly, a new parameter "mix", which takes values 0 to 1. This specifies
the degree of mixing in an intersection or union. Mix = 0 means take color
of left operand, mix = 1 takes color of second operand.

Some examples of intersection, with a = red cube, b = blue sphere:


>From left, mix not specified (openscad default), mix=0, mix= 0.5, mix = 1

For this exercise, color mix is computed from ratio of RGB colors. Other
methods are possible, and probably would make more sense.

Intersection of colors to create new colors may not have many use cases, but
it is an important ingredient when considering unions, and the same mixing
principle can be extended to materials.

For unions, use cases are :
mix = 0. create an "overmould". For example, adding rubber material to a
case for hand grips.
mix = 1, create an inset. For example, embossing a pattern into a surface.
0 < mix < 1, create a blend. I don't have a use case for this...!

Here are the 3 cases, from left, mix = 0, mix=0.5, mix = 1. The resulting
AMF file has 7 volumes.


That doesn't show the intersections, so here is an exploded view:


The next thing I want to do is to evaluate whether the AMF output files will
work well (or at all!) with slicers.

View this message in context: http://forum.openscad.org/Semantics-CSG-ops-with-respect-to-color-materials-tp12667p12771.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

More information about the Discuss mailing list