// Originally written by Thomas (I forgot full name) // Has been modified. For a segmented line to be without // breaks / holes, the height (Y) should be just a bit // more than from -1 to +1 units. #macro Segment ( p2,p3 ) #ifdef (p0) #declare s_diro=vnormalize(p2-p1); #declare s_dir=vcross(s_diro,z); intersection { object { Segment_Object scale <1,vlength(p2-p1),1> matrix translate p1 } plane { #if (vlength((p3-p2)/vlength(p3-p2)+(p2-p1)/vlength(p2-p1))=0) p2-p1,0 #else (p3-p2)/vlength(p3-p2)+(p2-p1)/vlength(p2-p1),0 #end translate p2 pigment { rgbf 1 } } plane { #if (vlength((p0-p1)/vlength(p0-p1)+(p1-p2)/vlength(p1-p2))=0) p1-p2,0 #else (p0-p1)/vlength(p0-p1)+(p1-p2)/vlength(p1-p2),0 #end translate p1 pigment { rgbf 1 } } } #else #declare p1=p2; #end #declare p0=p1; #declare p1=p2; #end #local Cnt=0; // Clock value going from 0 to Antal Array segmenter #while (Cnt matrix translate p1 } plane { #if (vlength((p3-p2)/vlength(p3-p2)+(p2-p1)/vlength(p2-p1))=0) p2-p1,0 #else (p3-p2)/vlength(p3-p2)+(p2-p1)/vlength(p2-p1),0 #end translate p2 pigment { rgbf 1 } } plane { #if (vlength((p0-p1)/vlength(p0-p1)+(p1-p2)/vlength(p1-p2))=0) p1-p2,0 #else (p0-p1)/vlength(p0-p1)+(p1-p2)/vlength(p1-p2),0 #end translate p1 pigment { rgbf 1 } } } #local SCnt=SCnt+(1/Smoothness); #end #end