During the last week, the question of how to implement the clipping of imported meshes was investigated. Mesh clipping is necessary for two reasons. One reason is that the internal renderer does clipping. The camera has two properties called near and far clipping distances, which define the locations of near and far XY planes (referred to as view planes), and only the objects that reside between the two view planes are rendered. When objects touch the view planes, part of them out of the interval is clipped and becomes invisible. It is remarked that the clipping distance properties were previously not respected by the Freestyle renderer. The other reason is that objects that (partially) come behind the camera cause a crash of the Freestyle renderer during the view map creation. The near view plane can be effectively used to exclude the objects behind the camera in advance of the view map creation.
For these reasons, a straightforward clipping algorithm was implemented in revision 26233 of the branch. Mesh objects are clipped by the near and far view planes specified with the clipping distance properties of the active camera. When meshes are partially clipped, new edges are created at the intersections with the view planes. These edges can result in visible strokes if they are within the camera view.
As of this writing, simple test scenes with objects behind the camera are successfully rendered. More complex scenes pose a problem in stroke rendering and possibly result in a crash, which seems related to a lot of “strip vertex 0 non valid” warning messages often observed in complex scenes (the number in the warning may vary). This problem is apparently independent of the instability issues we have been addressing with regard to the view map creation. Further consolidation of the stroke rendering will be attempted in the next weeks. Branch users are encouraged to test Freestyle with complex scenes (possibly having objects behind the camera). Problem reports are always very welcome.