TABLE OF CONTENTS


ScPovPlot3D/WireSurf.inc [ Modules ]

[ Top ] [ Modules ]

PURPOSE

Macros for representation of 3D surfaces as wireframes

DESCRIPTION

    

   Fig.[WireFrame] Linear (twice), Cubic and BSpline interpolation

SYNOPSIS

* *********************************************************
* **   Tested on PovRay 3.7                              **
* **   License: GNU GPL                                  **
* **   Homepage:    http://scpovplot3d.sourceforge.net   **
* *********************************************************
* **   version: 4.0.0.2 (& have a nice time ;)             **
* *********************************************************

AUTHOR

Janusz Opiła Ph.D.

   jmo@agh.edu.pl, janusz.opila@gmail.com
   Dept. of Applied Informatics
   AGH University of Science & Technology, Cracow, Poland
   Maintained by Janusz Opiła Ph.D.

HISTORY

2021-06-09/2 - correction of computing radius of the wires and nodes. Now looks identical in all styles. 2021-06-09 - b_spline{} sphere_sweep curated, now works as it should

              b_spline is described in doc like cubic spline, in fact it is 
              Bezier with two extra eksternal points.                 

COPYRIGHT

  GNU GPL v.3 License
  (c) 2012-now by Janusz Opiła Ph.D.         
  AGH University of Science and Technology

WireSurf.inc/DrawBSplineWires() [ Main macros ]

[ Top ] [ WireSurf.inc ] [ Main macros ]

PURPOSE

Draws surface representation in the form of grid of Bezier splines, full implementation

SYNOPSIS

DrawBSplineWires2B(float _Stfns, float _wireR, boolean _Sphrs)

INPUTS

  _Stfns - float > 0 = "straightness" of the spline; the bigger the more spline resembles straight lines;
                     = length of control point handles = 1/_Stfns [p.u.], values <= 0 ignored 
  _wireR - float > 0 = radii of the wire [p.u.], values <= 0 ignored, usually equals 1.0
  _Sphrs - boolean   = draw spheres in place of nodes? yes/no

SEE ALSO

ImportDataRC() ImportDataXY() DrawNodePoints() DrawLinearWires() DrawCubicWires()


WireSurf.inc/DrawCubicWires() [ Main macros ]

[ Top ] [ WireSurf.inc ] [ Main macros ]

PURPOSE

Draws surface representation in the form of grid of LINEAR splines, ie. straight cuts of line

SYNOPSIS

DrawCubicWires(float _wireR, boolean _Sphrs)

INPUTS

  _wireR - float   = radii of the wire
  _Sphrs - boolean = draw spheres in place of nodes? yes/no

SEE ALSO

ImportDataRC() ImportDataXY() DrawNodePoints() DrawLinearWires() DrawBSplineWires()


WireSurf.inc/DrawLinearWires() [ Main macros ]

[ Top ] [ WireSurf.inc ] [ Main macros ]

PURPOSE

Draws surface representation in the form of grid of LINEAR splines, ie. straight cuts of line

SYNOPSIS

DrawLinearWires(float _wireR, boolean _Sphrs)

INPUTS

  _wireR  - float   = radii of the wire
  _Sphrs  - boolean = draw spheres in place of nodes? yes/no

SEE ALSO

ImportDataRC() ImportDataXY() DrawNodePoints() DrawCubicWires(), DrawBSplineWires()


WireSurf.inc/DrawNodePoints() [ Main macros ]

[ Top ] [ WireSurf.inc ] [ Main macros ]

PURPOSE

Draws grid data points as ellipsoids ie. spheres scaled along vertical axis by _scl factor. If _scl equals 1 one obtains pure sphere, however it can be lower or bigger than 1 This macro is designed to visualize uncertainty at given grid point

SYNOPSIS

DrawNodePoints(float _scl)

