|
![](/i/fill.gif) |
Bart as you correctly said I can use this as a starting point and I will
continue to investigate beziers. However I think (could be wrong) your
solution only works if the two lines either side of the corner are the same
length... for example this does not work... but I say again it does give me a
start point to think about.
//Setup for corner points
#declare C1 = <0,0>;
#declare C2 = <4,0>;
#declare C3 = <4,16>;
#declare C4 = <0,16>;
//Create array given desired corner radius of 1
#declare A=array[8]
{
C1 + <1,0>
C2 - <1,0>
C2 + <0,1>
C3 - <0,1>
C3 - <1,0>
C4 + <1,0>
C4 - <0,1>
C1 + <0,1>
}
// Here some real cubic curves are used for corners
prism {
linear_sweep // or conic_sweep for tapering to a point
bezier_spline // linear_spline | quadratic_spline |
cubic_spline |
bezier_spline
-0.5, // height 1
0.5, // height 2
8*4, // number of points
BezierLine( A[0], A[1] ),
Corner( A[0], A[1], A[2],A[3]),
BezierLine( A[2], A[3] ),
Corner( A[2], A[3], A[4],A[5]),
BezierLine( A[4], A[5] ),
Corner( A[4], A[5], A[6],A[7]),
BezierLine( A[6], A[7] ),
Corner( A[6], A[7], A[0], A[1])
// [open]
sturm
texture{Texture}
translate x*-9
}
sphere { A[0] 0.1 pigment{Red} rotate 90*x translate <-9,0.5,0>}
sphere { A[1] 0.1 pigment{Red} rotate 90*x translate <-9,0.5,0>}
sphere { A[2] 0.1 pigment{Red} rotate 90*x translate <-9,0.5,0>}
sphere { A[3] 0.1 pigment{Red} rotate 90*x translate <-9,0.5,0>}
sphere { A[4] 0.1 pigment{Red} rotate 90*x translate <-9,0.5,0>}
sphere { A[5] 0.1 pigment{Red} rotate 90*x translate <-9,0.5,0>}
sphere { A[6] 0.1 pigment{Red} rotate 90*x translate <-9,0.5,0>}
sphere { A[7] 0.1 pigment{Red} rotate 90*x translate <-9,0.5,0>}
Post a reply to this message
|
![](/i/fill.gif) |