Categories:
-
3d 96 articles
-
animations 16 articles
-
architecture 47 articles
-
blender 98 articles
-
bédé 19 articles
-
techdrawing 24 articles
-
freecad 174 articles
-
gaming 1 articles
-
idsampa 8 articles
-
inthepress 8 articles
-
linux 57 articles
-
music 1 articles
-
nativeifc 15 articles
-
opensource 252 articles
-
orange 4 articles
-
photo 16 articles
-
projects 35 articles
-
receitas 176 articles
-
saopaulo 18 articles
-
sketches 162 articles
-
talks 25 articles
-
techdrawing 24 articles
-
textes 7 articles
-
trilhas 3 articles
-
urbanoids 1 articles
-
video 47 articles
-
webdesign 7 articles
-
works 151 articles
Archives:
Vector renderer for FreeCAD
The OpenCasCade kernel of FreeCAD already provides a way to project 3d objects on a 2d plane. That is what we use now in the Drawing module. But it does it by calculating the shown and hidden segments of the object's edges, and can only output a bunch of lines. Nice for simple views, but not enough for architecture documents, where we want to be able to "paint" our 2d areas with solid or hatch fills.
So I ended up writing a complete new vector rendering module, inspired by earlier experiments for blender such as Pantograph or VRM. Both are based on the Painter algorithm, which is a way to render objects by depth order, so the upper objects hide the lower ones.
SVG works exactly that way, so it is totally appropriate. The big problem is to sort the faces of 3D objects by their depth in relation to the point of view. It may look simple, but it is a quite complex problem, you cannot simply consider the faces centerpoint, you need to do a serie of tests to know which face is closer. Finally, I found this article that explains step-by-step several tests to do. I implemented this in a new module and it works already fairly good and fast:
The Arch section plane already uses it by default:
Of course this is still preliminar work and will probably fail in many complex cases, but I'm already pretty happy to have the main algorithm working.
Preliminary sections support is also working: