|
![](/i/fill.gif) |
andrel wrote:
> On 31-Dec-08 22:39, stbenge wrote:
>> The loop is the engine, sin/cos are two parts of a gear, and pi is the
>> number of teeth.
Maybe my metaphor isn't entirely accurate...
> I wanna see that wheel with pi teeth. Can you render one?
Sure! I'm going to assume you aren't actually asking for a visual pun.
Here is some code I put together:
#macro gear(gRad, gInset, nTeeth, pThick)
//gRad gear radius
//gInset teeth depth (from radius)
//nTeeth number of teeth
//pThick prism thickness
#local nPoints = 4*nTeeth;
#local tooth = pi*2/nPoints;
prism{
-pThick,pThick,nPoints
#local V = 0;
#while(V<nPoints)
#local rV = (gRad-gInset/2)+cos(tooth*V*nTeeth+pi/4)*gInset/2;
<sin(tooth*V)*rV, cos(tooth*V)*rV>
#local V = V + 1;
#end
rotate y*180/nPoints
}
#end
object{
gear(1,.1, 30, .1)
pigment{rgb 1}
}
It's just your basic gear, nothing fancy.
Sam
Post a reply to this message
Attachments:
Download 'gear.png' (3 KB)
Preview of image 'gear.png'
![gear.png](/povray.binaries.images/attachment/%3C495dd757%40news.povray.org%3E/gear.png?preview=1)
|
![](/i/fill.gif) |