Raytracing API example/fr

Introduction
Les modules et  fournissent plusieurs méthodes pour écrire le contenu d'une scène sous forme de données povray ou luxrender.

Les commandes les plus utiles sont et  pour restituer un objet Part FreeCAD dans une définition de type povray ou luxrender et  et  pour obtenir le point de vue actuel de la fenêtre de vue 3D au format povray ou luxrender.

Sortie de fichiers de rendu
Here is how to write a povray file from python, assuming your document contains a "Box" object:

And the same for luxrender:

Creating a custom render object
Apart from standard povray and luxrender view objects that provide a view of an existing Part object, and that can be inserted in povray and luxrender projects respectively, a third object exist, called RaySegment, that can be inserted either in povray or luxrender projects. That RaySegment object is not linked to any of the FreeCAD objects, and can contain custom povray or luxrender code, that you might wish to insert into your raytracing project. You can also use it, for example, to output your FreeCAD objects a certain way, if you are not happy with the standard way. You can create and use it like this from the python console: