Reference:Meshmaker.inc

From POV-Wiki
Revision as of 13:42, 10 June 2017 by Clipka (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

meshmaker.inc - various mesh2 objects by splines.

MSM(SplineArray, SplRes, Interp_type, InterpRes, FileName)
Generates a mesh2 from an array of splines and optionally writes the mesh2 object as a file of the given FileName.
The uv_coordinates come from the square <0,0> - <1,1>.
The spline is evaluated from t=0 to t=1.
For the normal calculation, it is required that all splines (also linear_spline) have one extra point before t=0 and after t=1.
BuildWriteMesh2(VecArr, NormArr, UVArr, U, V, FileName)
Generates and optionally writes a mesh2 object based on 3 input arrays, the number of quads in U and V direction and a filename.
VecArr : The array that contains the vertices of the triangles in the mesh.
NormArr : The array with the normal vectors that go with the vertices.
UVArr : The array containing the uv_vectors.
U : The amount of subdivisions of the surface in the u-direction.
V : The amount of subdivisions in the v-direction.
Based on the U and V values the face_indices of the triangles in the mesh are calculated.
FileName : The name of the file to which the mesh will be written. If is an empty string (""), no file will be written.
If the file extension is 'obj' a Wavefront objectfile will be written.
If the extension is 'pcm' a compressed mesh file is written.
If a file name is given, the macro will first check if it already exists.
If that is so, it will try to parse the existing file unless it's a '*.obj', '*.pcm' or '*.arr' file as POV-Ray can not read them directly. In this case a new mesh will be generated, but the existing files will _not_ be over-written.
BuildSpline(Arr, SplType)
A helper macro for MSM()
Generates from a array Arr a spline of the given spline type SplType.
CheckFileName(FileName)
A helper macro for MSM()
If Return has a value of 0 the mesh will not be build, but it will be parsed from file.
LInterpolate(Val, Min, Max)
A helper macro for MSM()
Linear interpolation of a vector or float between Min and Max.
Min : minimal float value or vector.
Max : Maximal float value or vector.
Val : A float in the range 0 - 1.
RangeMM() = function(Val,Rmin,Rmax,Min,Max)
A helper function for MSM()
Adjusts input values in the range [RMin, RMax] to fit in the range [Min, Max]. Val: A float value in the range [Rmin, Rmax].
Parametric(__F1__, __F2__, __F3__, UVmin, UVmax, Iter_U, Iter_V, FileName)
Generates a mesh2 object from the parametric uv functions __F1__, __F2__, __F3__ in the ranges between UVmin and UVmax with the iteration steps Iter_U and Iter_V and optionally saves the mesh2 object as a file with the name FileName.
Paramcalc(UVmin, UVmax, Iter_U, Iter_V, FileName)
The kernel of the macro Parametric(). See Parametric().
Prism1(Spl, ResSpl, PSpl, PRes, FileName)
Generates a mesh2 object by extruding the spline Spl along the y-axis with the resolution spline ResSpl. In every step the spline is scaled by the 'relative' distance from the y-axis of the second spline (PSpl).
The uv_coordinates come from the square <0,0> - <1,1>.
Spl : The spline to be extruded.
The spline is evaluated from t=0 to t=1. For the normal calculation,
it is required that all splines (also linear_spline) have one extra
point before t=0 and after t=1. ResSpl : The amount of triangles to be used along the spline. PSpl : The spline that determines by what amount the extrusion
is scaled in each step. The scaling is based on the relative distance from the y-axis.
That is, at t=0 the scale is always 1, so that the start of the shape is
identical to the spline Spl.
PSpl also sets the height of the resulting shape (its y-value at t=1).
The spline is evaluated from t=0 to t=1. For the normal calculation,
it is required that all splines (also linear_spline) have one extra
point before t=0 and after t=1.
FileName : The name of the file to which the mesh will be written.
If is an empty string (""), no file will be written. If a file name is given, the macro
will first check if it already exists. If that is so, it will expect a
mesh2 with the name "Surface" and try to parse the existing file.
Lathe(Spl, ResSpl, Rot, ResRot, FileName)
This macro generates a mesh2 object by rotating a two-dimensional curve about the y-axis.
The uv_coordinates come from the square <0,0> - <1,1>.
Spl : The spline to be rotated. The spline is evaluated from t=0 to t=1. For the normal calculation, it is required that all splines (also linear_spline) have one extra point before t=0 and after t=1. ResSpl : The amount of triangles to be used along the spline. Rot : The angle the spline has to be rotated.
ResRot : The amount of triangles to be used in the circumference.
FileName : The name of the file to which the mesh will be written.
If is an empty string (""), no file will be written.
If the file extension is 'obj' a Wavefront objectfile will be written.
If the extension is 'pcm' a compressed mesh file is written.
If a file name is given, the macro will first check if it already exists.
If that is so, it will try to parse the existing file unless it's a '*.obj',
'*.pcm' or '*.arr' file as POV-Ray can not read them directly. In this case a new
mesh will be generated, but the existing files will _not_ be over-written.
Coons(Spl1, Spl2, Spl3, Spl4, Iter_U, Iter_V, FileName)
Generates a mesh2 'coons surface' defined by four splines, all attached head to tail to the previous / next one.
The uv_coordinates come from the square <0,0> - <1,1>.
Spl1 - 4 : The four spline that define the surface.
The splines are evaluated from t=0 to t=1.
Iter_U : The resolution for the splines 1 and 3.
Iter_V : The resolution for the splines 2 and 4.
FileName : The name of the file to which the mesh will be written.
If is an empty string (""), no file will be written.
If the file extension is 'obj' a Wavefront objectfile will be written.
If the extension is 'pcm' a compressed mesh file is written.
If a file name is given, the macro will first check if it already exists.
If that is so, it will try to parse the existing file unless it's a '*.obj',
'*.pcm' or '*.arr' file as POV-Ray can not read them directly. In this case a new
mesh will be generated, but the existing files will _not_ be over-written.
TwoVarSurf(__Fuv, Urange, Vrange, Iter_U, Iter_V, FileName)
Generates a mesh2 object by extruding an uv-function. Urange : The range in x direction.
Vrange : The range in y direction.
Iter_U : The resolution in x direction.
Iter_V : The resolution in y direction.
FileName : The name of the file to which the mesh will be written.
If is an empty string (""), no file will be written. If a file name is given, the macro
will first check if it already exists. If that is so, it will expect a
mesh2 with the name "Surface" and try to parse the existing file.
SweepSpline1(Track,Shape,Waist,U,V,Filename)
Generates a mesh2 object by extruding a spline Shape along Track and optionally writes it as a file with method 1.
FileName : The name of the file to which the mesh will be written. If is an empty string (""), no file will be written. If a file name is given, the macro
will first check if it already exists. If that is so, it will expect a
mesh2 with the name "Surface" and try to parse the existing file.
SweepSpline2(Track,Shape,Waist,U,V,Filename)
Generates a mesh2 object by extruding a spline Shape along Track and optionally writes it as a file with method 2.
FileName : The name of the file to which the mesh will be written. If is an empty string (""), no file will be written. If a file name is given, the macro
will first check if it already exists. If that is so, it will expect a
mesh2 with the name "Surface" and try to parse the existing file.