|
|
you could define a cylinder at the origin with the radius r and do some
csg-differencing. The folowing code is untested and should at least give
an idea how to achieve what you are looking for.
Happy coding!
// tabletop
#declare tableTopsBottom = 6.0; // or DH
#declare tableTopsHeigth = 0.5;
#declare tableTopsRadius = 4.0; // you could use your OR variable +
some offset
#declare numberOfSegments = 6.0; // or S
#declare segmentsAngle = 360/numberOfSegments;
#declare segmentAngleRAD = segmentAngle * pi/180;
//now some simple math to determine the size of the boxes
#declare boxHalfDepth = sin(segmentAngleRAD/2) * tableTopsRadius + 0.01;
#declare boxStartX = cos(segmentAngleRAD/2) * tableTopsRadius;
#declare boxEndX = tableTopsRadius + 0.2;
difference
{
cylinder
{
<0.0,0.0,0.0>
<0.0,tableTopsHeigth,0.0>
tableTopsRadius +0.01 // make it some bigger due to
coincidental(??) surfaces in csg
}
#declare counter = 0;
#while (counter<numberOfSegments)
box
{
<boxStartX,-0.01,-boxHalfDepth>
<boxEndX,tableTopsHeigth+0.01,boxHalfDepth>
rotate y*(counter * segmentsAngle)
}
#declare counter = counter +1;
#end
}
Post a reply to this message
|
|