Difference between revisions of "User:Le Forgeron/rational bezier patch"

From POV-Wiki
Jump to navigation Jump to search
(Created page with "{{User:Le_Forgeron/HgPovray38/soon}} == rational_bezier_patch == syntax is <pre> rational_bezier_patch { Usize, Vsize [accuracy Precision] ULINE (repeated Vsize time) ...")
 
Line 3: Line 3:
  
 
== rational_bezier_patch ==
 
== rational_bezier_patch ==
 
+
=== syntax ===
 
syntax is
 
syntax is
 
<pre>
 
<pre>
Line 15: Line 15:
 
WEIGHTED_POINT := < X, Y, Z, W >
 
WEIGHTED_POINT := < X, Y, Z, W >
 
</pre>
 
</pre>
 +
=== sample ===
 
[[Image:LeForgeronRBP.png|Rational_Bezier_Patch]]
 
[[Image:LeForgeronRBP.png|Rational_Bezier_Patch]]
 
<source lang="pov">
 
<source lang="pov">
Line 62: Line 63:
 
}
 
}
 
</source>
 
</source>
 +
 +
=== as mesh ===
 +
The <code>rational_bezier_patch</code> is [[User:Le_Forgeron/UVMeshable|UVMeshable]].

Revision as of 08:31, 4 July 2018


rational_bezier_patch

syntax

syntax is

rational_bezier_patch {
  Usize, Vsize [accuracy Precision]
  ULINE (repeated Vsize time)
  [OBJECTS_MODIFIERS...] 
 }

ULINE := WEIGHTED_POINT (repeated Usize time)
WEIGHTED_POINT := < X, Y, Z, W >

sample

Rational_Bezier_Patch

#version 3.7;
global_settings{ assumed_gamma 1.0 }

camera {location -30*z
direction z
up y
right x*image_width/image_height
angle 25
rotate 40*x
}

#include "colors.inc"
#include "woods.inc"
cylinder { -6*y, 4*y, 1 open texture { pigment { White } } }

#declare RA = seed(122);

light_source { -100*z, 1 }
light_source { 100*y, 1 }
light_source { 100*y-100*z, 1 }
light_source { 100*y-100*x, 1 }

plane { y, -6
texture { checker texture { pigment { Yellow } }  texture { pigment { Green } } }
}
#declare Texture = texture { T_Wood5 rotate 90*x };
#declare R1=2;
#declare R2=3;
#declare R3=4;
#declare R4=5;
#declare R5=6;
#declare S=1/5;
#declare N=8/S;
rational_bezier_patch{ 5,N+1 // accuracy 0.0000001
#for(i,-4,4,S)
#local In=rand(RA);
<(R1+In)*cos(i),i,(R1+In)*sin(i),1> 
<(R2+In/2)*cos(i),i+2*rand(RA),(R2+In/2)*sin(i),0.707> 
<R3*cos(i),i,R3*sin(i),1> 
<(R4-In/2)*cos(i),i-2*rand(RA),(R4-In/2)*sin(i),0.707> 
<(R5-In)*cos(i),i,(R5-In)*sin(i),1> 
#end
texture { uv_mapping Texture scale <1/4, 1/34,1> }
}

as mesh

The rational_bezier_patch is UVMeshable.