FreeCAD BIM development news - November/December 2020

Hi there! Happy new year to everybody reading this blog!

Here goes another monthly report about the BIM tools development for FreeCAD.

2020 has been a baffling collection of changes, I guess this is true for just everybody in the world. It has certainly been for me, I relocated to Belgium, and a lot has been taking place. Regarding BIM and open-source, I believe things have been happening in 2020 more than ever before. This is in great part thanks to the astonishing work done by several restless people on BlenderBIM, an add-on for Blender that adds BIM capability and full IFC interface, and osarch.org, where you'll find a wiki with a lot of information about what software is available and how to get started, and a very active community of open-source software developers and advanced users.

With FreeCAD and BlenderBIM, the world now has two open-source good, stable, powerful, multi-platform authoring platforms for doing BIM work. Both still have limitations, both differ from the commercial BIM apps you are used to, both still require some effort to get into and master, but both are in many areas more powerful than most commercial apps, both speak IFC better than most commercial apps, both are deeply hackable and customizable, and there is each day more evidence that you can successfully do full, professional BIM work with any or both of them and that you can build a full BIM production chain entirely on open-source software.

There is still some effort to be done in many areas, mainly to output better 2D drawings, and to ease the learning curve by providing better documentation and learning material. On the FreeCAD side, working on these two points will be my new year resolution.

As each time, thanks a million to everybody who contributes to these efforts by sponsoring me on Patreon, Github or Liberapay, or by donating to the FreeCAD project. You have made a big difference for me and for FreeCAD this last year, I've been able to keep focused on it most of the year regardless of exterior events, and I feel I'm very close to be able to dedicate myself fully to FreeCAD, which would be a dream come true...

Enough of being emotional, though, let's get to the latest changes already!

Default scaling in TechDraw views

In last editions, I introduced some new buttons on the BIM workbench to make TechDraw pages and views. There are now several new ways of defining a default scale for new views that will be created on a page:

  • The old way, which is still working, is to set the Scale property of a page to a certain value, for ex. 1:100. When a page has a defined Scale value, all new views added to that page will use that scale value by default.
  • You can now define a default scaling in a page template, by creating an editable text and naming it "scale" or "scaling" (it is case insensitive, so it can be Scaling or SCALING too). When using that template, if such editable text is found, its value will be used as default page scale.
  • Creating a Mod/BIM/DefaultPageScale float parameter (under Tools->Parameters) allows to set a default page scale if none is found in the template.

As a reminder, FreeCAD works with float scale factors like 0.01 or 0.05. Working with scale factors like 1:100 is easy, you can simply write the scale factor as an expression (write it as =1/100, or =1in/2ft) and FreeCAD will do the conversion for you.

But the theory is simple too, and is good to keep in mind so you can verify afterwards. You must just think: "1 in relation to 100, or 1cm of the drawing equals 100cm of the reality", that is, the size you see on the drawing is the reality divided by 100, or 1/100, or 0.01.

When working with imperial scales like 1" = 2', it works the same way, 1 inch of the drawing represents 2 feet in the reality, that is, 1in/2f or 1in/24in, or 1/24 or 0.0416

Buttons to switch window opening

Most default windows created with the Window tool now define a hinge edge, so their Opening property can be used to show the window half or fully opened in the model.

