|
|
William F Pokorny <ano### [at] anonymousorg> wrote:
> Le_Forgeron was careful to exclude the control points and use only the
> inner loop, but seems like using all points would work in this
> particular case...
Yes, Kima was a little light on the details, and a render or a small functional
scene rendering the actual prism of interest would help...
And as you say, depending [up]on the actual points used as control points, they
may be part of the actual prism - or not. In this case I'm guessing that they
are.
> My first guess would be not all the points were walked in your case -
> that you perhaps left the for loop end the same? Supposing you have the
> loop start and end right, the second guess would be there is something
> going on when there are loops within loops. This certainly not the
> normal set up when walking a spline.
It looked right to me when I coded it... But then of course so many things do
;) :D
I added the spheres for the prism points and It still seems right to me, but
then I guess it all really depends at this point on what the OP's original
intention was.
#version 3.8;
global_settings {assumed_gamma 1.0}
#default {finish {emission 0.5 diffuse 0.5}}
camera {orthographic
location -90*y
up z
right -image_width/image_height*x
look_at 0
angle 12.5
}
light_source {<-1, -1, 0.5>*40, 1}
#declare Points =
array {
< 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>
}
#declare Numpoints = dimension_size (Points, 1);
#declare Bottom = 0;
#declare Top = 1;
prism {
linear_sweep
cubic_spline
Bottom, Top, Numpoints,
#for (N, 0, Numpoints-1)
Points [N]
#end
pigment {rgb <0, 1, 0> }
}
#for (N, -1, Numpoints-2)
#local P = <Points [N+1].x, -5, Points [N+1].y>;
sphere {P, 0.1 pigment {rgb <1, 1, 1>}}
#end
#declare Sp =
spline {
cubic_spline
#for (N, -1, Numpoints-2)
N, Points [N+1],
#end
}
#declare LOWEST = 10;// big enough to start
#for(i, 0, 3, 0.01)
#local Pt = <Sp(i).x, 0, Sp(i).y>;
#local LENGTH = vlength(Pt);
#declare LOWEST = min (LOWEST, LENGTH);
#end
#debug concat ("\n
Largest radius of fitting cylinder is ",
str (LOWEST, 3, 3), "\n")
sphere {0, LOWEST pigment {color red 1 }}
Post a reply to this message
|
|