A simple tool to draw the edges of your mesh objects in PovRay


How it works

How to use



Example scene file



©Thibaut Jonckheere  

Contact :
tuabihtucl at yahoo dot fr

    There are only two simple steps needed to have the edges of some mesh objects rendered in your PovRay image.
Run the PovEdge application
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 :
  1. Launch PovEdge  
  2. 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.
  3. 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.
  4. 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).
  5. That's it ! You now have all the files you need, so quit the PovEdge application, and go now to your Pov scene file.

Add declarations in the 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.
  1. 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.
  2. 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).
  3. 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.
  4. 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".  
  5. 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.