Window objects now have two context (right-click) menu options, to switch the opening direction (same hinge, but opening towards the other side) or opening side (the hinge edge is switched to the other side). This will work with all preset windows, and will also work with most custom windows too, as long as their hinge edge is part of a rectangle (so it's possible to deduce which edge is on the other side).

A quick reminder to how windows opening work: Windows are built from different window components, which each is an extrusion of one or more polylines from a base sketch, so they define frames and panels. For each component, you can define a hinge edge, which will affect that component and all of the next ones in the stack. So the order of the components is important, you should start from the fixed ones (outer frame, for example), then group all the components that will open from the same edge together.

Forum dark theme

I created a dark theme for the FreeCAD forum, which you can use simply by visiting your forum preferences and switching to "FreeCAD dark".

FreeDesktop thumbnails in Start page

When running on Linux, the FreeCAD start page will now show FreeDesktop thumbnails when available, that is, file thumbnails saved by file managers or any other application that follows FreeDesktop specifications (Gimp, etc..).

Note that FreeCAD will not run any thumbnailing service by itself, only locate and use existing file thumbnails if available.

I plan to extend this to other platforms too, but have not much clue to where to find those thumbnail files. If you know anything about that, let me know!

By the way, some long, long time ago, I made a DXF thumbnailer for Linux, that you might find useful (it still works!). I tried doing one for dwg using LibreDWG's dwg2svg utility, but unfortunately the svg it creates is rarely usable...

Integrated 3dfindit.com into BIM library

The 3dfind.it website is a large catalog of 3D models available, both for free and for fee on the internet. It offers since a couple of months a full FreeCAD plugin, which integrates 3DfindIt directly into the FreeCAD interface.

I now also added a 3DFindIt button to the BIM Library dialog, so you can now also search 3DFindIt directly from that tool, with or without the plugin installed (it doesn't use it, it just sends you to the search results page on the web).

Workaround for orientation bug in TechDraw views

When using TechDraw arch views and solid rendering mode, the view sometimes appears with a different rotation than when using wireframe rendering mode. This is due to OpenCasCade's HTL (Hidden Line Removal) algorithm, which produces the wireframe view, so we unfortunately cannot fix it from within FreeCAD.

This is usually of no consequence, you can simply use the Rotation property to give your view the correct rotation. But in some cases, where a view is made of a mix of both modes, you cannot solve it that way. Typically, dimensions and other 2D elements in a same Arch view don't have the same orientation of the underlying solid rendered view. There is now a workaround possible to give both parts of the view the same orientation, by tweaking the rotation of the solid render.

Updated CADExchanger addon

CADExchanger is a paid (there is a 30-day free trial), multiplatform application that converts between a large array of commercial CAD formats, such as DWG, SolidWorks, Siemens-NX, Catia and many more. It can be used by FreeCAD to import and export from/to all these commercial file formats, something that would otherwise be very hard or impossible for an open-source project like FreeCAD, as these formats would all require extensive decoding and reverse engineering.

The CADExchanger addon, that you can install from the FreeCAD addons manager found under menu Tools, is free and open-source, but it requires the CADExchanger app to be installed on your computer. Once this is done, FreeCAD will transparently open, import and export from/to all the file formats supported by CADExchanger.

The addon has now been updated to work with the newest version of CADExchanger.

New WebGL exporter

This has not be coded by me, but I found it worth mentioning here, since I had made the first exporter many years ago and it was really decaying. The new one now has a much better interface, and even offers you additional tweaks such as enabling or disabling objects or changing the color.

Release 0.19 plans

This is obviously a hot subject, and, as you certainly know if you've followed FreeCAD for some time, "it's done when it's done", which means, there is no scheduled date, and there won't be. However, we all more or less try to prepare things for it now, and are all more or less in feature freeze mode, which means we don't add any new features but only fix things. There are still a couple of blocking bugs, but it shouldn't take that long now.

You can already test and use the 0.19 version, which is pretty stable. You can have a look at the release notes which are being written. You can also help us to make the release happen faster by helping translation, or reporting or triaging bugs.

Save/restore annotation styles

The annotations style editor now features import and export buttons, so you can export your current styles to a json file, or import them back in another file. Importing will overwrite any existing style with a same name.

Webdoc repo

The FreeCAD API documentation which is generated automatically from the source code, and was previously uploaded manually from time to time, is now handled by a git repository, which will make it much easier to keep updated, and hopefully will motivate more people to work with it.

Additional colors in layers

Draft layers now have received an additional print line color, which can be set from their properties or using the Layers manager tool from the BIM workbench. When that color is set, it is used on TechDraw pages instead of the object line color.

TechDraw space projection bugfix

A small but useful fix, when TechDraw views are created, that contain spaces, the label of those spaces is now printed at its original place in the model when viewed in top view, but at the center of the space in other view directions.

IFCjson support

IFCJson is now an additional IFC export format available from FreeCAD. It requires the IFCJson python module installed, which must be done manually at the moment. Internally, it builds the IFC document exactly as the original IFC format export, but at the end it is converted to IFCJson before being written to disk.

IFCJson has still not much use, so far I think only BlenderBIM and a couple more apps support it, but people at BuildingSmart seem eager to push it forward, so it's interesting to keep an eye on it. And it's always nice to support something before all the big (commercial) guys out there

libreDWG support

libreDWG is a free and open-source software component to read and write the proprietary DWG format. A lot of sweat and ink has already been spent over the years as to why libreDWG is not used more in other open-source projects (check the wikipedia page) but to make it short, its license is too strict to be used in most open-source projects, and it actually prevents bundling it withing FreeCAD.

Just for the story, for who is not used to the open-source license havoc, know that it can sometimes be a real hell, as there are a great many, with small differences that provoke infuriated and never-ending debates over what is compatible or not and epic philosophy clashes. However, it is also those vibrant, active and dedicated (and sometimes very nit-picking) debates that actually make the solidity of all the open-source world and turn it legally strong.

Now, if libreDWG's dwg2dxf and dxf2dwg utilities are found on your system, they will be used by FreeCAD at DWG import or export instead of the ODA convertor. You are responsible, at the moment, to install libreDWG yourself. On Linux it's relatively easy to compile it yourself, I don't know of any handier way for other platforms.

This is annoying but at least it allows us to use it without having to bundle it with FreeCAD. Hopefully if the use of libreDWG grows, better packaging alternatives will start to appear.

From what I have tested so far it works really well, I still need to test with very recent and more complex DWG files, though. Any help is welcome there!

Red/green/blue Draft grid axes

The main axes of the Draft grid will now be shown in red, green or blue if they match the global X, Y and Z axes, as they appear on the small location widget at the lower right corner of the FreeCAD 3D window. This is consistent with many other 3D applications such as Blender or SketchUp and a nice visual help when switching views often. You can disable this in the Draft preferences if you'd like to revert to monochromatic axes.

Aside many other bugfixes, that's it for this one I think, thanks for reading and see you net month!