Color in Binary STL
There are at least two variations on the binary STL format for adding color information:
- The VisCAM and SolidView software packages use the two 'attribute byte count' bytes at the end of every triangle to store a 15 bit RGB color:
- bit 0 to 4 are the intensity level for blue (0 to 31)
- bits 5 to 9 are the intensity level for green (0 to 31)
- bits 10 to 14 are the intensity level for red (0 to 31)
- bit 15 is 1 if the color is valid
- bit 15 is 0 if the color is not valid (as with normal STL files)
- The Materialise Magics software does things a little differently. It uses the 80 byte header at the top of the file to represent the overall color of the entire part. If color is used, then somewhere in the header should be the ASCII string "COLOR=" followed by four bytes representing red, green, blue and alpha channel (transparency) in the range 0–255. This is the color of the entire object unless overridden at each facet. Magics also recognizes a material description; a more detailed surface characteristic. Just after "COLOR=RGBA" specification should be another ASCII string ",MATERIAL=" followed by three colors (3 × 4 bytes): first is a color of diffuse reflection, second is a color of specular highlight, and third is an ambient light. Material settings are preferred over color. The per-facet color is represented in the two 'attribute byte count' bytes as follows:
- bit 0 to 4 are the intensity level for red (0 to 31)
- bits 5 to 9 are the intensity level for green (0 to 31)
- bits 10 to 14 are the intensity level for blue (0 to 31)
- bit 15 is 0 if this facet has its own unique color
- bit 15 is 1 if the per-object color is to be used
The red/green/blue ordering within those two bytes is reversed in these two approaches – so while these formats could easily have been compatible the reversal of the order of the colors means that they are not – and worse still, a generic STL file reader cannot automatically distinguish between them. There is also no way to have facets be selectively transparent because there is no per-facet alpha value – although in the context of current rapid prototyping machinery, this is not important.
Read more about this topic: STL (file Format)
Famous quotes containing the words color in and/or color:
“Gradually I regained my usual composure. I reread Pale Fire more carefully. I liked it better when expecting less. And what was that? What was that dim distant music, those vestiges of color in the air? Here and there I discovered in it and especially, especially in the invaluable variants, echoes and spangles of my mind, a long ripplewake of my glory.”
—Vladimir Nabokov (18991977)
“Since the quarrel
Will bear no color for the thing he is,
Fashion it thus: that what he is, augmented,
Would run to these and these extremities.”
—William Shakespeare (15641616)