INPUTS

  _scl - scaling factor along vertical axis, not perpendicularly to the surface!
  this is intended for representation of uncertainty of all the data (SD? SEM?)

WireSurf.inc/DrawWireFrameRC(), DrawWireFrame() [ Main macros ]

[ Top ] [ WireSurf.inc ] [ Main macros ]

PURPOSE

Draws representation od data from input file as wireframed 3D surface. Input data is organized as a matrix of floats separated by commas. This macro is intendend for visualisation of matrices thus "RC" suffix (Row/Column). macro DrawWireFrame(DataFileName) is just backward compatibility wrapper

SYNOPSIS

DrawWireFrameRC(string filename DataFileName)

INPUTS

   DataFileName - valid name of file with data - see example file for details
   of its structure. Generally speaking first is Column axis title, Row Yaxis title,
   number of columns, then min and max value assigned to the first and last item in row,
   number of rows, then min and max value assigned to the first and last item in column,
   eventually numeric data in form of matrix, ie. data measured, observed or
   calculated over the grid

SEE ALSO

DrawWireFrameYX()

SOURCE

/// #macro DrawWireFrameRC(DataFileName) is intendend for visualisation of matrices
/// interpretation of structure of input file (r=Row, c=Column):
///  * -----> Column ---->
///  |  r1c1 r1c2 r1c3 r1c3
///  |  r2c1
///  |  r3c1...
///  V  r4c1..
/// Rows
///  ie. rows are treated as rows of the matrix so they are drawn
///  along PovRAY X  axis (which is Y in REAL coords).

WireSurf.inc/DrawWireFrameXY() [ Main macros ]

[ Top ] [ WireSurf.inc ] [ Main macros ]

PURPOSE

Draws representation od data from input file as wireframed 3D surface. Input data is organized as a matrix of floats separated by commas. This macro is intendend for visualisation of gridded data thus "YX" suffix.

SYNOPSIS

DrawWireFrameXY(string filename DataFileName)

INPUTS

   DataFileName - valid name of file with data - see example file for details
   of its structure. Generally speaking first is Xaxis title, Yaxis title,
   number of columns, then min and max value assigned to the items in first and last X column respectively (along POVRay X axis),
   number of rows, then min and max value assigned to the items in first and last row respectively (along POVRay -Z axis),
   eventually numeric data in form of matrix, ie. data measured, observed or
   calculated over the real XY grid

SOURCE

/// interpretation of structure of input file:
///  * -----> X ---->
///  |  x1y1 x1y2 x1y3 x1y3
///  |  x2y1
/// Y|  x3y1...
///  V  X4y1..
///  ie. rows are treated as x-data so they are drawn
///  along REAL X  axis (which is -Z in PovRAY coords) ,

WireSurf.inc/ImportDataRC() [ Main macros ]

[ Top ] [ WireSurf.inc ] [ Main macros ]

PURPOSE

Imports only data from input file. Input data is organized as a matrix of floats separated by commas. This macro is part of visualisation suite of matrices thus "RC" suffix (Row/Column).

SYNOPSIS

ImportDataRC(string filename DataFileName)

INPUTS

   DataFileName - valid name of file with data - see example file for details
   of its structure. Generally speaking first is Column axis title, Row Yaxis title,
   number of columns, then min and max value assigned to the first and last item in row,
   number of rows, then min and max value assigned to the first and last item in column,
   eventually numeric data in form of matrix, ie. data measured, observed or
   calculated over the grid

SOURCE

/// structure  of the grid is interpreted as follows:
///  * -----> Col ---->
/// R|  r1c1 r1c2 r1c3 r1c4
/// o|  r2c1
/// w|  r3c1...
///  V  r4c1..
///  ie. rows are treated as x-data so they are drawn along REAL X axis (PovRAY '-Z')

WireSurf.inc/ImportDataXY() [ Main macros ]

[ Top ] [ WireSurf.inc ] [ Main macros ]

PURPOSE

