|Wikihouse porting tutorial|
|Time to complete|
This tutorial will show you how to convert SketchUp files used by the WikiHouse project to FreeCAD, making use of the Arch Panel tools in FreeCAD. The result is a full copy of the original SketchUp file, except that it has become fully parametric. The level of parametricism of the final file depends on the work you spend on it, as explained below. But it is totally possible to do things step by step, and rebuild the Wikihouse file rather quickly, and leave the more lengthy conversion of base profiles to sketches for later.
This tutorial will require intermediate knowledge of FreeCAD, that is, you are able to find your way between the different workbenches and tools, are already able to model simple objects, and, above all, are comfortable with Draft Move and Draft Rotate. It will use mostly Draft and Arch tools, but knowledge of the Sketcher will become necessary when converting the base profiles to sketches.
Since the Wikihouse project is open by nature, files are easy to find on the project website, but also on the SketchUp 3D Warehouse or in the project's github repositories. The preferred format used by the project is Sketchup, so most of the files you'll find are in that format.
In the following tutorial we used the Chassis file from Wikihouse's Microhouse subproject.
The first thing you will need to do is to open the file in SketchUp and delete everything you don't want to export. We will only export one section of the Microhouse, so everything else must be deleted.
The Wikihouse elements, in SketchUp, are made in a specific way: By adding small "pieces" together in order to create the different components:
This is not how we will proceed in FreeCAD. Since one of the most powerful features of FreeCAD is Constrained Sketches, we'd better take advantage of this, and base all our Wikihouse elements on Sketches. That way, modifying any part can be done in the Sketcher, which is much more comfortable.
In order to turn our SketchUp objects into FreeCAD sketches, which can then be used to create Arch Panel objects, we need to extract one, flat face from each wikihouse piece. The thickness will be re-added later, in FreeCAD, directly in the Arch Panel properties. This way, we will keep it parametric as well. To turn each wikihouse component into a single, flat face, enter each component by double-clicking it, then select each sub-component, and right-click -> Explode, until all sub-components are exploded, and your component is composed only of faces and edges:
Once this is done, select everything in your component, and unselect, by Shift + double-clicking them, each frontal face of your component. Be sure to double-click instead of single-click, because otherwise you will only unselect the face and not its border edges (which we will need to keep as well). After that, we will have unselected everything we want to keep, so we only need to press the delete key. Now our component is only one big flat face.
Repeat this for each component. Since many are duplicated, this is not as huge a task as it looks. Besides, if you are not familiar with the Wikihouse system, this step will give you a pretty good understanding of how it works.
When our piece of house is fully made of flat elements, we can select everything and export it to a .dae file, and then import this file into FreeCAD. Be sure to mark the "triangulate all
There is a nasty problem for which I haven't found a better solution: Meshes exported from SketchUp to the .dae format have their faces duplicated. Each face becomes actually two faces. The easiest way I have found so far is to open the exported file in Blender for repair:
Normally the above operation shouldn't change the scale, but it is always wise to verify, using the measuring tools, that the imported geometry is at correct scale before going further. You might need to tweak Blender's Collada export settings if needed.
Note that it might be easier to go by parts and treat + export objects group by group, as we did below, we exported only the first layer, made of yellow elements in SketchUp. These elements will come into FreeCAD as Mesh objects:
The next step is to create wires from each of our meshes. There is a convenient Macro named Macro Extract Wires from Mesh that does just that. Install it (Refer to the Macros page for instructions), then one by one (you can do them all at once, but this macro takes some time), convert all our meshes to wire objects:
We could now already make Arch Panel objects from each of these wire-like objects, simply by selecting them and pressing the Arch Panel button. However, their base shape wouldn't be parametric. We now have several options: We could turn each component into a sketch, using the Draft Draft2Sketch tool, but these will be rather heavy sketches, and might not be very manageable on a slow machine, or we could turn each individual wire (the outline and each hole) of the sketch into a separate sketch. This would allow us, for example, to reuse a typical hole, make it only once, then duplicate it with Draft Clone to make the other holes. This way, you would only need to edit one to edit them all.
The Extract Wires from Mesh macro also sometimes fails in finding closed wires inside a mesh, which will not produce correct Panels. An easy procedure to recompose the wires of a component is this:
There are many possible strategies here, depending on how editable and precise you need the result. The Arch Panel object needs a base object made of wires. It doesn't matter how this object is made, if it is a single sketch, or, like in the example above, a compound of different sketches or draft object.
It is also possible to do that part later, you could already create Panels from each of the component, but let's see already how to to convert a wire-like object to a sketch:
Also, make sure you don't redo any duplicated part. Instead, select the Draft Clone tool to duplicate parts based on the same profile, so they will all share one same profile object. Then, since we have the outline at the correct place to use as a guide, it is fairly easy to rotate and move the clone into its correct position with Draft Rotate and Draft Move.
After a while, all our Microhouse section is done.
We can now easily create the cut sheets, which are DXF files that will be sent to the shop that will cut the actual panels. The easiest way to do this is to select everything in your document with Ctrl+A, and then use the Arch Panel Cut tool. This will produce one Panel Cut object for each Panel object found in the selection. By moving them apart, we get a clear view of all our pieces:
We must then "nest" our pieces, that is, move and rotate them so they occupy as much as possible to space of a given panel, to generate as little material loss as possible. This operation unfortunately needs to be done by hand, but if you are using a Wikihouse project that already has produced cut sheets, copying them goes pretty fast:
In the Panel Sheet's Task view, there is also a button that allows you to move the individual Panel Cuts after they've been inserted inside the sheet. After a while, we have our sheets ready:
The last step is simply to select all the sheets, then export them to DXF from menu File -> Export. The sheets contents will be exported separated in different layers, with the same color coding commonly used by the Wikihouse project:
These files are ready to send to the shops that will do the actual cut. It would be possible to generate the G-Code to be sent to the CNC machine directly from FreeCAD too, but that is matter for another tutorial.