|
|
The file is here:
http://news.povray.org/povray.binaries.scene-files/thread/%3Cweb.5551a29627d064353f4ed4340%40news.povray.org%3E/
You can just include it and use the macro:
//------coding here------------
#include "blending_polygon_circle_shape.inc"
object{
Shape_Polygon_To_Circle_Blending(5, x, 0.3, 0.1, 0.8)
pigment{rgb<0.5,0.56,0.5>}
}
//---------------------------
1. The macro create a shape that blend a regular polygon of which center is at
<0,0,0>, to a circle of which center at <0,0, height>.
2. The first parameter is the number of sides of the polygon.
3. The second parameter is a vector.
4. The third parameter is the circumscribed circle radius of the polygon.
5. The fourth parameter is the radius of the circle.
6. The fifth parameter is the height of the shape.
Post a reply to this message
|
|
|
|
"And" <49341109@ntnu.edu.tw> wrote:
> The file is here:
>
http://news.povray.org/povray.binaries.scene-files/thread/%3Cweb.5551a29627d064353f4ed4340%40news.povray.org%3E/
>
> You can just include it and use the macro:
>
> //------coding here------------
> #include "blending_polygon_circle_shape.inc"
>
> object{
> Shape_Polygon_To_Circle_Blending(5, x, 0.3, 0.1, 0.8)
> pigment{rgb<0.5,0.56,0.5>}
> }
>
>
> //---------------------------
>
> 1. The macro create a shape that blend a regular polygon of which center is at
> <0,0,0>, to a circle of which center at <0,0, height>.
>
> 2. The first parameter is the number of sides of the polygon.
> 3. The second parameter is a vector.
> 4. The third parameter is the circumscribed circle radius of the polygon.
> 5. The fourth parameter is the radius of the circle.
> 6. The fifth parameter is the height of the shape.
Thanks!
Post a reply to this message
|
|
|
|
"And" <49341109@ntnu.edu.tw> wrote:
> The file is here:
>
http://news.povray.org/povray.binaries.scene-files/thread/%3Cweb.5551a29627d064353f4ed4340%40news.povray.org%3E/
>
> You can just include it and use the macro:
>
> //------coding here------------
> #include "blending_polygon_circle_shape.inc"
>
> object{
> Shape_Polygon_To_Circle_Blending(5, x, 0.3, 0.1, 0.8)
> pigment{rgb<0.5,0.56,0.5>}
> }
>
>
> //---------------------------
>
> 1. The macro create a shape that blend a regular polygon of which center is at
> <0,0,0>, to a circle of which center at <0,0, height>.
>
> 2. The first parameter is the number of sides of the polygon.
> 3. The second parameter is a vector.
> 4. The third parameter is the circumscribed circle radius of the polygon.
> 5. The fourth parameter is the radius of the circle.
> 6. The fifth parameter is the height of the shape.
even it is correct, odd it is incorrect
Post a reply to this message
Attachments:
Download 'polynomcircle.jpg' (59 KB)
Preview of image 'polynomcircle.jpg'
|
|
|
|
"And" <49341109@ntnu.edu.tw> wrote:
> Could you give me an example (code)?
>
> I never saw it.
#version 3.7;
global_settings {
}
background {rgbt<0.05, 0.05, 0.05, 0>}
#declare Default_texture = pigment {rgb 0.8}
#declare Material = texture {pigment {rgbt <0.8,0.8,0.8,0>}}
#declare height = 0.5;
#declare poly_n = 3;
#declare poly_r = 0.5;
#declare cycle_r = 0.13;
#declare an = 2*pi/poly_n;
#declare poly_thr = poly_r*cos(an/2);
#declare bound=max(cycle_r,poly_r);
#declare multi = 10;
#declare poly_obj =
polynomial{
4,
xyz(0,2,2):multi*1,
xyz(2,0,1):multi*2*height,
xyz(1,0,2):multi*2*(poly_thr-cycle_r),
xyz(2,0,0):multi*(-pow(height, 2)),
xyz(0,0,2):multi*(-pow(cycle_r - poly_thr, 2)),
xyz(1,0,1):multi*2*height*(-2*poly_thr + cycle_r),
xyz(1,0,0):multi*2*pow(height,2)*poly_thr,
xyz(0,0,1):multi*2*height*poly_thr*(poly_thr - cycle_r),
xyz(0,0,0):multi*(-pow(poly_thr*height, 2))
sturm
}
#declare mockup2 =
difference{
cylinder{
<0,0,0.0>,<0,0,height>, bound
}
#for(i, 0, poly_n-1)
object{
poly_obj
inverse
rotate <0,0,degrees(an*i)>
}
plane{
<1,0,0>,-poly_thr
rotate <0,0,degrees(an*i)>
}
#end
texture {pigment {rgb 1}}
scale 3
rotate <0,90,90>
}
mockup2
light_source {
<4.08,5.9,5.1>
color rgb<1, 1, 1>
}
camera {
location <0, 0, 0>
look_at <0, 0, -1>
right <-1.7777777777777777, 0, 0>
up <0, 1, 0>
angle 49.134343
rotate <-27.098163, 46.688390, -0.903519>
translate <7.481132, 5.343666, 6.507640>
}
Post a reply to this message
|
|