HHOOWW--TTOO A Practical Guide To FreeCAD - Pt 1 Written by Alan Ward A Practical Guide To FreeCAD - Pt 1

ffordable Computer Assisted surface qualities and the behavior specific application, facing a similar format drawings. Both , and A Design (CAD) and its oflight when interacting with the and protracted process to learn its fork, LibreCAD, complement, Computer Assisted object. anothercan be something ofa (http://librecad.org) are open- Manufacturing (CAM), have challenge, even ifone is not source design programs that focus revolutionized many professional Luckily, CAD for the starting at the very beginning of on 2D, and can, within some limits, workflows in the last several years. open-source software user has the learning curve. So, it comes as be seen as viable alternatives for There was a time when gone a long way from its (rather a little surprise that the situation the popular but non-free AutoCAD professional-grade software such timid) beginnings. In this series, we was even worse concerning open (http://www.autodesk.com) series. as Dassault’s CATIA –and the will be examining the world of source CAD software. Ten years The price forboth qcad and hardware necessary to run it –was FreeCAD, an open-source CAD ago, perhaps the only application LibreCAD is right (as in free), and out ofreach ofmost small modelling application that it still in thatran on was qcad availability is for GNU/, businesses and the occasional Beta, but has been gaining (http://qcad.org), still in its infancy Apple’s Mac OS, and Microsoft hobbyist. Nowadays, the advent of acceptance in recent years. back then but available in the Windows. As can be seen in the 3D printing using plastic extrusion Naturally, it is readily available in Canonical repositories. screenshot, the LibreCAD interface has made physical prototyping a the Ubuntu repositories. is very similar to AutoCAD’s viable proposition, meaning, in Nowadays, things have changed original user interface, which can turn, that a larger segment of A CHOICE OF PROGRAMS forthe better, and there is a fair make conversion from one computer users actually has a need offering of programs available that program to the other easier for the for usable software to design their Industrial drawing and design can both read and produce DXF file experienced user. pieces. software has historically been an area with a small numberof Another group of users includes offerings. Even in the world of people designing virtual 3D commercial applications, until very environments on computers. Many recent years, one single name used ofthe same principles apply as to arise, repeatedly, enjoying a when building 3D objects, since dominant position as well as working with spatial coordinate defining file formats. This is systems presents the same perhaps understandable, since it challenges in both scenarios, does take some time to correctly though virtual world designers and operate what can be rather ray-tracing artists must complex pieces of software. Once additionally contend with object one has come to dominate a

full circle magazine #120 29 contents ^ HOWTO - PRACTICAL GUIDE TO FREECAD

In this series, however, we limited than other applications. project does caution us on their not participated in its creation and would prefer the software to more However, object creation can easily website that “FreeCAD is under who, forthis reason, may have a easily create designs in 3D. This is be conceived as a metalanguage or heavy development and might not slightly different point of view and both forease oflearning - script, which may have its be ready for production use” - priorities: those of an ordinary correctly “seeing” a 3D object from attraction for users of the Povray which is coherent with their user. flat plans can be somewhat raytracer that uses a similar current 0.16 version number - in difficult for beginners - and conceptual model. actual fact the software does seem INSTALLATION because our design will then be to work quite well - at least well exported for printing in a suitable Another option would be enough, in fact, to make this sudo apt update ; sudo apt 3D printer, thus creating a physical TinkerCAD software a viable option for the install object that we can compare to our (http://www.tinkercad.com), an enthusiast and for learning Or use your favorite software original idea. In this scenario, a online program that can be used purposes. Professional users may manager in any version ofUbuntu; piece ofsoftware that has gained for simple projects. However, it can wish to evaluate the application ‘nough said. At the time ofwriting, wide acceptance is SketchUp onlybe used through a web thoroughly before making a version 0.15 is to be found in the (formerly Google SketchUp, browser and is closed-source, decision, to ensure it fits in well for Xenial repositories, which is a http://www.sketchup.com) for which can present both practical their own particular needs. stable version. Developer version many reasons, including its ease of and philosophical inconveniences. 0.17_pre can be downloaded for use. However, this program has There is a large corpus ofuser Windows and Mac OS, while stable been made available over the years Finally, FreeCAD documentation available for this 0.16 can be downloaded for exclusively for the Windows and (http://www.freecadweb.org) is project on the site, and also on GNU/Linux from the project’s Mac OS platforms. Though there the application we will be focusing Youtube. As often with software Github page have been reports ofpeople on in this series. There are several under heavy development, the (http://github.com/FreeCAD/FreeC installing and using it successfully reasons for this choice, including a documentation often is not quite AD/releases ). Version 0.16 can be from inside the Wine emulator, an relative ease ofuse, being open at the same level as the software installed under Ubuntu as well by open-source piece of software (as source, and available for and some discrepancies can be adding the project maintainer’s opposed to being merely free for GNU/Linux but also Windows and seen between versions in the PPA repository: use) that is better integrated into MacOS. Itshould be said that documentation and on your Ubuntu can be seen as preferable. FreeCAD has modules for both 2D computer, though it is usually not and 3D drawing, though its too complicated to figure out how ppa:freecad- maintainers/freecad-stable OpenSCAD (www..org seems to be mainly the latter. to make things work out. This ) is another option for designing Interaction between 2D and 3D series of articles is, obviously, not It must be said, however, that, 3D objects suitable for 3D printing, design is also possible as, for meant to replace the official with a projectsuch as this one that though its use-case is focussed on example, when building a 3D documentation and tutorials. What is moving along quite quickly, it Constructive Solid Geometry (CSG) model from an initial 2D floor plan, itisaimed atisto provide a may be best staying with the and is thus perhaps a bitmore or when exporting the 2D plans practical introduction to the use of version in Ubuntu’s repositories - from a 3D model. Though the this software by someone who has

full circle magazine #120 30 contents ^ HOWTO - PRACTICAL GUIDE TO FREECAD even ifit is slightly olderthan the installed is well within the bounds Designing a user interface for a inspection, thus allowing the user one in the repositories. This more ofreason, even for systems with a CAD program is always complex, to edit object parameters (such as conservative choice means more low amount ofavailable disk space. since there is a rather large length and coordinates) directly. bugs will have been ironed out and Not-so-recent processing hardware amount ofinformation to be But this makes further demands on will not come down to bite us. can be usable. The following displayed. Toolbars can include user interface space since these screenshot was captured running drawing tools for two- and three- options must be displayed at some FreeCAD itself will take up only FreeCAD - installed to RAM - within dimensional objects, operations on time. about 68 MBytes ofdisk space on a Neon 5.9 live session on a laptop objects such as scaling and our system, which can be rather equipped with an AMD Athlon X2 duplication, operations combining Ascan be seen in the impressive for users who are used processor and 2 GigaBytes of objects, and different layers may screenshots, the FreeCAD user to installing commercial CAD memory, but whose hard drive has be displayed or hidden. A program interface has condensed all these applications. It does come with been scrapped several years ago. such as FreeCAD that works with elements into three main areas. several dependencies on other This would clearly not be optimal an internal tree representation of The main space is atthe bottom packages, such as the Python for production use, but can be the scene includes object right. In this, we will see the start language it has been developed in, envisioned to work on simple and other graphical libraries such projects. as Boost. However, the sum total of software packages that are THE PROGRAM INTERFACE (automatically) downloaded and

full circle magazine #120 31 contents ^ HOWTO - PRACTICAL GUIDE TO FREECAD page or “Start Center” when the “Workbenches”. Within each interface as the project evolves tools and toolbars in their default application is started up. This workbench - with titles such as from one stage to another. In each positions, at least while starting to contains some rather handy links “Drawing”, “Draft”, “Part” or “Arch” workbench, only the toolbars with become familiar with the to various simple tasks that can be - specific toolbars are activated. the most pertinent tools will be application. ofhelp to the novice. Recent The paradigm is similarto a seen atanyone time, thus projects can also be opened physical fabricator’s workplace. In reducing visual clutter on-screen. WHATNEXT? directly from this pane, though most shops, different working However, it should be noted that theycan also be opened from a areas are disposed along the walls. all tools within FreeCAD can be In this first article on using more traditional File > Open menu Each bench will have nearby a set accessed from the menu system, FreeCAD, we went over the basics option. This area has a system of oftools, grouped according to the even ifthey are not promoted ofchoosing and installing a CAD panes, in which the different type ofwork being performed in within the active Workbench. application for Ubuntu or projects we are working on will be thatarea in a wayto minimize GNU/Linux, and reviewed some displayed one ata time. We can movement. A (physical) project Itshould also be noted that salient points ofthe FreeCAD user switch to one oranotherat any may then be transferred to a windows and toolbars are fully interface. In the next part, we will moment, making it easy to work on workbench dedicated to soldering, floatable, and can be tailored to be creating a simple planar object several projects, or several or another specializing in the user’s specific needs (and the to illustrate the use ofthe main different pieces for a single final electronic instruments, as the need screen’s available space), much in workspaces, drawing, and object. arises. the way many modern word extrusion tools. Constructive Solid processing applications work. Geometry will also be On the left, we have a column In a similarfashion, the However, since there are very demonstrated, to punch holes in that usually contains a dialog with FreeCAD user will activate one or many different options available, it an unsuspecting piece ofplain contextual information on a another workbench inside the user may be best for beginners to leave material. specific object, either the project as a whole or the element selected atthe time. This is also where the parameters relating to that object can be inspected, and altered manually, ifneeded. Alan holds a PhD in Information and Finally, the top ofthe screen is the Knowledge Society. He teaches computer science at Escola populated with toolbars that Andorrana de Batxillerat (high- contain the different tools and school). He has previously given other options. Herein lies the GNU/Linux courses at the University specificity of the FreeCAD user ofAndorra and taught GNU/Linux systems administration at the Open interface. Toolbar visualization is University of Catalunya (UOC). controlled by a system of

full circle magazine #120 32 contents ^ HHOOWW--TTOO IInnttrroo TToo FFrreeeeCCAADD -- PPtt22 Written by Alan Ward

n this series, we will be the use ofthe main workspaces, USINGTHE DRAWING has a series ofworkbenches, each I examining the world of FreeCAD, drawing and extrusion tools. with a specific selection of WORKBENCH an open-source CAD modelling Constructive Solid Geometry will toolbars. In order to start a new application that it still in Beta, but also be demonstrated, to punch project, one ofthe most useful is Once inside FreeCAD, to begin a has been gaining acceptance in holes in an unsuspecting piece of “Draft”. As its name suggests, the new project we can head overto recent years. Naturally, it is readily plain material. Here is a quick preset toolbars in this bench menu option File > New. available in the Ubuntu sketch of our new object: basically, contain the tools most usually used Alternatively, we can choose the repositories. In the first article on it will be a flat piece ofmaterial to draw up the main characteristics appropriate tool from the default using FreeCAD, we went over the 2mm thick, with an external shape ofthe object quickly, which can bar (the leftmost icon), or even use basics ofchoosing and installing a made out ofstraight lines and arcs, then be refined with the tools in the keyboard shortcut Ctrl+N. CAD application for Ubuntu or and two circular pieces cut out other benches. GNU/Linux, and reviewed some from the inside. Since the author is As discussed in the previous salient points ofthe FreeCAD user a European, all dimensions are in Once inside Draft mode, there article, the FreeCAD user interface interface. millimeters, though the reader can easily convert them into the units In this part, we will be creating ofhis orherchoice. a simple planar object to illustrate

full circle magazine #121 1 4 contents ^ HOWTO - FREECAD are several interface items than factor (e.g. with the mouse wheel, can be set up to facilitate working or swiping vertically on a laptop’s with our object. In the first place, touchpad) so as to see at least four this workbench shows us by vertical grid divisions spanning 40 default a grid pattern set up within mm - note the view’s visible the X-Yplane, that we are dimensions in the window’s lower watching from above (down the Z right corner. As a matter ofpersonal choice, I icons allin the same shade of axis). This grid has lines set up, tend to activate the options for green, drawing tools are all shown with spacing of one millimeter, As for the toolbars, for some snapping to the grid, which in this with icons in yellow and black. In which maybe a bitfiddlywith the reason the bar related to snapping case will ensure the endpoints of this project, we will be using the dimensions ofour piece. So the points to the grid is usually our lines, for example, get tool to draw a straight line from firstthing to do maybe to head collapsed. Snapping, or letting the coordinates that are integer two points, the tool to draw a full overto menu option Edit > user interface guide the point multiples of10 mm. I also tend to circle from its center and a point, Preferences. Here, we can indicated with the mouse, is one of activate snapping to endpoints, and the tool to draw a circulararc. configure the Draft workbench to the most powerful features that is which helps when drawing the last our specific needs. One ofthe shared by many CAD programs. In element of a multiple-segment Let us begin (above) by drawing option panes, “Snapping settings”, this toolbar, we can configure closed path. the top line ofourshape, from allows us to specify grid spacing. I snapping options to help up easily coordinates (-30, 20) to (30, 20). set this to 10 millimeters, which draw clean diagrams with object As for the drawing tools Since we have snapping to the grid makes it easierto get a clearsense elements precisely aligned. As with themselves, they are grouped into activated, we will see the mouse ofthe dimensions ofeach element all toolbars in FreeCAD, we can another toolbar. FreeCAD does icon change to showa green grid in our drawing. move the snapping toolbar to a show commendable consistency icon whenever it detects we are place where we can examine its across toolbar icons, so while the close to a grid intersection, and We can nowadjustthe zoom contents better. previous (snapping) toolbar had thinks we may wish to place this

full circle magazine #121 1 5 contents ^ HOWTO - FREECAD point at this place. should change to the appropriate green icon to show us FreeCAD has We can then go on to drawthe detected a previous line and is bottom segment, from coordinates placing the new point at these (-30, -20) to (30, -20). Once we have precise coordinates. The drawing, the two horizontal lines set up, let so far, should resemble the us change to the arc drawing tool. following capture. can clearly be seen in the “Combo INTHE PARTWORKBENCH To draw the circular arc closing the View” window at the left hand side right end ofour piece, first select We can now proceed to draw ofthe screen. Further on, we will Once we have the planarpart of the centerofthe arc at the arcon the otherside ofthe need to convert this object into a ourprojectsetup - in essence, a coordinates (30, 0). Then click on piece, closing the outside shape. 3D object, and forthis reason we horizontal projection of the final the end ofthe top horizontal line With the tool to draw circles, we must convert the collection of four piece - we can switch workbenches at coordinates (30, 20) once to can putin the two circles at segments into a single path. This is and choose “Part”. This is where indicate the radius ofourarc, and a coordinates (-30, 0) and (30, 0), done with the “join objects” tool in we will give the piece its 3D second time to indicate the point both with radius 10 mm. the modification toolbar. Select all touches. To begin with, let us use where we are beginning our arc. four segments, either in the combo the views toolbarto switch to a 3D Finally, click on the end ofthe One final point is that the view orin the drawing itself- projection view, to see the piece in lower horizontal line at (30, -20) to outside ofourpiece is, forthe holding down to Ctrl key to select its current shape as a flat drawing give the endpoint ofourarc. When moment, a collection offour multiple objects - and use this tool. contained within the X-Y plane. clicking on the end ofthe different segments: two Line In the combo view, we will see the Depending on the current zoom horizontal lines, our mouse cursor objects, and two Arc objects. This four segments disappear, to be factor, it may be useful to also replaced by a single Wire object. choose the “fit to view” button to

full circle magazine #121 1 6 contents ^ HOWTO - FREECAD get the whole part nicely centered cylinder4 mm in length. Also make in the view window. sure the “Create solid” option is checked, as otherwise only the Belowis whatwe should see at walls ofthe cylinder would be this point: the outerWire and the created. two inner Circles.

One ofthe toolbars that come by default with the Part workbench contains tools to transform flat parts into volumes. Begin by choosing one ofthe circles, and then use the “extrude” tool. Nowdo the same with the above and below the main piece. Since the circle is contained other circle, converting it also into within the X-Y plane, extrusion will a cylinder4 mm high. Finally, letus To do so, we will simply displace take place along the Z axis. make an extrusion from the Wire the main part upwards by one Increment the length of extrusion piece, butthis time only2 mm millimeter. This is done by clicking to 4 mm, so the finalpiece willbe a high. on the part in “Combo view”, where it will probably be labeled Bythe end ofthis process, ifwe as “Extrude002” or something choose a lateral orthogonal view in similar. Then click on the tab the view toolbar, we should see marked “Data” at the bottom of the two cylinders protruding from the Combo view, unfold option the main part. However, their Placement, then Position, and bases are all on the same plane. This is not suitable forus, since the next operation will be to subtract the cylinders from the main part, thus creating two holes. Ifwe leave things as they are, there may be some confusion at the lower face ofeach hole. Itis bestto make sure the cylinders protrude both

full circle magazine #121 1 7 contents ^ HOWTO - FREECAD piece thus creating the final object. In the next part ofthe series, we will use further tools to create a more complex 3D object, representing a Y-junction between increase the value for “z” from 0 we expected! two pipes of different diameters. mm to 1 mm. WHATNEXT? At the same time, one should see the main partgoing upwards in In this article on using FreeCAD, the main view, giving this result: we created a simple planar object to illustrate the use ofthe main Finally, we can make the holes workspaces (Draft and Part), in the main part. To do so, startby drawing tools, and extrusion. selecting both cylinders in the Constructive Solid Geometry was Combo view, and then choose used to unite two cylinders, and menu option Part > Boolean > the resulting Fusion object was Union. This should make the used to cuttwo holes in the main cylinders disappear from the Combo view, and be replaced by a single Fusion object. Inside the Combo view, choose first the main part Extrude002, and then (with the Ctrl key), also choose Fusion. Then choose Part > Boolean > Cut. Voilà, we have cut out the two holes from the main part.

In the last operation, the order Alan holds a PhD in Information and ofchoosing the main part, and the Knowledge Society. He teaches then the fusion ofthe two computer science at Escola cylinders, is important. Ifone Andorrana de Batxillerat (high- school). He has previously given proceeds otherwise, FreeCAD will GNU/Linux courses at the University tryto cutthe main partoutfrom ofAndorra and taught GNU/Linux the two cylinders, giving four very systems administration at the Open thin cylinders - definitely not what University of Catalunya (UOC).

full circle magazine #121 1 8 contents ^ HHOOWW--TTOO IInnttrroo TToo FFrreeeeCCAADD -- PPtt33 Written by Alan Ward

In this series, we will be between two pipes of different mm, with an initial flared section outside shell ofour solid object in examining the world of FreeCAD, diameters. This project is actually 30mm long on the inside and 35 3D. Likewise, the inside edge of an open-source CAD modelling quite involved from the standpoint mm outside. The shellis 3 mm the wall (in dotted lines) may also application that it still in Beta, but oftechnical drawing, since at one thick along most ofits length, with be revolved around the same axis, has been gaining acceptance in point we will be representing the a slightly thicker section where the giving us the innershellofour3D recent years. Naturally, it is readily intersection between two curved flare meets the main tube body. object. In essence, we will be using available in the Ubuntu surfaces - which always makes for This is done with a gradientof1:2 a similar tool to the extrusion used repositories. In the second article interesting shapes as any pipe both inside and outside. Finally, in the last part ofthis series, but on using FreeCAD, we created a welder can testify to. the main tube bodyhas an inner running around a circle instead of simple planar object to illustrate diameter of40 mm, while the flare moving in a straight line. the use ofthe main workspaces ROLLINGAPIPE goes outto 50 mm internal (Draft and Part), drawing tools, and diameter. To design this part, I could have extrusion. Let us begin with the section of begun within the Draft workbench thin-walled pipe shown here. All What is particularly interesting ofFreeCAD, and drawn each line In this part, we will use further dimensions are in millimeters. In aboutthis piece is the axis of section needed to complete a tools to create a more complex 3D this example, total length is 120 revolution shown in dashed gray: if section ofthe tube wall. However, I object, representing a Y-junction we take the outside edge ofour actually started out with LibreCAD. object and make it revolve around As discussed previously, the this axis, we will be creating the LibreCAD application is best suited

full circle magazine #122 1 7 contents ^ HOWTO - FREECAD to drawing objects in two rotated. In the Draft workbench, select multiple objects - and use Be sure to selectthe Xaxis to dimensions, which is why FreeCAD examine the Combo view on your the join tool. In the combo view, rotate around, since the tube had been preferred as a base tool left, and you will see each we will see the four segments object is symmetrical about this for this series. However, LibreCAD individual line from the DXF file, disappear, to be replaced by a horizontal axis. Also, activate the does have an option to export that can then be erased, moved, or single Wire object. “Solid object” checkbox. This will drawings in the widely-used DXF modified, as needed. allowus to use this partas a (AutoCAD) file format, which can To create the actual 3D tube, complete object further on, and to then be imported into FreeCAD When we are satisfied, as let us move to the Part workbench. make holes in it to allow branching and used as a basis to workwith. before, we will need to combine Now choose the “Rotate object” with the lateral piece ofpipe. Since the lines are already the collection ofLines into a single tool from the 3D toolbar. correctly positioned, it may be Wire object with the “join objects” advantageous to use this scheme tool in the modification toolbar ADDING A LATERAL PIECE OF to set up our FreeCAD object. (whose icon is the blue up arrow). PIPEINA Y-JUNCTION Select all segments, either in the In FreeCAD, begin by starting a combo view or in the drawing itself We are nowgoing to add a new project. Now choose menu - holding down the Ctrl-key to small piece ofpipe, with inner option File > Import diameter20 mm and outer26 mm, attacking our existing tube at an Now, we have several more angle of45 degrees. The axis of elements than are needed for the tube wall. The axis needs to be removed, as well as the (previously dotted) lines denoting rotated edges. The lower copy ofthe wall section will also be erased, leaving just the highercopy, ready to be

full circle magazine #122 1 8 contents ^ HOWTO - FREECAD the new pipe will intersect our shapes to form it. will both appearin the same Now, using the Combo view on existing axis at100 mm along its position, as “Cylinder” and the left, choose the first Cylinder length. Letus begin byhiding the “Cylinder001”. Default and go to the bottom tab marked existing tube. This is done by going characteristics are a radius of2 “Data”. Here, change the radius to There are several ways of to the Combo view on the left, mm and heightof10mm. 13 mm and theheightto100mm. creating this new piece ofpipe. We selecting the Revolve object, and This will be the solid material for could proceed as before, drawing hitting the space key on the our new tube. the outline with Line segments and keyboard. It will not remove the then rotate the piece to create a tube from our project, but simply Choose the second Cylinder, 3D revolution solid. This can be make it invisible - thus making the and do the same, giving itradius created aligned with one ofthe construction of the smaller tube 10mm and height104mm.Thisis standard axes, for example the Y easier to visualize. the shape we will cut out from the axis, and then moved into position first cylinder, making it hollow. as required. However, since the Now, using the Primitives However, as in the part created in shape ofthe newpiece ofpipe is toolbar visible in the Part the last article ofthis series, both rather straightforward, it may be workbench, let us create two cylinders end at the same Z- easier to use pre-existing primitive cylinders. For the time being, they coordinate. This means FreeCAD can have difficulties calculating exactly where the cutout is to end. To make things more clear, let us move the second cylinder downwards by2 mm, making it protrude slightly from each end of the first cylinder. This is done by editing Placement > Position > z in the same tab, and giving it negative value -2 mm. We will now use the second cylinderto cuta hole in the first. In the Combo view, choose in sequence the first cylinder, then the second, holding down the Ctrl- key when choosing the second object. Then, choose menu option Part> Boolean > Cut, and the two

full circle magazine #122 1 9 contents ^ HOWTO - FREECAD cylinders should be combined into vertical and needs to be tilted to unscroll Placement. We need to The easiest solution for the first a single hollow tube using 45 degrees, while the larger change the Axis values to [0.00, bit is simply to undo ourboolean Constructive Solid Geometry. Revolution object has been placed 1.00, 0.00] since we will be rotating cut operation by simply clicking on at some distance from the around the Yaxis, and then change the Cut object in Combo view, and We are ready to assemble the coordinate system’s origin for Angle to -45 degrees to tilt the Cut deleting it. We should now have two parts ofour project. Go back some reason, perhaps related to object backwards to our left. three objects in our project: the to the Combo view, choose the the use ofa DXF file to importits Revolve object representing the Revolution object - the main tube - basic shape. Now select the Revolution large tube, Cylinder as the outer and press the space key. Both object, and modify Placement > shape ofthe small pipe, and objects should become visible at To tilt the Cut object, go to the Position > x value until the two Cylinder001 the inner shape ofthe once, with a bit ofzooming. Combo view, select this object, parts are assembled in their cutout. The two Cylinder objects However, the new Cut object is still choose the Data tab as before, and correct position. I needed to will need to be rotated once more specify -200 mm for this to to -45 degrees along the Yaxis, happen. since the rotation we had applied previously concerned the We still have a couple of combined Cut object which we problems, however. The small pipe have since erased. is protruding through the wall of the main tube, butitis notyet Now, add a third Cylinder object cutting a hole in thatwall. On the - labelled Cylinder002 - to otherhand, there is a piece ofthe represent the interior of the large small pipe within the large one tube. Itshould have radius 20 mm, that also needs to be cut off.

full circle magazine #122 20 contents ^ HOWTO - FREECAD section of each piece, for instance to make sure there is enough material to support any structural or pressure stresses that the finished part may encounter. This cutting open is left as an height124 mm, be rotated on Axis order: Fusion, then Fusion001, and exercise to the [0.00, 1.00, 0.00] (the Yaxis) by+90 choose Part > Boolean > Cut. We reader. Hint: try degrees, and then placed to the should end up with ourfinal, Part > Boolean > left by 92 mm by changing Position finished tube Y-union. We can note Intersection with >xvalueto-92 . the shape ofthe union between another object. the two tubes. Finally, we can join the two investigate the use of sketches to external objects, Revolve and This technique ofcombining all WHATNEXT? implement constraints on segment Cylinder, in a single Fusion object: the bits ofourproject that add placing. choose Revolve, then Cylinder with material into a single Fusion In this article on using FreeCAD, the Ctrl-key pressed, and finally object, and all cutouts into another we used several techniques to menu option Part > Boolean > before making the final Cut, can create a complex 3D object, Union. This should create a new come in useful when designing representing a Y-junction between object called “Fusion”. Now, do the parts with complex CSG two pipes of different diameters. same with Cylinder001 and geometries. The general workflow The Revolution tool was used to create the form ofa tube in 3D, Cylinder002, creating “Fusion001”. is similar to that used in Sketchup, Alan holds a PhD in Information and At this point, we should see only which should mean making the from a plane section ofthe tube the Knowledge Society. He teaches the two Fusion objects, one transition from one program to the wall. The Cylinder primitive was computer science at Escola representing the material we are other is rather painless. used to create the form ofthe Andorrana de Batxillerat (high- small pipe attached to the main school). He has previously given adding to ourproject, and the GNU/Linux courses at the University second representing the cutout or Once completed, our object can tube, and then to create cutouts to ofAndorra and taught GNU/Linux material we will be subtracting. be cutopen as needed to examine empty out both forms. In the next systems administration at the Open Now choose these two objects in the interior geometry and the part ofthe series, we will University of Catalunya (UOC).

full circle magazine #122 21 contents ^ HHOOWW--TTOO IInnttrroo TToo FFrreeeeCCAADD -- PPtt44 Written by Alan Ward

n this series, we will be ends ofthe segment. But it could easily visible in FreeCAD version using other features that are more I examining the world of FreeCAD, also be defined as the tangentto a 0.15 as could be desired. As has clearly available in the program. an open-source CAD modelling circle at a certain point, and with a been pointed out in a previous part This is the subject ofthis article. application that is still in Beta, but specific length. A further ofthis series, this application is has been gaining acceptance in possibility is to define a line known to still be very much in ANEXAMPLE recent years. Naturally, it is readily segment as being parallel to a development, so there is hope that available in the Ubuntu previous segment ofthe same such features may be made more To visualize the problem, let us repositories. In the third article on length and offset to a specific accessible as the application begin bydrawing up a simple flat using FreeCAD, we created a distance. As for circles, they may evolves. Version 0.16 - in the piece, with a geometry similar to complex 3D object representing a be defined from a centerand a repositories for Ubuntu 17.04 - that used in an engine connecting Y-junction between two pipes of radius, or from three points that already hints at the presence of rod. This part is basically made up different diameters. are not on the same straight line, layers within a sketch. In the oftwo rings, one ateach end, and so forth. meantime, users ofversion 0.15 - in connected with two rectangular In this part, we willgo backto the repositories for Ubuntu 16.04 spars. The centerofthe rod has basics and examine how A second set oftechniques that LTSand LinuxMint18 -can today been removed, possibly to lighten constraints can be used to draw may be considered quite basic in work around these limitations by complex planar shapes, that can traditional applications is the use then be used as a basis to create oflayers. In a program such as figures in 3D. LibreCAD, default line width, color and style (dashed, dotted, ...) may Users of traditional CAD be defined for each layer. Ahandy software such as AutoCAD or technique is thus to place the main LibreCAD are well accustomed to elements ofeach drawing in one two sets oftechniques that help layer, while another is used to draw complex shapes from indicate dimensions, and a third to individual elementary shapes such draw auxiliary items to help as lines orarcs. The first set of construction. When exporting the techniques is the different ways in drawing, individual layers may be which an elementary shape can be hidden with a single mouse click. defined in these applications. For instance, a straight-line segment Atthis pointin time, the use of may be defined by indicating both such techniques is perhaps not as

full circle magazine #123 20 contents ^ HOWTO - FREECAD

new project. Now, we could Once editing the new Sketch, proceed as in the previous we can begin bychanging the episodes, by going into the Draft defaultgrid size from 10 to 5mm, workbench and setting up the since the dimensions ofour part elements ofthe drawing using the are all multiples of5mm. Let us tools available there for drawing draw the two circles that define lines, circles and arcs. However, the left ring ofour part, with though we can snap element respective radii of20 and 25mm. It vertices to the grid, or even to is interesting to note how the another element, there is no way shape ofthe mouse pointer ofensuring that a line stays changes when creating a new tangentto a circle oran arc. For point. In a general situation, the this reason, we will go into another shape is a red circle, with the new the part. as tangent to the grey circles. An workbench, the Sketcher. Here, we point’s coordinates in blue beside alternative way ofdoing it is to will create a new Sketch object, it. However, ifwe click on an To draw this part in a traditional define the green segments as within the X-Y (horizontal) plane. existing point, a red dot shows up manner, the first step would be to parallel to the red segments that This type ofobject represents a beside the circle. Ifwe click in this create a layer that holds only have already been placed, while flat drawing, considered as a situation, we can choose to link auxiliary lines –that will not be specifying an offset - in this case, separate entity from the rest of both points. This is ideal when we part ofthe finished drawing. For 5mm. our project. are drawing two circles with the instance, one could begin by same center. If, later on, we move drawing all the circles. We can then create a second - one ofthe center vertices, both main - layer, and drawthe willmove atthe same time -and Once the circles are defined, segments and arcs ofthe final both circles will be displaced an the external edge ofthe spars can part. Selecting snap-to- equal distance. be placed (in red). The easiest way intersection instead of the more in a traditional CAD application is usual snap-to-grid allows us to Other options include placing to specify a line segment as carefully terminate each element the newpointon a segmentofan tangent to both red circles, once precisely at the intersections arc, thus linking the point to the forthe uppersparand once forthe between lines and circles. arc. Ifwe then displace one ofthe lower. Then, the inner edge ofeach two objects, the movement ofthe sparneeds to be drawn (in green). ON TO FREECAD other will equally be constrained. There are several ways ofdoing Likewise, when a line segment is this. The same procedure may be To create the same part in drawn and one ofthe vertices has used, with each segment defined FreeCAD, let us begin by creating a already been placed, a horizontal

full circle magazine #123 21 contents ^ HOWTO - FREECAD

or a vertical constraint can be making sure the two elements placed on the segment by placing remain in connection. We do not the second vertex when the mouse wantthis to happen; on the cursor contains the corresponding contrary, we want the circles to red horizontal or vertical bar. determine the position ofthe segments. So let us place a Once the two circles have been constraint on the position ofeach ofour circles. Click on the center ofthe circles - which should be a single round dot-and then use the constraint toolbar to choose the “lock” constraint which has an icon shaped, rather appropriately, like a padlock.

Let us continue by drawing the remaining circles, and locking them created, we can inspect the into place. We should now see four number ofelements created in the constraints, two for each center “Elements” window, and select (one horizontal and one vertical), each element by clicking on it. within the “Constraints” window at the left ofthe screen. The four Once selected, each element circles should look approximately can be moved around using the like the image on the nextpage mouse. This is fine forthe time (top left). being, but will introduce a difficulty when the connecting We have constrained (fixed) the segments are placed to create the position ofthe center ofeach connecting rod itself: altering the circle. However, their radii are not position ofa segment may very yet constrained, and could be wellend up bymoving one ofthe altered when connecting segments circles that is connected to it, thus are added. To fix their size, select

full circle magazine #123 22 contents ^ HOWTO - FREECAD

each circle in turn and select the not yet necessarily tangent to each “Fix de radius” constraint, a red circle. To impose this new set of disappeared in the normal view, circle with a baron it, from the constraints, click on the dot The final result, with all four segments placed and the elements and we are left with ourshape’s constraints toolbar. Our sketch representing the segment terminal individual elements - all grouped should now change aspect, with all vertex, then click on the circle. completely constrained, should appear like that shown below. together in a single planar Sketch elements changing color to Finally, choose the “Create a object. become green. This indicates our tangent” constraint. The operation sketch is fully constrained: existing will need to be repeated several Up until this point, we have elements cannot be further times, once for each intersection been actively editing our Sketch BUILDINGTHEFINALSHAPE moved, unless at least one ofthe between a segment and a circle. It object. We can now close this constraints is lifted. may also be necessary to remove object, returning to the standard What we have obtained so far spurious horizontal constraints on FreeCAD view, and examine our is, in fact, just the auxiliary, We are now ready to place the our segments, ifthey should handiwork. All constraints have constructive aides to help us place connecting segments on our - now appear during construction. immobile - circles. Start by drawing a line segmentfrom one ofthe external circles, to the other. By carefully placing the mouse, we should be able to constrain the segment’s vertices so that each remain on a circle -this is the symbolofa red arcwith a dotin its center. However, it should rapidly become clear that this segment is

full circle magazine #123 23 contents ^ HOWTO - FREECAD our final arcs and segments. It Sketch. To do so, create a point would be nice to see them in a using the tools with the icon with different color and style, to help us the red dot. When placing the distinguish between helper traces point, snap to one ofthe elements and elements belonging to the creating the intersection, for final drawing. There are two ways example to the circle. Then click on ofgoing about this. The first is to the new point, click on the other exit Sketch edition. By clicking element ofthe intersection - for once on the Sketch, we can example, a line segment - and proceed down to the “Property” create a new constraint oftype window, and change both “Line “Fix a point onto an object”. The Color” and “Draw Style” for all point should then be fixed by lines in the Sketch in a single being constrained twice, once to action. each element, and thus should stay Sketch. Go back into editing the Atthis point, we can use the in place at the intersection. Sketch object (double-click on the Sketch object to print a diagram in object), selecting all the lines and two dimensions. However, we switch them all to “Construction cannot use it directly to create a mode” using tool . This will change three-dimensional part. To do so, theircolorto blue - and make them we mustbegin be going to disappear from the Sketch when workbench Draft, and there this is not being viewed from convert the Sketch object into a within edition mode. We can then collection of drawing proceed by creating the points at elements using the intersections, as needed. Continue appropriate Once the points at the by adding further elements to the conversion tool: . Then, we can proceed to the intersections have been created, Sketch object, taking these “Draft” workbench. Once here, we lines in the Draft workbench and constructive elements as a guide. Once this has been done, we can use the drawing tools from the can be snapped to these points if These elements, drawn in normal can go to the Part workbench, Draft toolbar (with yellow/black the “Snap to intersection” option is mode, will appear when not extrude each object (the two icons) to drawon top ofthe chosen (the icon with a green ‘X’ editing the Sketch. Since they are circles and the two outline shapes) Sketch. from the snap toolbar). based upon other elements in individually, and then combine constructive mode, some elements them using boolean operations Intersections between Sketch Asecond wayof may need to be converted to (Fusion and Cut out) to create the elements can be made easily drawing the final shape normal mode using the same tool: . final piece in 3D, as described in detectable ifa point is placed at ofourpartisto do it Part 2 ofthis series. each intersection from within the directly inside the

full circle magazine #123 24 contents ^ HOWTO - FREECAD

WHATNEXT?

In this article on using FreeCAD, we created a Sketch object, to place individual drawing elements such as lines, arcs and points, in a precise relationship to each other using constraints. We noted the use of Construction mode elements within the Sketch object, to aid construction ofthe Alan holds a PhD in Information and complete diagram while not the Knowledge Society. He teaches appearing in the final drawing. In computer science at Escola the next part ofthe series, we will Andorrana de Batxillerat (high- change scale altogether and work school). He has previously given GNU/Linux courses at the University on an architectural project. ofAndorra and taught GNU/Linux systems administration at the Open University of Catalunya (UOC).

full circle magazine #123 25 contents ^ HHOOWW--TTOO IInnttrroo TToo FFrreeeeCCAADD -- PPtt55 Written by Alan Ward

n this series, we will be the small technical parts we have I examining the world of FreeCAD, drawn up so farand an an open-source CAD modelling architectural project lies in the every millimeter may not be of is always indicated in the lower application that is still in Beta, but units used. Small parts tend to be much use to build a house. So, right corner ofthe display. has been gaining acceptance in easily measured in millimeters. continue within the Preferences recent years. Naturally, it is readily However, in the case ofa building dialog box, and go to the Draft available in the Ubuntu it would make sense to use larger USINGTHE ARCH pane. Here, choose the Grids and repositories. In the fourth article units such as meters (in the metric Spacing sub-pane, and change the WORKBENCH on using FreeCAD, we created a system). To set up the value for “Grid spacing”. Sketch object, to place individual environment, let us begin by Let us begin actual design by drawing elements such as lines, starting up FreeCAD, and choose a As a quirk, itmaybe necessary noting the existence ofa specific arcs, and points, in a precise new Project. Then go to menu to save your project, close “Arch” workbench. This toolset has relationship to each other using option Edit, and choose FreeCAD and open it once more to been specifically conceived to draw constraints. We noted the use of Preferences. Within the General actually see the grid with its new designs ofbuildings as a Building Construction mode elements pane, choose the Units sub-pane size. Remember to use the mouse Integrated Model, or BIM. In this within the Sketch object, to aid and change “User system” settings wheelto zoom outto see a concept, building elements are construction of the complete from millimeters to meters - or the sufficiently large amount of the X- labelled as such: walls become a diagram while not appearing in the imperial system ifthat is your Y plane. Remember the visible area Wall object, openings such as final drawing. In this part ofthe preference. windows or doors become Window series, we will change scale objects, and objects such as a altogether and work on an Though we have changed the Support, a Roofor a complete architectural project. main units, the auxiliary grid that Building object can be specified comes up to help us place using the appropriate toolbar. elements will still use the former SETTING UP OUR UNITS aperture value between grid lines. To begin a newbuilding, one Having a 1x1 m grid with lines The main difference between

full circle magazine #124 1 8 contents ^ HOWTO - FREECAD could start in the Draft workbench, thicknesses. by drawing out the general floorplan. Simple lines are To continue, one would need to sufficient to indicate the position place openings. To do so, start by ofeach wall. Forthe time being, no creating a Sketch object attached mention needs to be made ofwall to the corresponding wall object. widths and ofthe placement of This Sketch object needs to contain openings. For instance, one could a closed form that represents the draw up the following building, shape ofthe opening. representing a small school module with two classrooms or For instance, one could create a laboratories, one preparation simple rectangular window for one room between them, and an ofthe classrooms. Choose the wall new Sketch object is actually we should see how the original exterior corridor. objecton which to draw, go to the associated to and within the Wall Wall object (Wall004) has been Sketch workbench, and create a object. Then go to the Arch replaced by a new Wall (Wall006), Once the floorplan has been new Sketch object. Using the workbench and transform the that contains both the original drawn in this fashion, move to the Sketch constraint system described Sketch into a Window object. shape and a new Window object. Arch workbench, and select all in the previous part ofthis series, Within the Combo View to our left, This latter object in turn contains lines. Then select the the four lines that describe the Wall tool , and all lines position ofthe new window can be magically become placed with some precision. proper Wall objects. A default value of3m is used forwall Once finished, close Sketch heights, and 0.2m for wall edition mode, and make sure the

full circle magazine #124 1 9 contents ^ HOWTO - FREECAD the Sketch. Each internal object On the otherhand, this partof its features, that may be of Draft and Sketch workbenches to defines the shape ofthe external the FreeCAD software is possibly interest as further reading: draw traditional views ofour one that contains it. the least mature for the time https://www.freecadweb.org/wiki/ construction. However, we should being. As work in progress, Arch_tutorial always bear in mind that FreeCAD developers seem to be exploring is a 3D-oriented computer design the possibilities ofthe BIM A MORE TRADITIONAL program. For this reason, limiting ourselves to the more traditional approach, and there are some APPROACH rough edges. Element placement is conception of architectural still rather fiddly, and much care drawings - planar projections and Users who do notneed ordo perspectives - can certainly work, mustbe given bythe userto place not care for the features ofBIM objects correctly within their butwe would lose outon the may feel more comfortable using capabilities of visualizing the containing objects. Roof creation is the more standard tools in the an art by itself. Object conception building in the third dimension is made using regular parts that may, or may not, correspond to the real world. For instance, working with a building interior floor that is The Arch workbench and the not completely flat may become a BIM approach to building an challenge, as may be working with architectural project has several walls that have varying levels of advantages. One is ease ofuse, thickness along their length. specially when working with a Solving corner intersections rapid prototyping approach, under between walls may also become an which several models may be issue. tested to explore the possibilities ofa new site or construction idea, For this reason, the choice of before settling on a particular using the Arch workbench must be solution. Just lay down the lines, left entirely to each individual user. and build up yourwalls. Asecond Some people may hate the limits advantage is that, once the new this approach places on their building’s elements have been workflow, while others may revel defined as such, the information in the ease ofcreation ofmodern- Photo credit: Wikipedia user Zarateman (https://commons.wikimedia.org/wiki/User:Zarateman ). contained within the model can be looking buildings. In any case, one used to automate calculations, Original link: ofthe designers ofFreeCAD has https://ca.wikipedia.org/wiki/Catedral_de_Tarragona#/media/File:Tarragona_- such as surface area or building created a rather good tutorial on _Catedral,_claustro_01 .JPG volume.

full circle magazine #124 20 contents ^ HOWTO - FREECAD that FreeCAD allows us. latter that will inspire us to design support. Using simple values, I figure (snap to the vertical grid the cloister arches, such as those drew two vertical lines 0.5m high line), giving the right part ofthe To see how this could work out, found in Tarragona Cathedral, and set1m apart. I wasthen able arch. Now draw a similar circle let us project something that Catalonia. to draw the arched top part ofour centered on the top ofthe right would be rather difficult to draw figure. In its most traditional form, post, and draw the left part ofthe up using the Arch workbench: an Letus begin bydrawing a this is the combination oftwo arch. arcaded cloister. This is typically a simple Gothic arch. In FreeCAD circular arcs. In the figure below, a square or rectangular space that (bottom left), go to the Draft construction circle has been drawn Once we exit editing mode, we consists in a covered walkway workbench and set the grid in blue: centered on the top ofthe obtain a nice outline ofourGothic surrounding a central open area aperture to 500mm. Then go to the leftmost vertical segment (green arch, which would in the this case with vegetation, an arrangement Sketcher workbench, and start a point), it passes through the top of be called an equilateral arch. Since thathas been used both in a new Sketch object. Here, we will the rightpost, giving ita radius of real architectural elements have certain type ofIslamic garden (e.g. probably need to alter the grid 1m. Using this circle, drawan arcof volume, we nowneed to find a way Patio de los Leones, Alhambra aperture a second time, to 0.5 m a circle from the rightmost post up oftransforming this into a volume, Palace in Granada, Spain) and in (same value, different units). We towards the centerline of the keeping as much in character with Christian churches, both in can then begin by drawing the Romanic and Gothic styles. It is this base ofourarch, using the grid as a

full circle magazine #124 21 contents ^ HOWTO - FREECAD real Gothic building techniques as element profile that fits within a possible. However, when one 10x20 cm rectangle. Close this studies carefully the stone parts second sketch, and we can now that go into making up real Gothic proceed to the Part workbench. In arches, one almost always finds this, select the Sweep tool . that the same profile has been cut In this tool, we select all along soft pieces ofwhite one ofthe sketches as the sandstone. Therefore, if we can create such a profile and somehow sweep it along our arch outline, we should end up with a perfect three dimensional arch frame.

Please do make sure this shape is complete, i.e. that all lines connect well to each other. The penalty fornot doing so would be a final arch shape thatis builtup only in part - with anotherpart missing.

I drew my arch sketch (previous page, bottom right) in the XY plane. I will now create a second form to be swept, and the otheras Sketch object, but at right angles the path to sweep it along. within the XZ plane: the X-axis is in However, there are some caveats. the left-right direction, Y is top- The main point is the relative bottom, and Z goes along the arch placement of each sketch. Their depth. relative positions will be respected when one is swept along the other. Within this new Sketch It is best to ensure the swept form is actually placed upon the path Please note that the grid before proceeding. In my case, I dimensions have been changed. needed to displace itsome 0.5 m We are now working with an leftward ofthe place where it had aperture of5 cm, giving an been created, in the vicinity ofthe

full circle magazine #124 22 contents ^ HOWTO - FREECAD prepared, what we have actually achieved is a computer model of the elegant carved stone frame of the arch. However, this arch would not work well in architecture by itself, butmustbe partofa wall or a complete structure.

To create this wall, I draw a simple rectangle 1.1 m wide by2.1 m high in the XYplane, overlapping the arch by several centimeters on all sides. I then extruded this flat piece as a rectangularvolume - as in Part II of this series, which I then dyed red. The final touch is to make a Pocket indentation in this rectangle, to coordinate system’s origin. For accommodate our arch. This done some reason, I also needed to by selecting one ofthe outward move the second sketch downward faces ofthe rectangle, and a smallamount-some 25 mm, creating a Sketch on this face, with presumably to ensure it was not in the same shape as ouroriginal the vicinity ofa connection point arch. A copy ofthe arch sketch between segments ofour arch could also be made, and then sketch. attached to the face ofthe rectangle. Then use the Pocket In this partial view, one can see tool in the Part design workbench how the wireframe arch sketch is to push the sketch form “inwards”. acting as a support for the second, Ifsufficient depth is given to it, it profile, sketch, as it goes around willend up bymaking a hole using the first sketch as its path. straight through our rectangle, in the correct shape to place our arch Once the final arch volume in. tridimensional shape has been The arch Sweep volume and the

full circle magazine #124 23 contents ^ HOWTO - FREECAD red Pocket can then be selected, allowed us to create an element and united into a single with the shape ofan arch by Component representing a sweeping one sketch (a profile) complete architectural module. around another sketch (the outline of an arch). This module can then be copied and pasted several times, to form a In the next part ofthis series, series ofarches. Each element will we will extend FreeCAD’s need to be displaced and perhaps possibilities using a little Python also rotated into its final place, programming, to create a working with the object’s Data helicoidal surface in the shape ofa pane in the lower left toolbox. This gear wheel. series ofarches can be further replicated, until a complete architectural ensemble is formed.

WHATNEXT?

In this article on using FreeCAD, we worked on an architectural project in two different ways. In the first place, we used the Arch workbench to create a modern architectural project, in which supplementary information is given to the computer, so using FreeCAD to create a Building Integrated Model (BIM). Since this approach is in an earlystage of Alan holds a PhD in Information and the Knowledge Society. He teaches development, and is limited to computer science at Escola simple forms, we then used a more Andorrana de Batxillerat (high- traditional approach to create school). He has previously given volumes in the same wayas in GNU/Linux courses at the University ofAndorra and taught GNU/Linux previous projects, but on a larger systems administration at the Open scale. The sweeping technique University of Catalunya (UOC).

full circle magazine #124 24 contents ^ HHOOWW--TTOO IInnttrroo TToo FFrreeeeCCAADD -- PPtt66 Written by Alan Ward

n this series, we will be using a little Python programming case ofmany programming In the second place, we can open a I examining the world of FreeCAD, to create a helicoidal surface in the languages with a wide acceptance console view of FreeCAD’s inner an open-source CAD modelling shape ofa mechanical gear wheel. in ourdays, such as PHP on servers workings by simply choosing menu application that it still in Beta, but or Python on users’ computers. As option View > Views > Python has been gaining acceptance in PROGRAMMING FREECAD? a side-note, the Java language console. Each action we carry out recent years. Naturally, it is readily tends to pertain mostly to the through the User interface is ANDWHY PYTHON? available in the Ubuntu former, compiled category (though actually converted into Python repositories. In the fifth article on with caveats), while the very commands the program’s core As many readers will be aware, using FreeCAD, we worked on an similarly termed Javascript is logic-and we can see itin real the world ofprogram language architectural project in two actually quite a different beast and time in this console. If, for instance, implementation is divided into two different ways. In the first place, is mostly used interpreted by web I create a new project, switch to main categories. There are we used the Arch workbench to browsers. the Draft workbench, and draw a programming languages such as C create a modern architectural line, Below is what actually or Fortran for which the source project, in which supplementary FreeCAD has been built in happens. code needs to be compiled (into information is given to the Python, thus an interpreted our computer’s machine language) computer, so using FreeCAD to language. This is quite convenient This is quite neat, since one can in order to be executed. There are create a Building Integrated Model for several reasons. In the first learn about the different also interpreted languages that do (BIM). Since this approach is in an place, it makes the application commands used in an interactive not need to be compiled (or early stage ofdevelopment, and is more easy to transport to other way. Naturally, once one has a “translated”, to give a mental limited to simple forms, we then computer architectures and grasp ofthe fundamentals, they picture ofwhat is happening when used a more traditional approach operating systems, as long as a can be used to write one’s own using a compiler), but may be to create volumes in the same way Python interpreter is available for scripts, and have them executed by interpreted directly by a special as in previous projects, but on a the desired platform - and Python FreeCAD. program on the user’s computer, larger scale. The sweeping is getting quite ubiquitous, indeed. called an interpreter. This is the technique allowed us to create an element with the shape ofan arch by sweeping one sketch (a profile) around another sketch (the outline of an arch).

In today’s part ofthis series, we will extend FreeCAD’s possibilities

full circle magazine #125 22 contents ^ HOWTO - FREECAD To take an example, let us write issue command: a simple Python script that will import Part create a simple box shape. Create a freecad test1.py doc = FreeCAD.newDocument("Box Model") new file called “test1.py”, and copy doc = App.ActiveDocument We will see FreeCAD start up box1 = doc.addObject("Part::Box", "box1") in the code shown top right. box1.Height = 40 and execute our script line-by-line, box1.Width = 30 The Part library contains the giving the final result shown box1.Length = 50 below. tools from the Part workbench. We doc.recompute() begin by creating a new project, called “Box Model”. We make this As a second example, let us Gui.SendMsgToActiveView("ViewFit") Gui.activeDocument().activeView().viewAxometric() the active document (window), and build something slightly more add a newobjectbased on the complex: the shape ofa tin that consists in a flat shape (two arcs “Part::Box” prototype, naming it import Part “box1”. We set its dimensions, and connected by straight segments), have the document recalculate that will then be extruded to form doc = FreeCAD.newDocument("Tin") a volume. Bottom right is the itself. We then tell the user V1 = FreeCAD.Vector(0,10,0) interface (“Gui”) to zoom the view script, in file “test2.py”. V2 = FreeCAD.Vector(30,10,0) to fit the new object, and select V3 = FreeCAD.Vector(30,-10,0) V4 = FreeCAD.Vector(0,-10,0) the Axonometric (3D) view. Let us comment on the differences with the previous L1 = Part.Line(V1,V2) To execute our script, switch to example. In this case, we begin our L2 = Part.Line(V4,V3) a terminal window in the same new object by creating four VC1 = FreeCAD.Vector(-10,0,0) directory we have the .py file, and vectors V1 to V4, that indicate the C1 = Part.Arc(V1,VC1,V4) VC2 = FreeCAD.Vector(40,0,0) C2 = Part.Arc(V2,VC2,V3) E1 = Part.Edge(L1) E2 = Part.Edge(C1) E3 = Part.Edge(L2) E4 = Part.Edge(C2) W = Part.Wire([E1,E2,E3,E4]) F = Part.Face(W) P = F.extrude(FreeCAD.Vector(0,0,10)) tin = doc.addObject("Part::Feature", "tin_solid") tin.Shape = P doc.recompute() Gui.SendMsgToActiveView("ViewFit") Gui.activeDocument().activeView().viewAxometric() doc.saveAs("tin.fcstd")

full circle magazine #125 23 contents ^ HOWTO - FREECAD positions of the connection points executed from the terminal, shown that is iterated at a fixed angular center, or pitch surface. In our between the arcs and the straight below is the result ofour script. offset between each individual case, we specify a 100mm radius. lines. We then create the two tooth. Simplifying somewhat, this is the straight segments, L1 and L2, and LETS DRAW SOME GEARS point at which the other gears finallythe two arcs C1 and C2. We Let us concentrate on the connected to this one will transfer then need to convert these four Scripting can come in useful exterior shape, slightly more theirforce. Points 3 and 6 in our items into Edge objects, E1 to E4, when we need a shape that complex than the interior splines. schematic are on this surface. which are then connected into a contains many similar, but Each individual tooth is centered at Going outwards, teeth extend to Wire object W. This is the outline different and calculable parts. In a certain radius from the wheel an outerlimit, the top flat. Points 4 ofour tin’s top. Please ensure lines such cases, writing a program to and arcs are setup in the correct iterate over our shapes can be order, otherwise connectivity cost-effective in terms of our time. errors may ensue. Finally, the Wire Atypical case is when creating a is converted into a bidimensional mechanical gear wheel. Such a Face object F, which is then wheelcan be seen asa extruded into a Shape P. Ageneric combination of an exterior shape, volume is derived from formed by a certain number of “Part::Feature”, and is given P as its teeth orcogs, and an innershape shape. that delimits the axis. This can be either smooth or splined so that As a final note, the finished the axis can transfer torque to and project can be saved directly from from the wheel. Both the interior our script, by calling the and the exterior wheel forms are doc.saveAs procedure. When formed ofa basic shape or motif,

full circle magazine #125 24 contents ^ HOWTO - FREECAD

import Part, math radius = 100 # wheel pitch surface radius (mm) bottom = 90 # bottom land radius (mm) top = 110 # top land radius (mm) teeth = 16 # number of teeth doc = FreeCAD.newDocument("Cog") vertex1 = [] for i in range(0, teeth): x = bottom * math.cos(2 * math.pi * (i - 0.45) / teeth) y = bottom * math.sin(2 * math.pi * (i - 0.45) / teeth) vertex1.append(FreeCAD.Vector(x, y, 0)) vertex2 = [] for i in range(0, teeth): and 5 are on this radius, in ourcase x = bottom * math.cos(2 * math.pi * (i - 0.05) / teeth) y = bottom * math.sin(2 * math.pi * (i - 0.05) / teeth) taken at110 mm. Finally, we need vertex2.append(FreeCAD.Vector(x, y, 0)) to “make some space” inwards, to vertex3 = [] for i in range(0, teeth): accommodate the other wheel’s x = radius * math.cos(2 * math.pi * i / teeth) y = radius * math.sin(2 * math.pi * i / teeth) teeth. So we go inwards to the vertex3.append(FreeCAD.Vector(x, y, 0)) bottom flat, atradius 90 mm in our vertex4 = [] for i in range(0, teeth): case, and holding points 1 and 2. x = top * math.cos(2 * math.pi * (i + 0.1) / teeth) We will iterate this basic shape y = top * math.sin(2 * math.pi * (i + 0.1) / teeth) vertex4.append(FreeCAD.Vector(x, y, 0)) overthe 16 teeth ofourwheel. vertex5 = [] for i in range(0, teeth): x = top * math.cos(2 * math.pi * (i + 0.4) / teeth) Our script (right) will simply y = top * math.sin(2 * math.pi * (i + 0.4) / teeth) vertex5.append(FreeCAD.Vector(x, y, 0)) draw a series oflines from vertices vertex6 = [] for i in range(0, teeth): 1 through 6 ofeach cog, and then x = radius * math.cos(2 * math.pi * (i + 0.5) / teeth) on to vertex1 ofthe nextcog. y = radius * math.sin(2 * math.pi * (i + 0.5) / teeth) vertex6.append(FreeCAD.Vector(x, y, 0)) Since Python has a mathematical edges = [] for i in range(0, teeth): library “math”, sine and cosine nexti = (i + 1) % teeth functions can be used to calculate L1 = Part.Line(vertex1[i], vertex2[i]) edges.append(Part.Edge(L1)) a pair ofX and Y-axis coordinates L2 = Part.Line(vertex2[i], vertex3[i]) for each vertex. The script itself is edges.append(Part.Edge(L2)) L3 = Part.Line(vertex3[i], vertex4[i]) quite straightforward. As a note, in edges.append(Part.Edge(L3)) L4 = Part.Line(vertex4[i], vertex5[i]) ourexample we are using only edges.append(Part.Edge(L4)) straight segments. However, in a L5 = Part.Line(vertex5[i], vertex6[i]) edges.append(Part.Edge(L5)) real gear wheel, the bottom and L6 = Part.Line(vertex6[i], vertex1[nexti]) edges.append(Part.Edge(L6)) top flats, and the contact faces, W = Part.Wire(edges) would more usually be drawn with F = Part.Face(W) wheel = doc.addObject("Part::Feature", "cog") arcs. wheel.Shape = F doc.recompute()

full circle magazine #125 25 contents ^ HOWTO - FREECAD Once we have the cog shape in four-by-four vehicle’s transfer box. vehicle gear boxes, helicoidal gears FreeCAD, we can continue using it can be preferred. “by hand” within the normal user However, straight teeth do have interface, as a basis for an the disadvantage ofcreating quite To drawsuch a gearwheel, the extrusion or any other operation a bit ofnoise during operation, same tooth pattern can be used, we wish. With a similar script to since, during each rotation, each but swept along a helicoidal path draw the central, crenellated tooth engages immediately with instead ofusing the simple linear shape for the splines, we can the other gear wheel’s extrusion tool. extrude both the external volume corresponding tooth along the ofthe gearwheel and the volume complete width ofthe tooth. This Start, in the Part workbench, by ofthe inneraxle, and then use a produces the typical whining noise selecting the Part > Create boolean operation to cut one out that can be heard from some Primitive menu option. Here, we ofthe other. We can thus obtain mechanical setups. In most can select the Helix shape. Since I the shape ofa traditional straight modern applications where wished to create a gearwheel 50 gearthatwould be found in many smoothness ofoperation and low mm in width, with teeth sloped at traditional applications such as a noise emissions are valued, such as

full circle magazine #125 26 contents ^ HOWTO - FREECAD approximately 1:20 across the the final object. Python is a fully- allows us to create forms and width ofthe wheel, I chose a helix WHATNEXT? developed programming suite, volumes with less regularity, the heightof50 mm, buta pitch of containing many different libraries mesh. 1000 mm between helix spires. The In this article on using FreeCAD, both mathematical and for other external radius ofthe helix should we extended FreeCAD’s purposes, that can be used in correspond to the point at which it possibilities using a little Python combination with FreeCAD to will be created. Both right-handed programming to create a helicoidal create objects that do not exist and left-handed helices can be surface in the shape ofa gear within the initial library ofbasic used, as needed. wheel. Once the basic shape has shapes. been drawn using a script, itcan be Once the helicoidal line is used in combination with any other In the next part ofthis series, drawn, itcan be used asa path of the techniques available from we will concentrate on a more along which to sweep the cog’s the graphical interface to create complex primitive object that external face, using the same tools as when creating a Gothic arch in the previous part ofthis series. The internal surface will be created using a linear extrusion as before, since even a helicoidal gear wheel’s internal splines tend to be straight so as to facilitate assembly ofthe wheel on its supporting axle. The resulting wheel is actually a fair approximation ofan actual gear. Some aspects would be made better, though, such as bevelling external edges to make them less aggressive, or cutting out part ofthe gear wheel’s Alan holds a PhD in Information and material to make it lighter and use the Knowledge Society. He teaches computer science at Escola less material in fabrication. These Andorrana de Batxillerat (high- operations can also be done in school). He has previously given FreeCAD, and are left as an GNU/Linux courses at the University exercise to the reader (hint: use a ofAndorra and taught GNU/Linux systems administration at the Open revolution surface to create University of Catalunya (UOC). cutouts for each face).

full circle magazine #125 27 contents ^ HHOOWW--TTOO IInnttrroo TToo FFrreeeeCCAADD -- PPtt77 Written by Alan Ward

n this series, we will be primitive object that allows us to describing scenes in 3D -such as FreeCAD already knows how to I examining the world of FreeCAD, create forms and volumes with less OpenGL- have primitives for such build several types ofbasic an open-source CAD modelling regularity, the mesh. triangles. meshes, such as the simple shapes application that is still in Beta, but (cylinder, cone, sphere) defined in has been gaining acceptance in WHATISAMESH? According to the specific the Part workbench. These meshes recent years. Naturally, it is readily application, however, 3D scene file can be exported to several file available in the Ubuntu Amesh can be taken asa formats can hold more, or less, formats, among them STL. Simply repositories. In the last article on representation of a two- information about the mesh. One choose the part, then switch to the using FreeCAD, we worked on an dimensional object (a surface), ofthe file formats commonly used Mesh workbench and choose menu architectural project in two situated within tridimensional in 3D printing, the option Mesh > Create mesh form different ways. In the first place, space. Mesh objects can be made STereoLithography (STL) format, shape. Anewpart, with a meshed we used the Arch workbench to up ofvery many types of merely contains a list oftriangles. version ofthe original, will be create a modern architectural elementary elements, some of Vertices are repeated as needed, inserted into the project. Also project, in which supplementary which can be rather complex such and no further information is within the Mesh workbench, tools information is given to the as Non-Uniform Rational B-Splines recorded about the actual are available to computer, so using FreeCAD to (NURBS). However, the most structure of the underlying object. export this mesh to create a Building Integrated Model common varieties are simple In a more complexcase such as a file (tool on the (BIM). Since this approach is in an triangles and flat four-sided Computer Fluid Dynamics (CFD), right). early stage ofdevelopment, and is elements. This is for several toolkits such as OpenFOAM limited to simple forms, we then reasons, including the fact that (https://openfoam.org/) have a file Once a STLfile has been saved, used a more traditional approach most complex surfaces can be format that draws up the mesh this can be used with most3D to create volumes in the same way approximated by triangles with a using a list ofvertices, then a list of printers to print a physical copy of as in previous projects, but on a reasonable level of precision - faces through referral to the our original shape. larger scale. The sweeping much in the same waythatthe vertices, and finally the complete technique allowed us to create an plots of simple mathematical mesh as a listoffaces with their IMPORTINGANDUSING element with the shape ofan arch relative positions and associated functions are often represented MESHES by sweeping one sketch (a profile) on-screen with an array ofstraight variables. Fluid pressure, velocity around another sketch (the outline and temperature are often used, segments, when in reality some of Another useful feature of the of an arch). these functions have no straight and must be stored for several points in time in auxiliary Mesh workbench is its capacity to bits all along their length. Another importa mesh from a file, and In today’s edition, we will structures that hinge on the mesh. aspect ofthe equation is that many create a new Part element from concentrate on a more complex computer meta-languages

full circle magazine #126 1 7 contents ^ HOWTO - FREECAD the data imported. I downloaded a before printing in 3D. To take an However, some care needs to solid Square (Meshed) test mesh named DAVID-Angel example, I added a circularbase to facet normal 0.0 0.0 1.0 be exercised when working on outer loop from 3D scanner producer DAVID the angel statue. models with very many triangles. vertex 1.0 1.0 0.0 vertex -1.0 1.0 0.0 (http://www.david- The angel sample mesh used above 3d.com/en/support/downloads).I vertex -1.0 -1.0 0.0 is already quite capable of vertex 1.0 -1.0 0.0 then used the Mesh tool (the exhausting FreeCAD’s memory endloop leftmost ofthe pair) to import this endfacet management, so itmaybe endsolid Mesh mesh into a new FreeCAD project. judicious to save our work every The result was quite good, and one few steps. Most indications should be self- can navigate around the digital explanatory. The “normal” model and examine the statue’s keyword gives the facet’s normal admittedly rather plump arms CREATING OUR OWN MESHES vector, basically telling us which from up close –ifso inclined. The STL file format is basically side ofourfacetis to be considered “outward” or “inward” Otherparts can be added to the just a text file with a very simple in respect to the complete object. scene within FreeCAD, allowing us internal structure. For instance, to Ifa triangular facet is required, just to modify the model and then create a mesh that contains just use three vertices to define it. If export our modified version, if one single square facet, we could several facets are needed, iterate needed. One specific use for this use the following code: the facet...endfacet sequence. could be to add supports orother auxiliary features to a model,

full circle magazine #126 1 8 contents ^ HOWTO - FREECAD

This very simple structure our angular measurement unit of makes writing our own programs choice, since this is what computer to create a mesh file automatically programs use to calculate sines an easy proposition. It could be and cosines. done is justaboutany programming language such as Once we have ourdouble for Pascal, C, Java, JavaScript with loop set-up, we need to transform Node.js, and many others, but my the more or less rectangular personal preference will go to shapes we obtain between θ and θ Python - in keeping with the fact + δθ horizontally, and between φ that FreeCAD is written in this and φ + δφ vertically- where the language. Let us start with a deltas are the difference between simple sphere. In the following successive values of each screenshot, the object to the right respective angle. The easiest course is to cover this area with -seen from within FreeCAD- is an Please do nothesitate to use it- one place, and a secondary radius instance of the application’s inbuilt two triangles. The complete Python program is simple, but a and to experiment. that defines the thickness ofthe Sphere object. The object to the object, in a plane setoffatright left, however, is a mesh that has tad longerthan could be acceptable for this publication. For Going on to more complex angles to the main plane. In the been generated with a simple objects, a ring -or, in mathematical following capture, we can see two Python script. this reason I putitup on Pastebin at the following address: terms, a torus- is an object that has copies ofthe mesh as imported https://pastebin.com/jvv35AgZ . two radii: the main ring radius in into FreeCAD, one on the left with AnypointP on the surface ofa mesh edges apparent, and the sphere can be defined using second on the rightall builtup. In horizontal angle theta (θ) within this way, we can see thatwhat the equatorial plane, and then seem to be flat four-sided facets vertical angle phi (φ) to give its are in fact each a combination of height above the plane. In essence, two triangles. this is whatwe do when using latitudes and longitudes to give The Python program to create the position ofan object or place this mesh file is actually rather on the Earth’s surface. So our similar to the previous code. program simply needs to calculate However, in this case φ needs to a series ofcoordinates, while iterate over a full circumference varying θ from zero to 2π radians, (from -π to π) to complete the and φ from -π/2 to π/2. Radians are ring’s tube shape along the smaller

full circle magazine #126 1 9 contents ^ HOWTO - FREECAD https://pastebin.com/ZvnDdLTX . volumes with less regularity, the mesh. Using the widely accepted One advantage ofwriting our STL file format, a mesh or own programs is that we can then collection of simple triangular or go on to modifyourobjects as four-sided facets can be retrieved desired. A simple alteration in the either from a physical 3D scanning value ofδφ can make ourtriangles device, from other people’s work, cover only halfthe surface ofour or created using ad hoc programs. object. If, at the same time, we With a bit ofmathematical give it a single twist while iterating expertise, the objects created can along θ, the final appearance can vary from the very simple to rather resemble not a single shape, but a more complex objects. collection of interwoven rings. In the following screenshot, note In the nextpart, we will use this how each ring twists once around technique in combination with φ while making its circuit ofthe other, more standard FreeCAD main ring. tools, to build a 3D representation ofa modern building with a lattice roof structure. circles. As before, θ iterates over position and have that turn around the ring’s main circle. The code can a number oftimes while we iterate be found at: over θ. We could, for instance, use https://pastebin.com/BNxPztFP . cos(3θ) and sin(3θ) to calculate its Please note the use ofr1, the radial and vertical coordinates to outerradius, here set at 5 units, have the ring “wobble” three times and r2, the smallerradius, here set along the main circumference. If at 1 unit. our resulting object is quite flat, and the numberofturns is odd, it Alan holds a PhD in Information and the Knowledge Society. He teaches Once we have the basic code can even resemble a Moebius strip. WHATNEXT? setup, we can have some In the next screenshot, we can see computer science at Escola Andorrana de Batxillerat (high- mathematical fun with it. For our original ring in copper, In this article on using FreeCAD, school). He has previously given instance, we can have ourring combined with the new twisted GNU/Linux courses at the University we concentrated on a more material twist about the main ring, shape in grey. The Python code to ofAndorra and taught GNU/Linux complex primitive object that by giving it a further (third) radius create this mesh file is, as always, systems administration at the Open allows us to create forms and University of Catalunya (UOC). to offset it from its “normal” on Pastebin:

full circle magazine #126 20 contents ^ HHOOWW--TTOO IInnttrroo TToo FFrreeeeCCAADD -- PPtt88 Written by Alan Ward

n this series, we will be been used for the exterior ofthe curvatures - along two intersecting simple surface plot shows us that, I examining the world of FreeCAD, building. From an architectural axes atonce -things do tend to get in the vicinity ofcoordinate origin an open-source CAD modelling standpoint, this technique has at a little complicated. This is when a point (0, 0, 0), this surface shows a application that is still in Beta, but least two salient points: computer comes in as an essential concave curvature in the upwards has been gaining acceptance in • On the one hand, the lattice can tool to calculate the position of direction, along axis X. However, recent years. Naturally, it is readily support a large proportion ofits each lattice point, and from there curvature is convex along axis Y, available in the Ubuntu own weight, which allows the to calculate the constraints also towards the top. This very repositories. In the previous architect to cover a large area expected within the physical simple function shows a double (seventh) article on using FreeCAD, without using internal supports structure. curvature that is easy to calculate, we concentrated on the mesh as a such as columns. This is perfect for but not easy to draw with precision complex primitive object that large open spaces such as concert For instance, let us consider the without the help ofa computer. allows us to create forms and halls or sports venues, or even the heightfunction h(x, y) = x*x- y*y. A volumes, either from scanned data open concourses inside airport or by using simple programing buildings, such as Hong Kong techniques. International Airport at Chek Lap Kok. In this part, we will use this • On the otherhand, using a lattice technique in combination with implies that part ofthe structural other, more standard FreeCAD strength comes from working with tools, to build a 3D representation curved surfaces that share some of ofa modern building with a lattice their properties with the arch. The roof structure. final result is a building that eschews the flat, regular shapes that have become so common in ARCHITECTURAL MESHES urban architecture during the last century. Some ofthe inspiration for this article comes from buildings such Some simple lattices can be as the Esplanade Theatres on the drawn “byhand”, as long as the Bay, Singapore (DP Architects), and overall shapes remain planar or use the Rhike Park music theatre in a single curvature. However, once Tbilisi, Georgia (Studio Fuksas). In the final shape contains double all cases, a lattice arrangement has

full circle magazine #127 1 8 contents ^ HOWTO - FREECAD INTEGRATING A LATTICE INTO ofholding up to its intended use. https://pastebin.com/tsi5dbLw . Property box, select “Display There are some tricky aspects to Working on a floorplan of40 x30 Mode” and switch from the ABUILDING consider with this type of m in the XYplane, we will calculate original “Shaded” mode to “Flat construction, not least ofwhich is a value forheightalong the Z axis. Lines”. In the following discussion, we the fact that the lattice would be Minimum and maximum heights will create a medium-sized pavilion stressed in compression along axis have been taken, for this example, We can then go into the Draft using a lattice defined with the Y, and in tension along axis X, allby at10 and 20 m above ground level workbench, and, working carefully, above function. Naturally, the its own weight. Factors such as respectively, though this could draw a new Wire - selecting, point reader is not encouraged to wind pressure, and the weight of easily be scaled and adjusted to by point, all the vertices along one actually build such a structure in rainfall, ice, snowfall, etc, would suit a particular implementation. edge ofthe roof. Then, close the real life - at least, not unless also need to be accounted for. Finally, 20 separate mesh shape by selecting the corners of considerable architectural and separations have been taken, the ground rectangle beneath this engineering experience is available Letus begin bywriting a short along both the X and Ydirections. edge. This flat shape can then be to ensure materials are correctly Python program to create an STL promoted to a plane ?plain? DWire chosen and dimensioned, local file with the mesh. The complete The end result ofthis program object. Then proceed in the same building codes are followed, and code can be found at: is an STLfile that can be imported way for the other walls. the construction has some chance into a new FreeCAD project using the technique discussed in the previous part ofthis series. To better visualize proportions, a 40x30 m rectangle has been drawn at ground level, under the roof.

Closing offthe walls on all four sides ofthis building will be no easy task, since all four walls will have three straight edges, but the fourth (upper) edge needs to follow a parabolic line. There are several solutions for this problem. One would be to write further programs in Python to create mesh files to suit. However, FreeCAD does offer alternatives. In this case, I made mesh lines visible. Select the mesh object, and, in the

full circle magazine #127 1 9 contents ^ HOWTO - FREECAD

Once the walls have been building’s four exterior walls also box. For instance, to represent going from a computer model to defined, the roofmesh can either become apparent. glass walls - allowing light to enter something physical, by exporting a be left with its mesh structure the building between columns - finished project and printing it apparent, or the Display Mode can One relatively realistic solution the four walls can be left with their using a 3D printer. be switched back to “Surface”, as is to give the roofmesh some default color ([204, 204, 204]), but desired. thickness. SImply select the mesh, with a transparency of40. and, in the Part workbench, create One can then add columns to a new Extrusion. Top and bottom WHATNEXT? hold up the roofmesh. However, it surfaces will have the shape ofthe mesh, while the vertical depth of then becomes apparent that the In this article on using FreeCAD, Alan holds a PhD in Information and mesh has no thickness. Even if the object will be the same along we used a mesh in combination the Knowledge Society. He teaches much care is taken with column its surface. A value ofone meter with other, more standard computer science at Escola Andorrana de Batxillerat (high- heights, some discrepancy appears seems appropriate for this FreeCAD tools, to build a 3D building. school). He has previously given since column ends are horizontal representation of a modern GNU/Linux courses at the University disks, but the part ofthe mesh building with a lattice roof ofAndorra and taught GNU/Linux thatis in contactwith them is not Finally, the colors and structure. systems administration at the Open University of Catalunya (UOC). flat. Intersections with the transparency levels of each object can be adjusted in the Properties In the next part, we will explore

full circle magazine #127 20 contents ^ HHOOWW--TTOO IInnttrroo TToo FFrreeeeCCAADD -- PPtt88 Written by Alan Ward

n this series, we will be crafts, design, engineering, and often than not best handled with once printed and, in fact, may I examining the world of FreeCAD, even some medical fields. subtractive methods. easily be broken offwhen an open-source CAD modelling Relatively cheap printers that removing the printed part from the application that it still in Beta, but come fully assembled and ready to Even within the domain of3D supporting plate. Naturally, the has been gaining acceptance in print are making the technique printing, there are many variants. details depend on the actual recent years. Naturally, it is readily more accessible to a large variety Some ofthe more expensive, such printerused, and on the level of available in the Ubuntu ofusers. However, it must be said as sintering, involve heating small detail dialed into the printer. With repositories. In the last (eighth) that3D printing is notyetquite as particles ofthe material with a thinner layers (0.1 mm instead of article on using FreeCAD, we used mature as traditional printing on laser to fuse them together and the more common 0.2 mm), finer a mesh in combination with other, flat pieces ofpaper, and some form the object being built. In details will come out better, but at more standard, FreeCAD tools, to practical inclination is still very others, a solution ofmaterial is the expense ofa much longerprint build a 3D representation ofa much a necessity for users. Dealing locally heated, transforming the run. Time spans of2-3 hours are modern building with a lattice roof with platform placement liquid solution into a solid layer. In not uncommon for small objects structure. calibration, nozzle stoppages, or the vast majority ofcommercial 3D (1-2 cm tall), and can go up from other mechanical issues, may not printers that would be in the price there for larger objects. In this part, we willgo from a be within everybody’s comfort range ofthe enthusiast ora small computer model to the physical zone. business, a plastic extrusion The second point is that the world, using a 3D printer to create process is used. In this, a plastic upper layers ofplastic are laid a physical representation of our There are many techniques of filament is slowly extruded down on top ofthe lower layers. construction. 3D printing. They are usually seen through a heated nozzle. The However, the plastic is quite liquid as some form ofadditive plastic melts when going through when leaving the nozzle, and so construction, where the resulting the nozzle, and fine points or lines needs a stable base to reston SOME NOTES ON 3D part is built up progressively. This ofmaterial are deposited in layers while solidifying. Structures such PRINTING is in contrast to machining - for to build up the object from bottom as overhangs or arches in the instance using a computer to top. model will not come out well, if It will come as no surprise that controlled lathe - where an existing left unsupported. 3D printing has become something block ofmaterial is cut down to the This system has its quirks. The ofa fad in the lastfewyears. final desired shape by removing first main point to take into Many printer control Starting outas a bitofa hobbyist excess material. Some materials account is that very fine object applications alter our model activity, it has found its practical such as plastics lend themselves volumes orparts may not come out adding supportive structures. application in many rather best to additive processes, while as expected. Details ofless than 2- These are printed together with different fields, such as art and others such as metals are more 3 mm thickness may be very brittle the model itself, and must be

full circle magazine #128 1 7 contents ^ HOWTO - FREECAD removed after printing. In the The actual details ofour • Use a slicer program to convert Two file formats form the glue accompanying image, a model ofa workflow can vary, depending on the object into a series offlat between stages (a) and (b), and wheel rim has been printed. Part of which program set we choose to slices. These slices are then between (b) and (c). The STL the matlaid down bythe printerto use. However, the main steps will converted into a sequence ofG- format previously discussed in fix the part to the supporting plate be as follows: code commands, that in essence parts7 and 8 ofthisseriesisa is still attached to the bottom of • Build the computer model, using tell the printerto place its head at standard way to transfer our the part. The interior ofthe recess volumes. Thin, flat parts must be such-and-such coordinates, and object’s form from the design along the rim has been filled in rendered as volumes, with a turn the plastic extrusion on and application to the slicer. Other with vertical column-like shapes by thickness that for best results off. A common choice for this choices do exist, such as OBJ files, the printing software, in an effort should notgo below1 mm. In this stage is Slic3r(http://slic3r.org/ ). but do seem to be slightly less well to ensure the top edge does not series, we will naturally use • Use a third program to connectto supported. G-Code files may be fold down while still hot. These FreeCAD for this stage. However, the printer, and actually perform used to transfer data from the shapes are quite ungainly, but are other options such as Blender are the printing process. Printrun / slicer to the printer controller, also thin walls and may easily be also quite suitable, as long as they Pronterface though this step is omitted ifthe pared offwith a sharp knife (but can export object meshes in the (http://www.pronterface.com ) is a slicercan also act as a printer do be careful with your fingers). STL file format. popular choice. controller. Applications such as Slic3r can control directly a certain Depending on the shape ofthe number of printer models, mostly model, cleaning up may be quite open-source hardware. However, involved. In a recent project, a 4x4 many (commercial) models require link chainmail assembly took one their own software for slicing and hour ofprinting time, but then controlling the printer, which is required two hours ofmanual usually found only for Windows. cleaning up and surfacing. Material This maybe a pointto take into loss would also be a concern in an account ifor when selecting a industrial environment: in this printer to purchase. case, 3.3 g ofthe final object required a total of7.2 g ofprinted Let us start with a simple truss material. A material efficiency of object, basically a triangular less than 50% can be seen as far structure of square bars connected from ideal. with transverse circular bars. The first point we will need to get right BUILDINGANDPRINTINGA is dimensions. Depending on your SIMPLEOBJECT printer, there will be limits to the overall size ofthe object to be

full circle magazine #128 1 8 contents ^ HOWTO - FREECAD printed. In this case, I chose to the external shape, make sure all To build a 3D model, however, it In the real world, the bars would build a piece 120 mm in length, the joints fit by trimming lines as is more convenient to think in need to abutto the outside size ofthe longest bar. Bar required so that there is no terms ofassemblies. I started out surface ofthe cylinders, and bar sections were 3 mm square, to intrusion ofone bit into another, immediately in 3D by drawing a extremities would need to be make them easy to print. Finally, and then draw in the circles cylinder object in the Part shaped accordingly. As an the circular joints have an internal representing the holes in each workbench of FreeCAD, to alternative, vertical slots could be radius of3 mm, and 6 mm external. joint. Using the more advanced represent one ofthe joints. I then cut into the cylinder walls, and the The overall height of this structure features ofmodern 2D CAD draw a second, taller, cylinder to bar heads left square and slotted is 4.5 mm. applications such as LibreCAD, one represent the cutout for the hole, into the cylinders. could easily add some filleting to and subtracted both objects to To setup this piece, a make joints a tad more robustat create a hollow cylinder. I then In the magical world of3D traditional CAD procedure would the unions between bars and copied and pasted this complete printing, however, the intrusion of be to draw a flat representation of cylinders. part into the three final positions one volume into another may not forthe joints. I then created a flat be a problem. Most printing bar ofthe appropriate section, and software can take care ofthis, so then copied, rotated and scaled it that the plastic material in each into position three times to form volume does not get printed twice the triangular structure. over- which would resultin a big mess. Instead, software is smart Some care needs to be taken in enough to perform a boolean this assembly, since it is clear some union on all volumes and stitch overlapping of parts has occurred. them together correctly. It must be said, however, that not all printing

full circle magazine #128 1 9 contents ^ HOWTO - FREECAD software is equal in this aspect, with sides9 mm long and height3 this new volume, which in essence to slice and print the model. and some experimentation may be mm, then cut out another vertical trimmed its shape down to fit necessary to find the limits ofa prism with sides 8 mm long from within the interior space ofthe Once finished, the auxiliary mat particular printer software and the center. I then replicated this triangle. can be stripped away. Some hardware combination. basic motifto fill the space in a surface finishing will probably honeycomb structure. The final piece is the need to be done, specially on the Once the external truss had combination of the external lowerside where ithas been in been builtup, I wanted to fillin the Atthis point, I had both the triangle, plus the grill. This contact with the mat. center with a non-structural mesh. external triangle and the inner assembly is then made into a single There are several ways ofgoing grille. However, the grill did object using a boolean union. WHATNEXT? about this. For instance, one could protrude slightly from the sides of build a flat volume to fit the empty the triangle. So, it was backto the Once we have ourobject In this article on using FreeCAD, space, and then cutholes in itto Draft workbench and I drew a prepared, the printing process we explored going from a suit. I wanted something a bit rough approximation of the should be rather straightforward. computer model to something more fancy, along the lines ofthe external triangle as a continuous Starting in FreeCAD, select the physical, using a 3D printing beehive motives seen in some Wire object. This object, extruded final part and export it into an STL technique. We went through both modern car grills. So I started by upwards, gave me the shape ofthe file with menu option File > Export. some ofthe strong points of3D building a basic hexagonal shape in internal space, with some overlap From there, either use the Slic3r, printing, and the weak points. We the same wayI had done the with the triangle’s bars. I then or any equivalent slicer software, cylindrical joints. I began by defined the grille as the drawing a vertical six-sided prism intersection of the first grill and

full circle magazine #128 20 contents ^ HOWTO - FREECAD discussed 3D file formats, we built a model in FreeCAD, and printed it using the Slic3r software. This specific model, built in plastic, would probably have no intrinsic purpose. However, it could be used asa basisfora mold fora metal copy, or simply as teaching material on truss structures and internal stresses within a structural object.

In the next part ofthis series, we will change direction once more and explore some ofthe uses Alan holds a PhD in Information and ofcopying objects to create a the Knowledge Society. He teaches repetitive pattern such as computer science at Escola chainmail. Andorrana de Batxillerat (high- school). He has previously given GNU/Linux courses at the University ofAndorra and taught GNU/Linux systems administration at the Open University of Catalunya (UOC).

full circle magazine #128 21 contents ^ HHOOWW--TTOO IInnttrroo TToo FFrreeeeCCAADD -- PPtt1100 Written by Alan Ward

n this series, we will be objects to create a repetitive enough to add in some extra deposited, and the objects (chain I examining the world of FreeCAD, pattern such as chain-mail. plastic between bits. This is usually links) are starting to appear. Excess an open-source CAD modeling done in much the same way plastic -among them, the diagonal application that is still in Beta, but PRINTING INTERLOCKING printers begin printing by laying traces and wavy bits- are also has been gaining acceptance in down one orseveral mats on the there, to ensure links stay upright PIECES recent years. Naturally, it is readily bed, so as to ensure the parts and in a correct spatial relationship available in the Ubuntu being printed stick well to its to each other. Objects with repeated, but repositories. In the ninth article on surface, and do not move around disjointed parts, such as chains or using FreeCAD, we used a 3D as successive layers of plastic are chain-mail, can be printed in 3D in CREATING SOME CHAIN printer to create a physical added. In the adjoined image ofa much the same wayas a regular, representation of a construction. printer, two separate lengths of connected, part. The main Back to FreeCAD, let us begin In this episode, we will explore chain are being printed. In each difference is that the printer’s by creating a very simple length of some ofthe uses ofcopying case, the printer began with the driver software should be smart chain. We will start by doing a mats, approximately 6 mm (a rectangular flat link, with a quarter-inch) out from the object’s rectangular hole cut into it using outline. At this point, several layers the “cut” operation (Boolean ofplastic have already been

full circle magazine #129 1 8 contents ^ HOWTO - FREECAD volume subtraction). tend to leave, atthe least, 1 mm of Once we have defined the end up as a single Union object, empty space between links. We couple oflinks as a single union which can then be exported as an This link shape can be worked now have something similar to object, we can now copy and paste STL file and sent to the printer. upon, and made rathermore this: that, obtaining two strings oftwo aesthetic or more functional, as links. One ofthe strings needs to Itmaybe prudentto pointout desired. It is worth spending some Now, for the weird part. In be displaced along the same axis that the excess plastic will need to time at this stage -perhaps rather orderto printthis in 3D, we will into a suitable position, and then be pared away from the final more than I have done- since what need to move itoutto the printer the two bits need to be fused to object. This will include the mats we are producing here is a basic as one single object. But we each otherinto a single Union set out beneath the chain, but also motifthat will be repeated many already have defined two separate object, as before. We can then all the various bits and pieces the times to create the complete chain volumes, with some free air continue in this fashion, printer will have added to support object. between them. So, now, we simply multiplying the number oflinks by the links, and also between each need to combine the two objects 2 in each operation: 1, 2, 4, 8, … pair oflinks. A very complex link Now, letus copyand paste our with a Boolean Union operation. geometry may hinder getting all finished link. The new copy will This is really strange for someone Once we have the workflow set these bits out from our assembly. need to be displaced a sufficient with a mathematical background, out, we can experiment with more Practical experience shows that an distance (e.g. along the X axis), and since we are defining in essence a complex basic link forms. For object such as the above chain can rotated by 90 degrees about the single volume with two separate instance, we could create a link take aslong to clean up asto do axis of displacement. Precise and disconnected parts to it. But it with a flat eye and a vertical one. the actual printing –ifnot more. measurements will depend on link does work. Thus, each successive copy can be Thinking ahead, and adjusting link dimensions, but, in general, I do displaced only along the axis, shapes to make the interstitial without any rotation. As before, spaces more easy to access, can be the complete chain will need to of help.

full circle magazine #129 1 9 contents ^ HOWTO - FREECAD between any two links. As long as SPREADING OUT TO CHAIN- this is assured, links can take any MAIL form. One typical shape would be flat toroid rings (“donut-shaped”), Going from a linearpiece of set at different angles for each chain to flat chain-mail is not too alternate row: a close-up ofreal complex. The main difficulty is that mailcan be seen atthis link: each linkwill need to be https://en.wikipedia.org/wiki/Mail_ interlinked with many other links, (armour)#/media/File:European_ri typically four, so the central space veted_mail_hauberk,_close_up_vie will need to be created large w.jpg. Other setups are also enough to allow neighboring links possible, for example curving each to pass –while maintaining a link into a saddle-shaped ring to separation ofabout1 mm aid fitment. Going even further in

full circle magazine #129 20 contents ^ HOWTO - FREECAD this direction, rounded links can be a more traditional square motif. After this review ofsome ofthe transformed into a collection of possibilities FreeCAD offers, this simple volumes (cylinders and WHATNEXT? series ofarticles will go dormant bars), such as in the adjoining STL fora time. Furtheralong, it may be file (captured in Meshlab). In this -final- article on using started up once more, ifthere is sufficient reader interest. Specific Alan holds a PhD in Information and FreeCAD, we explored some ofthe the Knowledge Society. He teaches Once a basic linkmotifis uses ofcopying objects to create a proposals would be very welcome. computer science at Escola created, it can be copied and repetitive pattern such as chain- Andorrana de Batxillerat (high- school). He has previously given pasted and separate links mail. This could then be used as a displaced into position. Then, GNU/Linux courses at the University basic material for different ofAndorra and taught GNU/Linux several links can be fused into a purposes, such as preparing systems administration at the Open single Union object, such as the costumes, historical recreations of University of Catalunya (UOC). above 8-link assembly, which is armored clothing, or even rapid then repeated to create a larger prototyping of jewelry. piece ofmail. Motifs can be added along two axis, to create a flat Going through the various piece ofmaterial, or along one articles that have come out over single direction to create a chain- the lastmonths, itis clearthata mail band. 3D design program such as FreeCAD has many different Finally, chain-mail is not limited applications, ranging from to square links or motifs in which mechanical engineering (gears), to links are connected to four other architecture (buildings) and arts surrounding links. Three-sided and crafts (chain-mail). It is always symmetry can be used to create nice to see such software available motifs in which triangular or for the various Ubuntu variants, hexagonal links are joined each to where casual users benefit from three other links. Links with a free access to these applications, single ring can be alternated with while more advanced users can use links made oftwo parallel rings, widely tested applications on a joined by vertical parts that very stable platform. This is not interlock with flat rings. This setup always possible with commercial actually increases freedom of offerings that are often available movement between links, for a very limited number of producing a chain-mail fabric that operating systems. folds and bends much better than

full circle magazine #129 21 contents ^ Full Circle Team HHOOWW TTOO CCOONNTTRRIIBBUUTTEE Edit or - Ronnie Tucker [email protected] Please note: Webmast er - Lucas Westermann FULL CIRCLE NEEDS YOU! Special editions are A magazine isn't a magazine without articlesand Full Circle is no compiled from originals [email protected] exception. We need your opinions, desktops, stories, how-to's, and may not work with Special Editions - Jonathan Hoskin reviews,and anything else you want to tell your fellow *buntu users. current software versions. Send your articles to: [email protected] Editing & Proofreading We are alwayslooking for new articlesto include in Full Circle. For help and advice Mike Kennedy, Gord Campbell, Robert please see the Official Full Circle Style Guide: http://url.fullcirclemagazine.org/75d471 Orsino, Josh Hertel, Bert Jerred, Jim Dyer and Emily Gonyer Send your comments or Linux experiencesto: [email protected] Hardware/software reviews should be sent to: [email protected] Our thanksgo to Canonical,the many Questionsfor Q&A should go to: [email protected] translation teamsaround the world Desktop screensshould be emailed to: [email protected] and Thorsten Wilmsfor the FCM logo. ...or you can visit our site via: fullcirclemagazine.org

Get t ing Full Circle Magazine: For the Full Circle Weekly News: EPUB Format -Most editionshave alink to the epub file on that issuesdownload page.If you have any problems You can keep up to date with the Weekly Newsusing the RSS with the epub file,email: [email protected] feed: http://fullcirclemagazine.org/feed/podcast

Or,if your out and about,you can get the WeeklyNewsvia Issuu - You can read Full Circle online via Issuu: Stitcher Radio (Android/iOS/web): http://issuu.com/fullcirclemagazine. Please share and rate http://www.stitcher.com/s?fid=85347&refid=stpr FCM asit helpsto spread the word about FCM and Ubuntu.

and via TuneIn at: http://tunein.com/radio/Full-Circle-Weekly- Magzst er - You can also read Full Circle online via News-p855064/ Magzster: http://www.magzter.com/publishers/Full-Circle. Please share and rate FCM asit helpsto spread the word about FCM and Ubuntu Linux.

contents ^