Computer Aided Design¶
- Model (raster, vector, 2D, 3D, render, animate, simulate, …) a possible final project
- Compress your images and videos, and post it on your class page
Since I know I would be doing the Fab Academy, I trained myself with FreeCAD and Inkscape to be prepared for this week. I tested Blender and OpenSCAD too, but very shortly. I hope this week I’ll be able to test some more, but I really am interested in finding my workflow through these softwares. I’ll probably stick with FreeCAD because I’m a linux user, but maybe Fusion will surprise me? (Spoiler: no)
In my setup page, I put informations on what softwares and material I’ll be using during Fab Academy. You can see for example I’m not using the vanilla FreeCAD version, but the link branch developed by realthunder. I’m used to be ahead of the vanilla version now, and I really encourage you to try the link branch :)
The morning before the review of the first week, I decided to elaborate a bit more my hand-made sketches of my final project. I used Inkscape (that I learned with a french MOOC) to add some informations in different layers.
I also made a first iteration of the decoration of my facades during the Computer Controlled Cutting week with Inkscape.
My instructor challenged me to reproduce this object in a CAD software.
This is an interesting form because of the revolutions and lofts needeed, and I have rarely done such operations.
I own a linux computer, so Fusion 360 is only accessible through my browser. My instructor loves this software so I decided to give it a try anyway. But after a few operations, everything froze and I was unable (after multiple restarts) to continue my work. So I decided to do the same exercise with FreeCAD.
When I got home I tried it again with a better internet connection: my work was gone and Fusion slower than ever. I did what I could, but I will not stick to this software (destiny, said my instructor…)
It was predictable, but I’m much more confortable wth FreeCAD. I managed to have the same result as my instructor in the geometrical aspect. However, I must admit that Fusion is ahead of FreeCAD for rendering and animation. This is why I need to test Blender this week, to be able to make beautiful renderings anyway.
I wasn’t gonna write a lot about FreeCAD because I already explored this software before the Fab Academy, but I realized it would be a shame to not explain why I like it. I would have love to, when I was searching for a good CAD software for linux, read more about FreeCAD and how marvelous it can become once you have your hand on it.
Retrospectively, I think the best way to hook you to this software is to share with you the best videos and tutorials I found during my journey. Here comes a – non extensive – list:
- A complete introduction for beginners (using the Realthunder branch) by Maker Tales
- Personalize FreeCAD interface (in French) by Adrien Bracq, former sudent of the Fab Academy
- A very good tutorial to make your own Raspberry Pi case by Oficine Robotica
The FreeCAD documentation is quite extensive and sometimes it’s more likely you will lose yourself searching for a detail. But I can only recommand reading it when it comes to understand a function.
On Friday morning we attended a meeting with Feadi, who teached us some basics about blender. I will put there some of the shortcuts I found more useful.
- Shift + push middle mouse button: move into the 3D view
- Shift + S: snap
- Home: return to origin
- Shift + Space: select a tool in Object Mode
- G/R/S +
Number+ Enter: grab, rotate or scale by the number you decide
- E +
Number+ Enter: extrude
Feadi has a website where you can find his courses on Blender, but also FreeCAD and Inkscape.
We did a little exercise with a Gingerbread Man, to learn more about extrusion and Modifiers (Subdivison Surface). We then learned how to render the Camera View by pressing F12 after orienting the camera in the right direction.
Feadi also introduced us to Suzanne, and you can learn more about her here .
|Prepare the rendering||Suzanne|
Final project modeling¶
I decided to try my workflow as follow: model my objects in FreeCAD then render them in Blender. For my final project, I want to try to model the fountain first, as it will be a good practice for the rest of the modelling. Moreover, it will be fun to test the physics parts that Neil showed Wednesday.
First try: the fountain¶
These are my steps for modelling the fountain. I tried to keep up with the modelisation standards I read online, and I hope I did the things in the right order.
Step-by-step modelling in FreeCAD
I started by sketching the base of the fountain. I plan to reuse this sketch at different steps of the modelisation. I then extruded the sketch in a pad to make it in three dimensions.
As the fountain has a repeated pattern, I replicated the first sketch multiple times. I didn’t know how to do it so I googled a bit and got lost in FreeCAD forum (there’s a lot of informations in there!). I found what I was searching for: Edit > Duplicate selected object allows you to reuse a sketch and modify it as you wish. I first used Carbon copy but I couldn’t modify anything and got stuck with the exact copy (I see when it can be useful, but not in this case). I then padded this second sketch.
I then applied some tips Stephane showed me this morning. For the water part, I did three sketches and used the loft feature.
A few pads later, we have a center in our fountain. I did a second loft operation for the upper part.
Then I did a revolution by sketching a silhouette of the top of the fountain and applying the revolution operation.
I finally did a pocket operation on the top part… and another on the main part.
I’m not sure about my methodology about this fountain, but it’s quite ressembling for a first test, so I’m gonna leave this for today.
Second try: also the fountain¶
I wasn’t quite happy with my distorted version of the first day, so I decided to try again with a new method. I found a great site about the history of the fountain and great pictures I could use for modelling.
Import an image as a plane¶
To help me have the right mesurements, I imported in FreeCAD the top view image of the fountain. To import it and be able to use it in a sketch, I used the Image Workbench to create an image plane. I just had to offset the image a little bit to have the center of the fountain at the origin point.
I then used the Polar Pattern feature to modelize more easily than the previous day. The sketches are less heavy and the process is quite straightforward! I proceeded likewise the rest of the fountain.
I changed the camera view to perspective and then applied some stone texture but the rendering wasn’t at all like I expected it to be.
I tried to apply texture with the ArchTextures Workbench but never managed to have it working.
I then tried texture mapping thanks to a YouTube tutorial and it rendered a better view, but I think I’ll have to switch to blender if I want a real-life result.
I found the texture on OpenGameArt.org under a free license.
Rendering with Blender¶
I’m very excited about this part of the week, I’d really like to be more able with Blender when the Fab Academy is over.
I followed this tutorial from FreeCAD documentation to try to render my fountain in Blender. You can find a serie of videos of this tutorial by Joko Engineering. I thought the videos were more easy to follow at first.
I started again by two times before getting it “right”, or at least I ended up finding a workflow that I could stick with coming to importing files from FreeCAD to Blender in order to perform a render. Here are some notes for my future self if I forgot how to do it properly.
Prep your render¶
Import your file by going on
File > Import > STL. I found out that the quality of the mesh is better if you import a STL file rather than an OBJ file. Here you can see the differences between the two (it’s on wireframe mode and the .stl is on the left).
You won’t see anything at first because the model is too big. Scale the model. You can do it by pressing S +
0.1 + Enter, or find in the Properties panel the scale parameters.
Now we can prepare the rendering options. Open the Render Properties tab on the Properties panel and select Cycles as a render engine. The day you will own a GPU, make sure to use it. For the moment, keep the Max samples to a low level, but don’t forget to change it later. Preview the rendering by splitting your screen vertically with two 3D Viewport windows. Keep one on solid mode and the other on render preview.
This tutorial was very helpful for the following points.
Position the camera by either Ctrl + Alt + 0 to fix your view. You can also changing its position by hitting 0, N and tick the box Camera to View in the view tab of the numerical panel: you’ll be able to move the camera as you like (untick the box when you’re done!)
We can now add some simple effects: a plane and the illusion of a background. To add a plane, press Shift + A and select
Mesh > Plane. Scale it to be bigger than the camera view. Grab one vertex to transform the back into a curve by selecting the vertex in
Edit mode, pressing Shift + B (for bezier curve) and adding some vertexes with
+. Extrude the curve (E + Z) and smooth it (right click +
It’s time to add some natural lightning! Press Shift + A and choose . Place it in your scene to have a beautiful shadow (I recommend switching to Eevee rendering during this operation to avoid warming your computer too much).
Separate your different parts if you haven’t done it yet! Select in
Edit mode the parts you want to separate and press P >
Selection to create a split part. It’s also a good idea to organise your parts in the Outliner.
This is the result of a first rendering (that you can obtain by pressing F12).
Add a texture¶
I failed a lot when trying to texture my objects, and it was because I often forgot to unwrap them
This tutorial and these videos (here and here) helped me a lot.
Node: Node Wrangler
- Open the Shader Editor
- Add a material by clicking on the red ball on the Properties panel and keep the default
Surface: Principled BSDF
- Ctrl + Shift + T on the
Principled BSDFwindow in the Shader Editor
- Include all material files of the texture of your choice.
- Unwrap your object: select all nodes in Edit mode and U >
Smart UV Project
At first, I only tested this feature with a simple image (the same I used in FreeCAD). I was a little frustrated to not see the result I wanted. I found after a while the ambientCG website that offers tons of textures under Creative Commons CC0 1.0 Universal License. I downloaded files in 4K for now with reasonable results.
Your screen should look like something like this:
You can see that the textures of the stones is not very well rendered on the plane: don’t hesitate to change the scale in the Mappping window to see what’s best for your surface. You can see what’s happening when you’re unwrapping your objects in the UV Editing workbench.
Water texture (static)¶
I could not avoid trying to use some water effects with a fountain on blender! This was tricky and I know I could go much farther but I think it’s a good first result. I had a lot of help from this video of Blender Guru and this tutorial.
In Edit mode, you first need to create your water volume by selecting all the inner points of your basin/bowl/cup (you can use C to ease the process).
Then you hit Ctrl + D to duplicate your object and P to separate it from the original. You can then press F to close the volume, and scale it to be a little bit smaller than your original form. Press I to smooth the surface. You now have your water volume and can apply a water texture to it.
Add a texture to your object and select
Surface: Glass BSFD. In the Shader Editor, set the Index of Refraction (IoR) to 1.33 (value commonly known for water refraction)and add a
Transparent shader node (Shift + A). Connect the Glass node and the Transparent node to a
Mix Shader node and the Mix shader node to the
Material Output node. It’s better!
Blend mode setting of the material to Alpha Blend and the Mix factor to 0.3 (thanks to Piero De Tomi for his tutorial mentionned before).
My computer doesn’t have GPU, so when I press F12 for rendering in Cycles it take a while…
Nine minutes later, we have a final rendering !
At this time, I’m quite confortable with putting lights into a scene, addding textures and moving everything along. But I’m not quite sure about how to add all the details on the houses I had in mind for my diorama.
Water simulation (animation)¶
This was a stretch goal for this week, and I’m glad I’d figured out how to do it. With the newest version of Blender (3.0) it’s actually quite easy, even though I know I only scratched out the surface.
I took a long time to figure out why I couldn’t see my animations as soon as I made a few changes to the Quick fluid simulation. I found out here that the resolution must be increased, especially if you use a smaller object than a default cube.
Moreover, to refresh a simulation, I needed to select the Liquid Domain and change one of its parameters (it’s just a workaround, I’m sure there is a better way…)
To create a fluid simulation, you need at least two objects: a Domain and a Flow. The domain is the space where your animation will take place and the flow is where the liquid is generated (born?). You can choose the direction of the liquid, its viscosity, texture, speed… And once you have entered all these parameters, you can add some details: a Effector to receive the liquid for example, and so on. After this, I suggest to test several animations (with Eevee and in a low resolution). Once you’re confident with the behaviour of your fluid, you can go to the animation panel to make some final tests before rendering.
Spoiler alert: it will take a very long time, make sure you checked your materials and parameters before launching it…
To save my animation, I followed this simple tutorial. As I decreased the resolution to lower the time spent on it, I only have a final video of 400*200 to show. It took almost three hours on my computer! I will try with a better computer in the future (I think we have one with a good graphic card in La Sorbonne).
I exported directly in ffmpeg format (.mkv), but needed to convert it in .mp4 for this website. I used
ffmpeg -i fountain-animated.mkv -codec copy fountain-animated.mp4.
Here’s a hero shot for this week, extracted from the animation. I took more than half an hour.
To relax a bit after blendering all week-end, I made a simple model of my little houses in FreeCAD.
git-lfs for storing these files.
git-sizer didn’t raise any warnings, and everything worked as indicated in the documentation. I documented this process in details during the first week.
About this week¶
I thought FreeCAD was gonna be my best friend for 3D modelling, but I wasn’t expected to fall in love with Blender. Be as amazed as I was and watch this video, I promise you won’t be disappointed!
I tried these two softwares before but now I’m much more confident of creating the things I need and choosing the right tool to do it. I didn’t have the time to model everything I had in mind for this week but I now I will be able too, and it feels great!
I learned so much and it opened so many possibilities, I loved this computer-aided week
If I had time, I would have really love to test CadQuery and Antimony to go fully parametric.