Imports representation od data from input file. Input data is organized as a matrix of floats separated by commas. This macro is intendend for visualisation of gridded data thus "YX" suffix.

SYNOPSIS

ImportDataXY(string filename DataFileName)

INPUTS

   DataFileName - valid name of file with data - see example file for details
   of its structure. Generally speaking first is Xaxis title, Yaxis title,
   number of columns, then min and max value assigned to the items in first and last X column respectively (along POVRay X axis),
   number of rows, then min and max value assigned to the items in first and last row respectively (along POVRay -Z axis),
   eventually numeric data in form of matrix, ie. data measured, observed or
   calculated over the real XY grid

SOURCE

/// structure  of the grid is interpreted as follows:
///  * -----> X real axis ---->
///  |  x1y1 x2y1 x3y1 x4y1
///  |  x1y2
/// Y|  x1y3...
///  V  X1y4..
///  ie. rows are treated as x-data so they are drawn
///  along REAL X  axis /-Z in PovRAY coords/ ,

WireSurf.inc/AddColDescr() [ Helper macros ]

[ Top ] [ WireSurf.inc ] [ Helper macros ]

PURPOSE

Inserts into horizontal axis data block new major label

SYNOPSIS

AddColDescr(string Dscr)

INPUTS

   Dscr - label ("1", "A" or so on..)

WireSurf.inc/AddRowDescr() [ Helper macros ]

[ Top ] [ WireSurf.inc ] [ Helper macros ]

PURPOSE

Inserts into 2nd horizontal axis data block new major label

SYNOPSIS

AddRowDescr(string Dscr)

INPUTS

   Dscr - label ("1", "A" or so on..)

WireSurf.inc/DrawColDscr() [ Helper macros ]

[ Top ] [ WireSurf.inc ] [ Helper macros ]

PURPOSE

Inserts into rendering stack description of horizontal axis

SYNOPSIS

DrawColDscr(texturedef _Txtr, float _LettrBase, float _LettrSize, float _LettrDepth)

INPUTS

   _Txtr       - texture definition
   _LettrBase  - adjustment to the position of description
   _LettrSize  - Size of characters in description Text
   _LettrDepth - thickness of characters in description Text

WireSurf.inc/DrawRowDscr() [ Helper macros ]

[ Top ] [ WireSurf.inc ] [ Helper macros ]

PURPOSE

Inserts into rendering stack description of 2nd horizontal axis

SYNOPSIS

DrawRowDscr(texturedef _Txtr, float _LettrBase, float _LettrSize, float _LettrDepth)

INPUTS

   _Txtr       - texture definition
   _LettrBase  - adjustment to the position of description
   _LettrSize  - Size of characters in description Text
   _LettrDepth - thickness of characters in description Text

WireSurf.inc/DrawVrtDescr() [ Helper macros ]

[ Top ] [ WireSurf.inc ] [ Helper macros ]

PURPOSE

Draws automatically vertical axis description,

SYNOPSIS

DrawVrtDescr(uinteger _NVrt, texturedef _Texture)

INPUTS

   _NVrt - number of major tics
   _Texture - texture identifier

WireSurf.inc/InitDscrColAxe() [ Helper macros ]

[ Top ] [ WireSurf.inc ] [ Helper macros ]

PURPOSE

Initializes description data block along horizontal axis (columns)

SYNOPSIS

InitDscrColAxe(uinteger N)

INPUTS

   N - number of categories

WireSurf.inc/InitDscrRowAxe() [ Helper macros ]

[ Top ] [ WireSurf.inc ] [ Helper macros ]

PURPOSE

Initializes description data block along horizontal axis (rows)

SYNOPSIS

InitDscrRowAxe(uinteger N)

INPUTS

   N - number of categories

WireSurf.inc/SetBgPicture() [ Helper macros ]

[ Top ] [ WireSurf.inc ] [ Helper macros ]

PURPOSE

