FreeCAD BIM development news- June 2019

Hi friends,

Here goes one more article showing what has been going on this month regarding the development of BIM features in FreeCAD. As usual, a big thank you to you who are helping this effort by sponsoring me on Patreon, Liberapay or Paypal, and also who has been contributing directly to the FreeCAD project on BountySource. We are in the process of building targets to be rewarded by that BountySource money, so hopefully soon that money will be put to good use.

So, here goes the meat of this month:

The Barcelona series video: Schedules and Reporting addon

This month's video shows how to use both the Arch Schedule tool and the Reporting addon to create schedules from your BIM model, and link these schedules to a spreadsheet application to build more complex sheets and reports.

Hope you'll like, next month we'll attack rendering!

Layers

Minute of nostalgia. I know you liked the black background

The big feature of this month is a brand-new layers system in FreeCAD. There was already a tool in the Draft workbench called VisGroup, that was basically a Group object that could set visual aspects (line width, color,...) of its children. The problem was that, being a group, if you added an object to a layer, you removed it from any other group it belonged to.

So now the old VisGroup object has been discarded, and a new, proper Layer object has been created instead. It works basically like layers found in other CAD applications: It sets the color, line width, line style, face color and transparency of its children, and turning a layer on/off turns all its children on/off too.

Like Arch materials, layers live in a special "Layers" group inside your document.

The layers system is completely independent of the groups system, so you can have an object live in a group and also be part of a layer. You choose which system you prefer to use, or both, if you wish so.

You don't need to use layers for everything either, you can use them simply as a convenient way to easily turn a series of objects on/off. Layers have an Override Children property that, if turned off, won't propagate visual aspects like color or line width to their children.

In Draft, the VisGroup tool has been removed and replaced by the Layer tool, found under menu Draft -> Utils. It just creates a new layer.

The AutoGroup feature, that I believe nobody ever used, found on the Draft toolbar, has been revamped into a layers selector. That is, you can now set the active layer from there, and all new Draft and Arch objects will be created in the active layer. This layer selector doesn't displays groups anymore by default, but there is a preference option under menu Edit -> Preferences -> Draft ->General to turn the old behaviour back on.

In the BIM workbench, a new Layers Manager tool has been added. As usual, it is in BIM only for testing and experimenting, as soon as it is stable enough it will be migrated to Draft. It works basically like any other Layer Manager usually found in CAD applications. You can change layers properties, add/remove layers, turn them on/off, isolate them, etc.

