|
|
Hi all,
I use twuo parser working on my CAD
First, running at run time (Autolisp extension) creates triangle (two or one) by
AutoCAD 3DFACE(s) (4 sides or 3 sides).
or
Second, (exe) DXF to PovRay, in same way by 3DFACE(s).
I have been using a fairly efficient system for transmitting colors for years.
I use layer names in CAD.
In this way.
Example for white
HEXFFFFFF
If necessary I use transmit for transparency, then the "uman" layername (ignored
in the parser).
HEXFFFFFF[FF][MYLAYERNAME]
this is the code in the povray files:
full red example
triangle{<10.2649,0.0000,5.4354><5.1437,0.0000,1.2973><13.0078,0.0000,0.2667>
pigment {color rgb hex2rgb("HEXFF0000")}
}
#macro h2d(HexVal)
(asc(HexVal)>64?asc(HexVal)-55:asc(HexVal)-48)
#end
#macro hex2rgb(hxStr)
<(16*h2d(substr(hxStr,4,1))+h2d(substr(hxStr,5,1)))/255,(16*h2d(substr(hxStr,6,1))+h2d(substr(hxStr,7,1)))/255,
(16*h2d(substr(hxStr,8,1))+h2d(substr(hxStr,9,1)))/255>
#end
#macro hex2rgbT(hxStr)
<(16*h2d(substr(hxStr,4,1))+h2d(substr(hxStr,5,1)))/255,(16*h2d(substr(hxStr,6,1))+h2d(substr(hxStr,7,1)))/255,
(16*h2d(substr(hxStr,8,1))+h2d(substr(hxStr,9,1)))/255,((val(substr(hxStr,11,2)))/255)>
#end
Regards!
G.
Post a reply to this message
|
|