Sets picture for the background of coords system Will be moved to CoordsSys.inc

SYNOPSIS

#macro SetBgPicture(_Pct)

INPUTS

   string_fn Pct

WireSurf.inc/SetColor() [ Helper macros ]

[ Top ] [ WireSurf.inc ] [ Helper macros ]

PURPOSE

Sets default color for different items:


WireSurf.inc/SetDscrAngle() [ Helper macros ]

[ Top ] [ WireSurf.inc ] [ Helper macros ]

PURPOSE

Sets initial angle of description of axes (category labels)

SYNOPSIS

#macro SetDscrAngle(_ls)

INPUTS

   float _ls - contains finish {} section for background images

SEE ALSO


WireSurf.inc/SetInterior() [ Helper macros ]

[ Top ] [ WireSurf.inc ] [ Helper macros ]

PURPOSE

declares texure for the item

SYNOPSIS

SetInterior( interiordef tInt )

WireSurf.inc/SetLettrBase() [ Helper macros ]

[ Top ] [ WireSurf.inc ] [ Helper macros ]

PURPOSE

Sets base position of letters in description of axes

SYNOPSIS

SetLettrBase(float ls)

WireSurf.inc/SetLettrDepth() [ Helper macros ]

[ Top ] [ WireSurf.inc ] [ Helper macros ]

PURPOSE

Sets size of letters in description of axes

SYNOPSIS

SetLettrDepth(float ls)

WireSurf.inc/SetLettrSize() [ Helper macros ]

[ Top ] [ WireSurf.inc ] [ Helper macros ]

PURPOSE

Sets size of letters in description of axes

SYNOPSIS

SetLettrSize(float ls)

WireSurf.inc/SetMaterial() [ Helper macros ]

[ Top ] [ WireSurf.inc ] [ Helper macros ]

PURPOSE

declares material for the item

SYNOPSIS

SetMaterial( materialdef FullMaterial )

WireSurf.inc/SetNodeRadiiCoeff(Coeff) [ Helper macros ]

[ Top ] [ WireSurf.inc ] [ Helper macros ]

PURPOSE

declares radius coefficient for the wire and nodes

SYNOPSIS

SetNodeRadiiCoeff(float Coeff)

WireSurf.inc/SetTexture() [ Helper macros ]

[ Top ] [ WireSurf.inc ] [ Helper macros ]

PURPOSE

declares texure for the item

SYNOPSIS

SetTexture( texturedef FullTexture )

WireSurf.inc/SetWireRadiiCoeff ( _Coeff ) [ Helper macros ]

[ Top ] [ WireSurf.inc ] [ Helper macros ]

PURPOSE

declares radius coefficient for the wire only

SYNOPSIS

SetWireRadiiCoeff(float _Coeff)

WireSurf.inc/TurnPhotonsDown(), TurnPhotonsUp() [ Helper macros ]

[ Top ] [ WireSurf.inc ] [ Helper macros ]

PURPOSE

Sets internal variable Photons to 'no' or 'yes' ie turns photon mechanism 'off' or 'on'

SYNOPSIS

TurnPhotonsUp()
TurnPhotonsDown()

WireSurf.inc/DeclareLevel [ Variables ]

[ Top ] [ WireSurf.inc ] [ Variables ]

PURPOSE

DeclareLevel variable determines what is defined:

this value is valid until the next "Set...()" declaration is met few more default internal values

SOURCE

#declare DeclareLevel = 0;
#declare NodeRadiiCoeff=0.20;
#declare WireRadiiCoeff=NodeRadiiCoeff/sqrt(2);

#declare shiftXY    = -1.4;
#declare LettrSize  =  0.8;
#declare LettrDepth =  0.2;
#declare LettrBase  = -0.7;
#declare DscrAngle  =  0.0;
#declare NumDscrLgh =  5;
#declare NumDscrDig =  3;

#declare NRow = 1;
#declare NCol = 1;