|
|
Consider this prism
prism {
linear_sweep
cubic_spline
0, 1, 18,
<3,-5>, <3,5>, <-5,0>, <3, -5>, <3,5>, <-5,0>,
<2,-4>, <2,4>, <-4,0>, <2,-4>, <2,4>, <-4,0>,
<1,-3>, <1,3>, <-3,0>, <1, -3>, <1,3>, <-3,0>
pigment { color rgb<0,1,0> }
}
I want to draw the biggest sphere with the centre of <0,0,0> which can fit
within the inner part of the prism (not the whole prism; and then, min_extent
and max_extent are useless here).
Is there a direct way to do so?
I came with an idea to check a set of spheres in a loop,
#local i = 0.1;
#while(i<1000)
#if(CONDITION)
sphere{<0,0,0>,1.8 pigment{color rgb<1,1,1>}}
#break
#end
#local i = i+0.1;
#end
I need the CONDITION.
Since we should run this test in a loop, the performance is of utmost
importance.
Note that y-axis is not important here. We can draw the prism from -1000 to 1000
and find the biggest sphere, which is not visible from outside.
Post a reply to this message
|
|