We
first need to
compute
the required informations (the edge structure, see
"How it works") and to
generate all the needed files. To do this :
- Launch
PovEdge
- Choose
the input file (which must contain
one or several 'mesh2' declarations for which you want the edges
rendered). By default, the output directory will be the same as the one
of the input file, you can change it if needed.
- It
is recommended to select the 'add filename' option:
PovEdge will then append the name of the input file to the name of the
edge objects and of the declaration file. However, if your file
contains
only a single mesh2 declaration, and if you want to keep the names as
simple as possible, don't select the 'add filename' option.
- Hit
the 'Run' button. PovEdge will parse your input file for
'mesh2' declarations, and will generate all the needed files for each
mesh. A progress bar at the bottom shows how things are going. Note
that for a very big mesh, it may take a little while (~a few minutes).
- That's
it ! You now have all the files you need, so quit the
PovEdge application, and go now to your Pov scene file.
A
few things need to be declared for the macro computing the edges. See
the
example scene file
for an example of these declarations.
- The
effective point of vue must be declared as 'PdV1'.
As the silhouette edge depends on the point of view, the macro needs to
know its location, and it must have the name
'PdV1'. If
no transformations are applied to the mesh2 objects, then PdV1 is simply the
location of the camera. However, if some transformations (like scale,
translate, rotate) are applied, then PdV1 is obtained
from the location of the camera by applying the inverse transformations
in reverse order. See the Transformations
page for more informations and examples.
- You
need to define the scale for the width of the edges, with
the parameters 'EdScale'
(for the silhouette edges) and 'EdNScale'
(for the crease edges). If you don't define these, they have the
default value of 1, but the correct value depends on your scene scale,
and of course on how thin/wide you want the edges to appear. The radius
of the cylinders forming the edges are multiplied by EdScale
(silhouette
edge) or EdNScale (crease edge).
- You
must now include the file "declarations_myfile.inc", where
'myfile' is the name of your input file (without the '.inc'). This must
be done after steps 1
and 2. This include file contains all the necessary
declarations and includes to get the edge objects calculated. For a
basic use, you don't need to look at the contents of this file.
However, a lot of fine tuning can be done by making some changes
directly to this file.
- Simply
add 'object{Edges_myfile} ', and the edges will be added
to your scene. Note that you also have to keep your standard mesh
object, otherwise all the edges will be visible. If you apply
transformations to your mesh objects, the same should be applied to the
object 'Edges_myfile".
- Two optional but useful
parameters: 'EdThresh' and 'EdBorder'. These
two parameters have to be defined before step 3 if you want another
value than the default one. 'EdThresh'
defines the threshold for the crease edge, and should be between
0 and 1. A value of 0 means no crease edges at all, while 1
means
that all edges are crease edges (this gives a wireframe version of the
mesh). Default value is 0.6. 'EdBorder'
defines whether edges that form a border (for example for a mesh with
holes) are shown or not. 1 means these border edges are shown, 0 means
they are not shown.