|
|
Le 08/03/2017 à 19:45, LanuHum a écrit :
> stl_load { "/home/leonid/untitled.stl" texture { Material }}
> But, the cube can have different textures for each polygon.
> It would be nice to use a texture_list.
>
And which version of STL would you use ?
There is 2 incompatible format for color encoding (in binaray STL):
* As stated on wikipedia: generic STL file reader cannot automatically
distinguish between them.
* 2 "attribute byte count" bytes at the end of every triangle store a
15-bit rgb color information
** bits 0-4 for blue, bits 5-9 for green, bits 10-14 for red, bit 15 set
when color is valid
** bits 0-4 for red, bits 5-9 for green, bits 10-14 for blue, bit 15
unset when color is local, set to use global
* the header (80 bytes) can have overall color specification (only for
the latter encoding)
** but it can have COLOR=RGBA or/and MATERIAL= with 12 bytes for diffuse
reflection, specular highlight and ambient light
The stl_load-ed object is an usual povray shape: immerge it in whatever
texture/pattern you want.
(actually, it's a mesh once loaded, but there is no uv coordinates in
STL to help you)
And to make things funnier, no one as a clue about the 15 bit color
space: is it linear or gamma corrected ? (and which correction)
happy reading :
https://en.wikipedia.org/wiki/STL_(file_format)
Post a reply to this message
|
|