Layers are still a very useful tool in many BIM applications ( In "some" of them that don't have layers I often miss them), and they are fully supported by the IFC standard, so this is definitely an important feature to have.

IFC support for it must still be implemented in FreeCAD, that will be done next. There is also still a small issue that if an object is not part of any group, adding it to a layer will make it disappear from the tree root. I'll try to find a way to solve that too.

Finer control over IFC structure export

Under menu Edit -> Preferences -> Import/Export -> IFC you now have several options that control how much you want FreeCAD to add default Sites, Buildings and Storeys to your model when exporting it to IFC.

The IFC standard ask for at least one Building. But the default behaviour among other BIM applications is to always have at least one Site and one Building, and, in some cases, also at least one Storey (Revit, for example, doesn't allow objects to live outside of any level). By turning off some of these options in FreeCAD, you are now able to produce a file without adding default Storeys or Sites, or even a default Building.

The last option will host all objects of your model directly under the root IfcProject, which is technically allowed by the IFC standard, but not supported uniformly by all BIM applications (guess who is having problems with it...). You will get warned at export if you turned this option off and are producing a non-standard file.

The reason of all this is that by turning these options off, you are producing an IFC file that is more faithfully identical to your FreeCAD model, instead of adding "fakes" buildings and storeys in a model you designed without intent to have them. You are the boss, you decide what your model should and should not have. There are many cases where the traditional Site->Building->Storey model doesn't fit.

There is also an ongoing discussion about this on the BuildingSmart forums, and given the lack of enthusiasm of the big guys behind IFC to discuss possible paradigm changes, I am of the same opinion as Ryan, let's hack our way through it, with permission or without permission.

If FreeCAD can be used to demonstrate and possibly propagate things that are not part of the IFC standard but that we find appropriate, it can be a very good way to make these ideas known and adopted by others, and that's how things become standards.

This is of course fully opt-in, if you don't choose purposely to use these options you will still produce standard files as usual. We will of course never force anybody into IFC revolutionary activism But the option is there...

Revamped addons manager

Another big feature of this month is the new Addon Manager tool found under menu Tools, that allows you to install add-on (plug-in) workbenches and macros directly from within FreeCAD. It still works the same way as before, but has a series of visual improvements, the main one being to show a much better description of each addon, taken directly from the README.md file found on their Git repository.

This gives you a much better and more complete idea of what you are installing, what each workbench does, what is its state of development, etc. I also hope it will more and more make addon developers feel like first-class FreeCAD developers, and give them opportunities to showcase their baby more prominently.

If you have the python-git package installed (which is the case in our windows installer, on linux it is usually found in your packages manager on most distros), when starting the addon manager, it will also check for available updates for your installed addons and propose you to update them all at once.

This is not enabled by default yet, you need to turn that feature on using the Configure button.

Under the same configure button, you can now also add custom git repositories, which is not very useful at the moment (we add all workbenches we can find to the official list), but could become useful for example for company-managed FreeCAD deployments, or for testing purposes.

Levels manager integrated with views manager

The BIM workbench had two different tools to manage Building Parts, which are used in FreeCAD to make buildings or levels/storeys, or any other "part of a building": A Levels manager, that you could use to add or remove levels to/from your project and bulk-set some of their properties like level or name, and a Views manager, that you could turn on/off by clicking a button in the status bar.

The Views manager offered a convenient place where all the objects that define views and/or working plane positions (Building Parts, Working Plane Proxies). You could simply double-click any of them to set yourself in the correct working plane (and view if defined), without the need to scroll through your entire model to locate them, then click the Working Plane button.

These two tools have now been merged into one, which still works like the old Views manager. But it has now gained several abilities from the levels manager. You can now easily add/remove objects from there, and bulk-turn them on or off or isolate them.

Clicking any object in the list selects it, double-clicking it sets the working plane to it, and, if a view angle was saved in it, and its "Restore view" property is turned on, the camera will also jump to the saved position.

This is all part of an ongoing effort to make it easier to work on larger BIM models in FreeCAD. You can now, for example, define a Building Part to represent a level (set its IFC type to "Building Storey"), place it correctly in your model (at the correct height), view it from the top and save the camera position, and you can now simply, by double-clicking it in the new Views manager, find yourself in the correct view, with the working plane correctly set, ready to work. Switching from one level to another is just one double-click away.

Interactive IFC import

The IFC explorer tool of the BIM workbench (found under menu Utils) has also gained more functionality: If you enable mesh display, when you click on the different objects that are part of the model, they will be highlighted in the mesh display. The IFC explorer window is now also modal, so you can still manipulate and zoom the 3D view while it is open.

So now we have pretty much something like an interactive, or selective IFC import tool in FreeCAD. Fire the IFC explorer, load a file, display it, choose what to import, and click the import button to import only the selected pieces.

Swallowing gigantic IFC files in one go in FreeCAD (as well as any other BIM application, to tell the truth) is always a problem, so with this tool I hope we'll be able to more easily do things like create one file per level, which will be much more manageable (and works very well with the Arch Reference tool)

If you try this with large files (above 15,20Mb), be warned that this will all be pretty slow. There is still a lot of optimization needed...

Render workbench: Ground plane, image size and new templates

There has been quite some time that I didn't work on the Render workbench, which doesn't mean it is forgotten.

The idea of the Render workbench is to remake a pure Python version of the built-in Raytracing workbench. The advantage is that it becomes much, much easier to add new features and support new renderers (see below).

The Render workbench was still lacking proper Python3 support, which is now done. I also added a couple of new features, that are available for all renderers, like an option to add an automatic ground plane when rendering, and properties to set the rendered image size (until now it was hard-coded in the template).

I also redid the templates bundled with the addon. Each renderer now has two templates: A standard one, which has no light defined, but uses skylight to illuminate the scene, giving a shadowless, neutral render aspect, and a sunlit one, which is the same but with a sunlight defined, giving nice shadows. The advantage is that all these templates can be used with scenes of any size, as they don't contain any object that has a specific position in space.

Cycles rendering

I hope this won't provoke some apoplexy crises, but the Render workbench now supports Cycles, Blender's flagship renderer. Cycles can be compiled as standalone, and used outside of Blender, which is what we use in the Render workbench. It was surprisingly easy to adapt, thanks partly to the ease of adding new renderers to the Render workbench, but also due to the fact that the scene language is very similar to Appleseed.

Of course, you don't have all the control that you have when importing your FreeCAD document in Blender and rendering it from there, this is a much simpler thing, based on templates. No lights control or textures or anything. But I think it's already kind of cool

Offline Rendering Utils

This is a commissioned work I have been doing this month, and that is now included in the FreeCAD source code. It is a series of utilities to ease the production of files such as OBJ, IFC, DAE, PNG or even FCStd files from a pure command-line environment, such as when running on a server.

It is already possible since the early beginnings to run FreeCAD in command-line mode, without its graphical interface. You can pilot it via Python, and do almost anything you can normally do via the GUI. Only problem, since all the visual part is not available in non-GUI mode, all visual aspects of objects such as their color, is also not available. That means you weren't able to produce colored files from the command-line mode.

The new OfflineRenderingUtils module adds a series of tools to overcome this limitation. When building your objects in command-line mode, you can now keep a dictionary of colors (you can also obtain it from an existing file), and use that dictionary when exporting.

That's it for this month, hope you liked, see you in July!