19/03/21 (18:36)

I. Getting started I.1. Preliminary I.1.a Installation ✔ Installation (version 0.19 in October 2020): see this page. • Warning, there has been a big change between version 0.16 and version 0.17: videos or explanations concerning 0.16 may no longer be valid from version 0.17. • Under , the version from the official Freecad repositories does not work correctly and I replaced it with the version from thesite FreeCad, which is in fact an app- Image and does not require any installation (except to make the file executable). You have to start it with something like: App-Images / FreeCAD_0.18_xxxxxxx.AppImage ✔ At random from the videos concerning FreeCad, I encountered the use of two which can be interesting in other fields: • Simple screen recorder: Screen capture software to make videos Under Debian, there is also RecordMyDesktop , Vokoscreen • Key-mon : to show on the screen how the mouse and keyboard are used

I.1.b First essential contact ✔ A very good page (in French) which explains the interface well, and which connects in particular to this page clearly explaining the various navigation modes (see in particular the touchpad). ✔ Then you can watch some videos and alternate with the "references" part. ✔ An interesting page explaining the philosophy of of objects, especially the part entitled "Methodology for editing functions". ✔ Optionally, see how to customize the interface as well as the toolbars.

I.1.c FreeCAD and other CAD software ✔ To retrieve Fusion 360 projects • It is said on this page to go through a STEP export / import. • I also met cadexchanger which has a free evaluation version but I did not look further…. • In this video, we see how to transform a mesh object into a body! ✔ On this pagethere is a post that talks about other similar software and in particular Solvespace, which seems to be preferred by author

Back to Table of Contents 1 19/03/21 (18:36)

I.2. General I.2.a To start, some videos with version 0.19 ✔ A beginner exercise (with 0.19) using theworkshop PartDesignas well as circular symmetries and repetitions. ✔ A simple exercise (with 0.19) with PartDesign around the revolution and the creation of second body. ✔ An example using a spreadsheet (workshop Spreadsheet) to configure an object. : a good reflex! I.2.b A good series of videos in French The following series of videos is from the CAD Printer site. ✔ It is very interesting but dates from 2016/2017 and in the intro video, we see that it uses version 0.16; So be careful because there were big changes between 0.16 and 017. ✔ But personally I didn't see any incompatibility. Modulo the previous remark, it is a very good introduction to FreeCAD, and we can watch these videos one after the other. I have extracted a few of them below, the strengths of which I highlight, but this is a very personal choice. ✔ An interesting video concerning the settings of FreeCAD as well as the description of the functions and icons used to work on sketches. ✔ A nice example of a surface of revolution (icon ) also showing how we can use an axis of revolution different from the axes of the coordinate system. ✔ A video (interesting even if the beginning is a bit long) on how to use an external geometry (icon ) and explaining some associated pitfalls. ✔ A video on how touse symmetry and repeat functions : icons , , , etc. ✔ A video on rounding, chamfer and undercuts ✔ A very good video introduction to the Part workshop. • But she also talks about thewindow Properties that appears below the hierarchy and which allows you to modify the color and placement of all objects (whether they were produced with theworkbench Part or with the PartDesign workbench). • And it also shows how different workshops can be used successively. ✔ A superb video showing how to make a thread (and another) ✔ Avideo smoothing and blayage (loft and sweep) ✔ Protusion and cavity on a non-flat surface ✔ Video of transition between versions 0.16 and 0.17

Back to Table of Contents 2 19/03/21 (18:36)

I.2.c Some examples with explanations written For those who prefer to read texts rather than watching videos: another possible entry based on commented examples including: ✔ the famous Lego piece ; ✔ a nicely dug cube (workshop Part and placements); ✔ good threading and another threading. I.2.d To go further ✔ To understand bodies, watch this video and / or also this video by jp-willm ✔ A box with no screw : he does a subtraction with a propeller and rehearsals with theworkshop draft ; he also navigates between theworkshops Part and PartDesign ✔ Realization of a die ✔ Building a hand spinner ✔ An example of modeling of a house (not yet looked at) ✔ Creation of a thread with FreeCAD (not yet looked at) ✔ boat propeller (not yet looked at) ✔ The creation of a pentagram with the use of clones (and some criticisms) ✔ Creation of an atos door (with multiple and draft) ✔ A hardware exercise I.2.e Other Videos ✔ Introduction to animation (but with 0.17) and the Animation module: part I, part II, part III However, this module no longer works with version 0.19. Ditto for this animation of a diesel engine ✔ A very long project from someone who hesitates: it might be interesting to watch (1h45mn) ✔ How to import an image (but using Gimp and SVG)

Back to Table of Contents 3 19/03/21 (18:36)

I.3. Online manuals I.3.a The main workshops (a good reference) Each of the following pages is available in French as well as in English: just click on the language at the top (in theframe Other languages). The online help table of contents (where you can find how to install FreeCAD). In particular, we find descriptions of the first workshops used: ✔ theStart workshop, which is just the page presented when no project is open; ✔ the workshop By t which allows you to manipulate volumes (cubes, spheres, cones, etc.) especially using Boolean operations; ✔ the workshop Part Design which allows to make more complex parts based on sketches, protrusions, drilling, etc. ; ✔ the workshop Sketcher which allows you to make sketches (basis of theworkshop Part Desing); ✔ theDraft workshop which also contains 2D drawing tools, and in particular the clone tool (sheep's head) allowing to clone an entire sketch as in the animation of the piston. ✔ theSpreadSheet workshop which allows you to configure the objects you build; ✔ theTechDraw workshop which allows you to make side drawings (see an introductory tutorial); ✔ thePath workshop which generates the outputs for CNC and laser cutters. ✔ Thedraft workshop which allows you to make drawings in 2D but rather with objects that cling to a grid (see for example this video). But this workshop also makes it possible to make orthogonal or circular networks of existing bodies (??? Doc ????) I.3.b External workshops To the previous workshops, you can add external workshops according to your needs. They are listed on this page (the same in English). We can cite in particular: ✔ theFasteners workshop which makes it easy to add screws, bolts, nuts, etc. ; ✔ theFCGear workshop concerning gears. As it is explained on this dedicated page, these external workshops are installed using . It is essential to relaunch FreeCAD before using them. ✔ TheAssembly 4 workshop studied in detail later in this paper. I.3.c To go further ✔ Thetool Boolean Fragments (which gives all the possible combinations) and where we also speak of programming. ✔ A nice, sturdy example to make a 5-armchair leg ✔ A box in several parts with the cover and fixing screws (assembly)

Back to Table of Contents 4 19/03/21 (18:36) starI.3.d Other references ✔ Creation ofgears but with an old version of FreeCAD ✔ An interesting site with lots of references on this page or on that one. ✔ An interesting page on new features.

II. First personal details II.1. Tree icons On this page, you can see the meaning of the icons appearing in the tree view. only indicates that the object must be recalculated ; indicates the Tip of the body: resulting function, which is exported to the user; indicates that the object is not attached to something, it depends only on itsproperty Placement ; indicates a sketch that is not fully constrained; indicates that the object has an error that needs to be corrected.

II.2. If nothing works anymore ✔ When you cannot do what you want in thetab Model or all the icons are grayed out and therefore unusable, or the program squeals constantly, it is not necessarily because the program crashed as I often thought at the beginning! ✔ In such a case, one should always start by checking whether there is not something going on in thetab Tasks, be it a sketch, a protusion or whatever. You just have to close this task so that generally everything is back to normal. ✔ For the few (rare) cases where I really had a crash, FreeCAD offers recovery of the last saved state. In fact, most of the crashes I experienced happened after Iof overused rollbacks to do a lot.

II.3. Beware of pitfalls in sketches Sometimes (and even often at the beginning) it is impossible to be able to make a protusion or a sketch after having closed a sketch; this is reflected in two different ways: ✔ when the protusion (or other) window is opened, the object is erased from the screen; ✔ we receive the message “ Failed to validate broken face” or “ Linked shape object is empty”. Remember to check the following points.

Back to Table of Contents 5 19/03/21 (18:36)

✔ If it has only one curve, the contour serving as a base for the protusion must be well closed; start by checking that the points, which are believed to be identical, are indeed, by trying for example to move them; if not, select them using the coincidence constraint (shortcut "C" on the keyboard). ✔ Once the sketch is closed, you can also, after having selected the icon without opening it, use thetool , icon , which allows, among other things, to find the open vertices: they then appear in orange, which makes it possible to identify them. ✔ The contour can contain several closed curves, but in this case: • there must be an external curve determining the external edge of the object, • one or more internal curves to the preceding one, which must not intersect clearly: these curves then delimit holes in the outer contour.

p.

✔ The contour which must be used as a base for the protusion (extrusion) must contain: • only green lines if it is completely constrained, • onlyopen white lines if it is not completely constrained. If it contains blue lines, then they are construction lines, and they cannot be used for a protusion: if we want to recover them in the construction, we must transform them into “real” lines with the icon . In the case of the message “Pad: Result has multiple solids. This is not supported at this time ”, make sure that the body activated (in bold) during the creation of the sketch is the one we think: I have sometimes selected a body without activating it and thought to have created a sketch there, while the sketch was created in the activated body!

On the other hand, it is quite possible to create, most often at the root of the project, a "master sketch" which does not respect the previous instructions, but which will only be used to retrieve dimensions, ✔ either at the help from Sketch.Constraints.….

✔ or using thetool Carbon Copy, icon .

When working in a sketch, it is preferable to leave the boxchecked "Automatic deletion of redundancies", otherwise you are often insulted with the message "The sketch contains redundant constraints ..." : for example if you try to put in a circle centered in O, a rectangle that we also want to center in O.

Back to Table of Contents 6 19/03/21 (18:36)

Note When we encounter this message of redundant constraints, click on the proposed link then go to browse the window of Constraints, because the constraints in question do not generally appear spontaneously on the screen.

Caution Construction lines are only visible in edit mode: they are no longer seen when the sketch is displayed outside of this mode!

p.

II.4. Duplication, recovery of sketches

✔ Although it is not a very good practice for complicated projects (see next section), it is possible to build sketches by recovering geometric elements from the same body, or even from a body different.

✔ It is possible in FreeCAD to copy / paste, either by menu or by using keyboard shortcuts, but it is not always easy. It seems to me preferable to use the following functions.

II.4.a The cloning

✔ functions The clone function of theworkshop Part Design, icon : applied to a sketch, it creates a Body and places a clone of this sketch there.

Back to Table of Contents 7 19/03/21 (18:36)

✔ The clone function of theworkbench Draft, of icon : applied to a sketch, it simply creates a clone at the top level of the tree. We can then move this clone wherever we want. In both cases, this copy is dynamically linked to the original element: that is to say, it follows its modifications and evolutions.

II.4.b The external geometry tool of the Sketcher This is the tool of theworkshop Sketcher icon . ✔ This tool allows you to copy edges and vertices of the body in which the sketch is located. These copies are construction lines, appearing in magenta to distinguish them from other construction lines, which are blue in color. ✔ Please note that the "material" may prevent you from seeing the lines you want to copy: • it is therefore, most of the time, necessary to hide this material by "turning off" the pad (s) corresponding to the 'using the space bar; • but you can also modify the representation style of the objects, by passing it to Wireframe with the icon , or rather the drop-down list that it opens. ✔ The copy thus produced is then dynamically linked to the original element: that is to say, it follows its modifications and changes. Caution Like construction lines, these magenta lines are only visible when the sketch is in edit mode; it is therefore not possible to copy them from one sketch to another with .

Back to Table of Contents 8 03/19/21 (6:36))

II.4.c The Carbon Copy tool This is the tool of theworkshop Sketcher icon . ✔ This tool allows you to copy all the geometry (even the construction lines) and the constraints of any sketch; when this sketch is not located in the same body, you must use the key. • In the absence of constraints on the initial geometry, this copy is not dynamic: it does not follow the evolution of the original lines. • On the other hand, since there is a copy of the constraints, the copy is dynamic on the elements constrained in the original sketch; and we can therefore use this tool to make a clone of a constrained sketch: for example to animate a mechanism using a sketch master located at the origin of the tree structure and which we thus copy in the different bodies used. ✔ You can recover sketches that are not in the same plane with + ; however, personally I only managed to copy the first sketch of a body.

II.4.d The ShapeBinder (or Linked Shape) This is thetooltool of the Part Designworkshop icon . ✔ This tool creates, in the active body, a dynamic copy of any element, which can be a whole body, a sketch, a face, an edge, etc. ✔ My favorite way to use it is: • select and activate a body; • select in the tree structure (or on the diagram, especially for faces or edges) the element you want to copy; • by clicking on the icon , aelement ShapeBinderxxx is then created in the tree structure of the active body (you can turn off all the other elements to see it better on the diagram); it is then possible to retrieve elements of this Shapebinderxxx using . • If you did not think early enough to create this ShapeBinderxxx, it may end up lower in the tree structure than the sketch where you would like to use it; as I'm afraid that this could create circular reference problems, I prefer to reassemble it with the contextual menu ✔ If we have modified the placement of certain objects, for example at Using thewindow Property / Value, the shape you just created may not be where you expect it to be: in such a case, setting theoption Trace Support Shapeto true usually resolves the problem.

Back to Table of Contents p. 9 03/19/21 (6:36))

II.5. Very important problem (limit design bug) Attention to the problem concerning the renumbering of the names of sides (problem ofor topological namingtopological naming issue) when one modifies a sketch. II.5.a A simple example of a problem encountered The Problem ✔ Starting from an empty project, create a sketch on theplane XOY, then make a standard protusion (10mm); we obtain the pad :

✔ Select its upper face and hang a sketch on it to make a cylindrical tenon; after protusion, we get:

✔ If we notice that we have forgotten a rectangular hole in the pad, the most natural is to go back to sketch and add a rectangle as follows:

Back to Table of Contents p. 10 03/19/21 (6:36))

✔ But when we close this sketch , we return to the same body as before without seeing the rectangular hole that we thought we had created, and we see in the tree that there is a problem with Pad001 :

Explanation ✔ If using the bar of space, we “turn on” Pad, we can clearly see the rectangular hole:

Note: It is quite normal not to see the cylindrical tenon since all the rest of the operations have been switched off.

✔ But if we “turn on”again Pad001, nothing has changed. ✔ In fact all of this is due to the way we created Sketch001. • It was attached to the top face of Pad (the initial block). • As can be seen in thewindow Property when sketch001 is selected, it is attached inmode FlatFace to Pad [Face6]. • Initially, before making the rectangular hole, Pad had 6 faces numbered 1 to 6, and sketch001 was defined attached to 6. • But creating the rectangular hole created 4 new faces and the top face where should be positioned sketch001 is now face 10. • You can see the number of a face by hovering over it with the mouse: when the face turns yellow, its number is displayed at the bottom left of the status bar of thewindow FreeCAD in a format of the .Body.Padxxx type.Facexx. ✔ To remedy the problem, simply attach sketch001 to face 10. To do this: • Select and display Pad, then select (single click) Sketch001. • Go to thewindow Property,part attachment line Map Mode and click on the "..."

Back to Table of Contents p. 11 03/19/21 (6:36))

• In the window that opens, replace Face6 by Face10, either by typing it or by clicking on the corresponding face in the graphics window; then click on . • Everything then returns to order, possibly after having forced the recalculation of Pad001 and having it turned on with the space bar. What could have been done in this case to avoid such a problem? ✔ The easiest would have been to create a Sketch002 in which we would have put the rectangle, then to make a(pocketpocket) using this sketch. Hence a first rule that I try to impose on myself: never return to the tree to perform an operation that can modify the numbering of the faces if further in the tree I have hooked a sketch to a face. ✔ The ideal would have been not to create sketch001 on one side of the first body. • We could have built it on a reference (planeplane datum, icon ) that placed on the right side (z = 10 here), the ideal being that this side is defined in a parameters file. • We could also have placed this sketch001 in one of the coordinate planes of the object (OXY in our case) and translate the sketch with theproperty Placement (set of course) to bring it to the correct face.

II.5.b Sites consulted and good practices ✔ Here is what is said in the official doc. • On this page, there is a good example of a problem posed by the introduction of a new face when the intermediate floor overflows from level 0. • But the proposed solution seems very fragile to me because, for example, the first reference plane introduced is not dynamically linked to the upper face of level 0: everything goes well as long as we do not change the height! For me, a settings file is missing. ✔ We find on this page, and more particularly here, the best practices to follow in order to have a stable model! • In particular, there is praise for the use of parameter files. • It is therefore preferable to base any sketch in one of the OXY, OYZ, or OZX planes of the object, or even in a reference plane whose position is calculated according to the data in the parameters file. Possibly see thefunction Attachmen t of the workshop By t. • If we really want to go further, look at theproperty Map Mode of sketches. ✔ As explained in this post, you might want to change the solver, but it's something I haven't tried yet. ✔ An interesting post on theinterest of the reference sections (datum planes) and their good use:

Back to Table of Contents p. 12 03/19/21 (6:36))

• it is useless to link them to a face, that only pushes the problem away; • they should preferably be positioned relative to the base planes of the object using theirproperty Placement ; • but we can also, in the same way, place the plane of a sketch in relation to the base planes of the object by using theirproperty Placement ; the only advantage of using a reference plane is that it can be seen (in yellow by default) on the screen; ✔ A forum post on understanding "attachment" and another page on the subject ✔ Another on how to debug a model : think among other things about the dependency graph, which we obtain with . But you must first have installed graphwiz. ✔ An interesting macro (not verified) to get around the topological naming problem But this problem is about to be solved ??? II.6. Difference between Part, Body and Feature At first I hesitated a lot with the objects that I handled and that appeared in the hierarchy of thetab Model . ✔ The Body or Body ( ) is the base object that we build using theworkshop Part Design. An object built using theworkshop Part is not a Body : • moreover, it does not have the same icon to the left of its name; • I cannot directly create a sketch on one of its faces using theworkbench Part Design ; it must first have been included in a Body where it becomes a BaseFeature ; For an explanation of thisstory BaseFeature, see this page or other page.

✔ The Par t or Std Par t ( ) is a container that allows you to group objects, for example to always move them together. Not to be confused with theworkshop Part !

✔ The Group or Std Group ( ) is a container for simply grouping objects in the tree view to make it better organized. ✔ Feature or Fonctionnali ty is a step in the process of making a body. There is a very good explanation here, ??? review this paragraph ??? in particular with interesting diagrams (diagram only). And all in all, it is very well explained in thepages Body,, as Std_Partlong and Featureas I read them to the end, which I had not done at the beginning. Note: it is now possible to move features inside an object using the right mouse click, but use sparingly as there is a risk of breaking links.

II.7. Result of a Boolean operation The result of a Boolean operation (cut, union, intersection) is not a body!

Back to Table of Contents p. 13 03/19/21 (6:36))

✔ If I want to put a sketch on one of its faces by selecting the face and clicking on the icon , one of the following possibilities may be encountered. • If I have no body in my project, I have the message: " No ctive Body " • If I have an body activein my project then FreeCAD will include this sketch in the body in question asking me if I see a dependent copy, independent of the geometry of this face, or even create areference (cross-cross-ref) • If no existing body is active, FreeCAD makes active the first that comes to hand and we are brought back to the previous problem . ✔ To be able to put a sketch on a face of an object resulting from a Boolean operation, it must first be "included" in a body by clicking on the icon of theworkshop PartDesign. • The Boolean result object then becomes invisible; • the created body contains a BaseFeature visibleon which we can then work. For an explanation of thisstory BaseFeature, see this page or other page. II.8. Setting a project II.8.a Using a settings file I start most of the time by creating a spreadsheet file(speadsheet) in which I put the numerical values of lengths (and angles) to build my model, to configure it easily. This is done with theSpreadSheet workshop, very well explained on this page. To be able to use these dimensions in the project, they must have been assigned an alias. ✔ The previous tutorial shows how to do this using the Properties window of the context menu. ✔ But I noticed that there is (in my linux version) anfield alias at the top right in which you just have to type the name of the alias that you want to give to the selected cell. You can use a copy and paste but don't forget to end with a carriage return! Any cell with an alias then changes to a yellow background.

During the course of the project: ✔ you can use the parameters of this spreadsheet by clicking on the small blue dot of the box in which you want to enter a dimension; ✔ you can use the single parameter value or any correct formula; ✔ like the parameter , is used in the form . , I always give the name p to my parameters file, even if the automatic completion then makes it easier to enter. ✔ It is often preferable or even essential to put the dimensions (mm, °) after the numerical values, otherwise this can pose a problem during certain operations.

Back to Table of Contents p. 14 03/19/21 (6:36))

Warning ✔ You can also use a Spreadsheet to collect certain data from a project (see always on this page). ✔ But we cannot have in the same SpreadSheet values that define the model, and values extracted from the model. Even if they are siled and do not actually create cyclic dependencies, FreeCAD will return these kinds of errors. ✔ II.8.b Using a master sketch There is an analogous technique using a master sketch as in this video. ✔ This sketch does not need to be correct as if it was being used for an extrusion. ✔ By giving names to the constraints used in this sketch, they can be used in other sketches or protusions, just like the values in a spreadsheet, of which it's a bit of a graphical version. ✔ By clicking thebox reference, we can obtain the value of a dimension that we can no longer define, otherwise the sketch will be over-constrained and used elsewhere. ✔ The syntax for using these values is .Constraints. . The auto-completion works for the first two levels but not for the third, which requires to know the names of constraints of the sketch to which we refer. II.9. Sections and sections

✔ Method 1: We can use theTechDraw workbench which allows you to make side drawings • See introduct i on tutorial and the page dedicated to TechDraw • To insert a section, selectin thepage TechDraw the relevant projectionand use the tool toinsert a section view, icon . See this video if necessary (3 minutes away). The sections thus created are dynamically linked to the object, ie they follow the modifications of the object.

✔ Method 2: Using

, a window opens under the hierarchy of objects where you can choose and move a plane that intersects the object. But the volumes then appear as hollow which is not always the expected effect. It should not be something else as it is confirmed in this post (look for "hollow")

✔ Method 3: You can use the function Cups (Cross Section), icon , from the Part. • We can see how in this post

Back to Table of Contents p. 15 03/19/21 (6:36))

• But in fact, we can only apply this function to a body (and only one at a time)! For projects containing several bodies, you have to make as many body cuts. You can't even apply it to a Part that contains only one body. • Attention, as it says on the function description page, the object is not parametric: that is to say >> that it is not modified if you modify the cut object >> and especially since it is not modified if the position of the cutting plane is modified, hence the advantage of being able to make multi-cuts!

✔ Method 4: You can use the shape division tools. Here is a great video showing how to use thefunction primarily Slice (SliceApart) of the workshop Part. • From 1 min 10, we see how to recover an object in STL format and convert it by several operations into a real 3D solid (a little off topic for what interests us here) / • From 5 min 50, we see how cut an object with a plate (having a thickness) using the function < Slice apar t > of the workshop Part. • From 9:20, we see how to do the same but with a plane (without thickness): this plane being obtained with thefunction Part Primitives, icon . • From 13:40, we see how more generally to do the same thing, but with a sheet without thickness, which is obtained from a wire by theextrusion of icon. . • From 18mn, we talk about the other shape division tools. Such sections are dynamic and evolve when the object defining the section is modified. On the other hand, I have the impression that they only apply to a Body and not to a Part !

See possibly this example and this other III. Import-Export III.1. Using FreeCAD for the laser cutter III.1.a Sites and videos An interesting video talking about .dxf both in import and export. ✔ We also see the use of libreCAD to open .dxf files that FREECAD cannot open. ✔ There is also the use of the Draft to Sketch (icon ) function of theDraft workbench : this function allows you to convert a line drawing into a sketch (and vice versa). III.1.b Two methods that I used

Back to Table of Contents p. 16 03/19/21 (6:36))

Method 1: it is on this page that I found a first method that works to generate a .dxf using FreeCAD (method 2, from page because I did not understand method 1). ✔ I got into theworkshop Draft. ✔ For each piece to be cut: • I displayed it frontally and I made all the others invisible; • with the icon , I made a projection on theplane XY ; • it was then created an object of name Shape2DView ...which can be seen in theplane XY. ✔ In the XY plane, I was able to arrange thesebetween them Shape2DView by playing with their placement. ✔ After selecting all theseobjects Shape2DView…, I made in . ✔ After opening this file with Inkscape, I was able to put different colors to specify the order of the cuts. ✔ It remains to check if this file is correct for the ?????? cutter.

Method 2: I also found another method with TechDraw ✔ I got into theworkshop TechDraw ✔ Then I inserted a page (of technical drawing) • either with ,

• or with , which allows you to choose the size of the page as well as the existence or not of a title block. A object appears in the hierarchy; that's where it happens next. ✔ Then, for each piece to cut, I displayed it in front view and I was then able to insert the corresponding design in the previous page using . Note: it does not seem essential to make the other elements invisible. ✔ We can then: • move the different drawings using the handle which is below Note: 'there is nohandle ; • insert ribs with the yellow icons:, etc. ✔ Finally I used . But you can also use which allows a choice ??? ??? See what is the best method and if the obtained files are OK ??? III.2. 3D printing (???) https://www.sculpteo.com/fr/tutoriel/preparer-votre-fichier-pour-limpression-3D-avec- freeCAD/

Back to Table of Contents p. 17 03/19/21 (6:36))

resume for MESH and STL ????? I have already flagged the following video for its use of a master sketch, but at the end (???) it tells some interesting things about how to print its object.

III.3. FreeCAD and the CNC (???)

✔ To begin with, the official documentation of the Path workshop and an example explained. ✔ A few pages talking about CAM and G-code (but in English) and it starts here. ✔ https://www.youtube.com/watch?v=vyHwJ19PJp4 (CNC)

An interesting video (in English) working on the part made on this video

An interesting post in French Here is some link to interesting info for using the Path Workshop Wiki from the Path Workshop from which the image is taken explaining the different heights and depths modified in the toolpaths https://wiki.freecadweb.org/Path_Workbench/en

The excellent site of a Fablab member who explains machining and in particular the direction of machining according to the direction of rotation of the tool and the movement of the tool. https://www.makerslidemachines.xyz/fr/2018/08/13/fr-usinage-en-opposition-en-avalant- ou-mixte/

Other site explaining the meaning machining https://www.sandvik.coromant.com/fr-fr/knowledge/milling/pages/up-milling-vs-down-

milling.aspx http://outillage.metiers-et-passions.com/documents/usinage-de-

aluminium/168.html See the general rules that have been indicated to me concerning the

direction of machining:

For wood: Opposition or climb in English (Strongly recommended for the router)

For metals: Downstream or conventional

Application for adjusting the various machining parameters:

On Android and Ios (in English) free with advertisement: FSWizard

Back to Table of Contents p. 18 03/19/21 (6:36))

On Windows (English English) free 1 month: HsmAdvisor

How to convert to step IV. FreeCAD and Python IV.1. Introduction Python allows you to do a lot of things in FreeCAD : ✔ make animation (see the corresponding part ???), ✔ create objects or modify existing objects (their shape or their representation), ✔ modify the interface of FreeCAD, etc. IV.1.a To begin ✔ If you are new to Python or have any questions, here is a course on Pyhton with a good summary, and another which seems quite done. There is also the tutorial from the Python.org site. ✔ What FreeCAD offers for writing Python is really not up to par and you better use a good IDE (Integrated Development Registration). On this page, there is a good review. Thonnyeasiest is definitely one of theto start with. ✔ The Getting started withscripts page F ree CAD seems essential to me to start well: • it explains how to use thecode Python in FreeCAD ;

Back to Table of Contents p. 19 03/19/21 (6:36))

• if you don't see the Python console, it may not be open; in this case, you can open it by checking Console Pyhton in the . • the Integrated Modules section contains a precise description of the functionalities of themodules App and Gui which are almost always used when programming a script; • but the section Using additional modules is not essential immediately. Use IV.1.b completion in theConsole Python Python documentation FreeCAD is not always easy to find and I learned a lot by auto- completion in theconsole. PythonTo understand this, let's imagine having opened afile FreeCAD containing acube Box created with the Part workshop: ✔ if we type App. (with the period, and while respecting the case) in the Python console, then a window opens and shows all that we can enter; ✔ by taking the first choice (the key is sufficient), we obtain thecommand App.ActiveDocument ✔ which returns a reference to the current document, something like: ✔ this is not its name, which is returned by: App.ActiveDocument.Name which can be obtained by completing App.ActiveDocument. (with the dot); ✔ If you want to access the Box created, you just have to type App.ActiveDocument again. and complete it in App.ActiveDocument.Box which returns a reference to this box of the type: ✔ We can then display the height of this box by entering (always by completion): App.ActiveDocument.Box. Height ✔ We can even modify this height by typing for example: App.ActiveDocument.Box.Height = 50 This is how it is, starting ✔ either from the App root for everything concerning the construction data of the objects ✔ or from the Gui root for all that concerns the visualization part of these objects that one can explore the functions offered by FreeCAD. IV.1.c To really go further ✔ In this forum post , it is said that:

Back to Table of Contents p. 20 03/19/21 (6:36))

• themodule Part is essential because it is it which builds theobjects OpenCascade for FreeCAD; • as aobject FreeCAD (Python)is built in C ++ then passed in Python, its description can be found in two different forms: > thefile xxxPylmp.cpp which allowed it to be defined, > anfile xxxPy.xml certainly obtained by documentation automatic; But it is not necessarily very easy to read. ✔ The reference page programming FreeCAD in Python, and lots of examples including the one explaining how to write a macro that draws a rectangle and turn it into a command. ✔ Lots of other examples of m acros ✔ To go even further, the reference page Python programmingfor FreeCAD. ✔ Examples of ts snippets (code snippets) , including the list of objects, their properties, etc. ✔ A very interesting article showing how to create a new command and integrate it into the menu via a workshop: this command, which reacts to the mouse, allows you to build a segment. ✔ We can also think of FreeCAD_Mod_Dev_Guide which is intended as a reference.

IV.1.d What about the Debug (when you write big programs)? As it is explained in the video on this page there are two ways to use an external editor to edit and fixmacros FreeCAD ✔ At the beginning of the video, the author shows how one can open FreeCAD from aprogram Python, but that assumes that you have thelibraries FreeCAD, which is not the case with the App-Image version I'm using. ✔ From 8mn, it shows how to "intercept" the operation of a macro launched from FreeCAD to obtain debug info. • I started by installing ptsvd by typing in a terminal: pip3 install ptvsd because at home, pip corresponds to Python 2 • I then had a problem because FreeCAD could not find thepackage ptvsd ; it was blocking on: import site • I think it was because it was not going to look for it in the right place. Taking inspiration from what I found on this site dedicated to Python, I added: import site site.addsitedir ("/ home / jm / .local / lib / python3.7 / site-packages /" ) import ptvsdnormal and everything is back to. See in the menu ????

Back to Table of Contents p. 21 03/19/21 (6:36))

IV.1.e Python and C ++ https://sametmax.com/appeler-du-code-c-depuis-python-avec-ctypes/ https://koor.fr/Python/CodeSamples/NativeSample.wp https://cpp.developpez.com/tutoriels/interfacer-cpp-python/ There is also a course on / PySide2 https://koor.fr/Python/SupportPythonQt/slide1.wp

An interesting example

Thefunction PyArg_ParseTuple From this page (unfortunately concerning Python 2) there is a good explanation of the principle allowing to extend Python to C ++. In particular for thefunction PyArg_ParseTuple. ✔ The arguments are retrieved by thefunction PyArg_ParseTuple () : • its first argument is the tuple containing the arguments; • its second is a format string; • follow a number (depending on the format string) of pointers to the data to be populated with what's in the first argument. ✔ The return of this function is different from 0 if everything went well. ✔ Some examples with Python3 ✔ A good description of the format options including "d" and "O" or "O!" »(The letter O) ✔ On this page, a good comparison, with scanf IV.2. Creating objects in FreeCAD It will certainly be more profitable to read this part (rather theoretical) in parallel with the following (rather practical) which explains the different steps which allowed me to create atype FeaturePythonobject, and which is certainly more successful. Note Before thinking about using scripted objects, we can also look at DynamicData objects as prescribed by suzanne.soy in this forum post. IV.2.a Geometric manipulations With FreeCad, we can build scripted objects, ie objects defined by program, and therefore using macros. As these macros are not, for security reasons, included in thefiles FreeCAD, it is necessary to remember to send theirfiles .FCMacro or .py at the same time as thefiles .FCStd of the projects containing such objects.

In Yorik's book, there is a geometry manipulation page. ✔ It talks about the difference between aobject FreeCAD and its representation.

Back to Table of Contents p. 22 03/19/21 (6:36))

✔ It explains how to build a Shape (or TopoShape) from points. • At the beginning is the Summit (Vertex plur. VerticesVertices) • With two, we build a Side (Edge) • With at least one Side, we can form a Wire (Wire) • With a closed Wire, we can create a Face (Face) ( a wire contained in a plane ??? I do not know) To obtain a hole face, it is enough to have several Wires: the internal “Wires” become holes. • With one or more faces, one can create a Shell(Shell) • From a waterproof shell(watertight),we can create a Solid(Solid) • By joining several sides (of any type) is obtained Compound(Compound) ✔ And finally we show how to use this Shape to introduce a new object, of type Part :: Feature, in the current project, either with addObject or with show. The previous page links alsoto this page which takes everything in detail and which contains a lot of interesting information. In particular, we find these lines: cylinder = Part.makeCylinder (3,10, Base.Vector (0,0,0), Base.Vector (1,0,0)) sphere = Part.makeSphere (5, Base. Vector (5,0,0)) diff = cylinder.cut (sphere) allowing to do a Boolean subtraction. Note that thismethod cut works withobjects Part but not withobjects PartDesign. For which it is necessary to go through their Shape.

Finally, a very good description of PartFeature objects that are good to read and reread!

Note You can add curves to a sketch using a Python script as in this example which adds an elliptical arc. IV.2.b Use of classes But as Python is object oriented, it is then almost essential to look at classes. ✔ To get started directly in FreeCAD, see this interesting page (or find it here). • We simply explain how to create a class providing a rectangle parameterized by its two lengths, which can be modified in the “Property” window. • To be able to thus define by a class an object intended to have arepresentation 3D, it must have aproperty Proxy and therefore be oftype Part :: FeaturePython, and not oftype Part :: Feature like the objects manipulated on the geometry manipulation page ; see the “ fixing code ” part of this page, and possibly this page. • We also see how to create an icon to access this object creation function.

Back to Table of Contents p. 23 03/19/21 (6:36))

✔ Another example, from the wiki (Part. 1 and Part. 2), of using classes to create scripted objects with associated properties and methods.

For more information on object oriented programming in Python, you can look at: ✔ this quick or this page explanationwhich seems to me very well explained; ✔ a more in-depth course, which looks like this one. ✔ a good explanation of the super () method and again there ; see in particular the difference between Python 2 and Python 3) But there is also another in English on the previous site (taken from this tutorial). Good documentation of the classes used by FreeCAD and their inheritance on the site http://freecad.sourceforge.net with several possibilities of access: ✔ by modules with in particular App and Gui ✔ by namespaces or by classes

Warning When I programmed using classes, there was a difference between copying / pasting from any text editor and using import. ✔ When during debug I was copying / pasting programs from myeditor Python (Geany) to theconsole Python, everything was fine but there were errors when I reloaded a file containing an object of one of my classes (even with a properly installed Python file in thedirectory Mod). ??? REVIEW THIS ???? ✔ This did not happen when I used the functions and / or class definitions by defining them with import. But be careful in this case that the functions are not updated after modification and saving in the external editor. • The first solution I found to make sure I had the latest changes was to quit FreeCAD and relaunch it. • But as explained in this page or in this one (where we also talk about thedirectory __pycache__, the easiest way is to use: import importlib importlib.reload ()

To see an imported function, think of the function inspect.getsource,except of course for the built-in function IV.2.c Proxy When I began to use the classes, I came across stories of Proxy,which has long remained obscure to me!

Back to Table of Contents p. 24 03/19/21 (6:36))

✔ it ' is in this Yorik page that I found the first definition " store our class ..." : I understood that the class used to define the object was stored in theproperty Proxy of the object that l 'we inserted in thedocument FreeCAD. ✔ But it is in this post (2011), and this other post (2010) by wmayer (Just a few words about how our document framework is working ...) that I found the most precise explanation. • Adocument FreeCAD has access to the list of objects it contains, but they don't know what type of object it is, nor what they actually do. • Once the FreeCAD document is loaded, or each time it is updated, or recalculated, the system calls themethod execute () of each object that has been modified, " touched", and of the objects that depend on it . • Like FreeCAD and therefore the whole system was written in C ++, without any intervention from Python, to make a link between C ++ and Python which allows the user to create new objects, there is the FeaturePython class, which is derived from theclass DocumentObject. • Each object of thisclass FeaturePython contains, via its Proxy, a link to a pureobject Python, a link that is defined in the __init __ () function of the class; this link allows you to delegate all the events / notifications that come from the C ++ framework to the correctmethods Python defined in the object. That's the of it.

IV.2.d First Class Descriptions It is on this Yorik page that I found the best introduction on how to create classes to build FreeCAD objects. ✔ As in anyclass Python, there must be a function (method) __init__, which is called each time an object of this class is created. • It is in thisfunction __init__ that we find an instruction of the type obj.Proxy = self which links the Proxy of the FreeCAD object (obj) to the object (self) Python that we create. • It is also in thisfunction __init__ that one can add to theobject FreeCAD createdproperties which will be (or not) displayed in thewindow Property of the object (see below). ✔ In the definition of the class, we must also find an execute function (method), • This function is called each time the document is updated, doc.recompute (), when aobject FreeCAD of this class is marked (touched) as that needs to be recalculated, that is, when one of its properties has been changed or depends on an object that needs to be recalculated.

Back to Table of Contents p. 25 03/19/21 (6:36))

• It is in this function that thecodeis generally found Python used to build the FreeCAD object, most of the time by constructing a Shape, which we then assign to the object by an instruction of the type: obj.Shape = myNewShape. This is why thismethod execute has anargument obj which is the FreeCAD object that we want to modify in thecode Python. ✔ You can see an implementationin theof thisexample on this page. ✔ The above makes it possible to define a class with which we can, as in any object oriented language, create an object of this class then insert it in thefile FreeCAD active. But since, with FreeCAD, there is a strict separation between, • on the one hand, the objects part which is essentially managed by themodule App • on the other hand, therepresentation part 3D which is managed by themodule Gui, we do not will usually see no representation of the created object on thewindow 3D (main view area). To have aview 3D of atype FeaturePythonobject, the easiest way is to set: obj.ViewObject.Proxy = 0

• To have a personalized representation of the object, it is also possible to create your own ViewProvider, but c is much less easy to manage (see below). • I imagine that the previous assignment (where you can replace 0 with anything except None) forces FreeCAD to use the ViewProvider common to all objects of type Part. • Even if it's not very clean and it breaks the separation wanted by FreeCAD between thepart App and thepart Gui, this assignment can very well be done in thefunction __init__. ✔ Finally, don't forget to do an App.ActiveDocument.recompute (), to force the view to be refreshed. Main methods that can be overloaded fortype FeaturePythonobjects: ✔ they are described on this wiki page or also on this page, with in particular themethod onChanged, called as soon as one of the object's properties is modified ( see below). ✔ In this exchange, we are talking about the methods that can be used with aobject FeaturePython that are documented: execute, onBeforeChange, onChanged, onDocumentRestored. IV.2.e Properties of an object oftype FeaturePython For an object oftype FeaturePython, one can define properties, stored with the object, and each of which then appears in the “Properties” window of FreeCAD where one can modify it. ✔ On this page is a list of all the properties of aobject FeaturePython, plus an interesting description of how to use themethod addProperty (). ✔ On this page and more precisely here, there is an example of the use of • properties of type App :: PropertyLength, • of a property of type App :: PropertyString.

Back to Table of Contents p. 26 03/19/21 (6:36))

We can also mention App :: PropertyFloat and App :: PropertyInteger. ✔ Possibly see this page which describes the property editor.

On this wiki page, we talk about the types of properties: ✔ Are they editable, read-only or hidden in the editor? ✔ Can we define them as "transient" and therefore not saved in the recorded file?

It is themethod onChanged that is called each time one of these properties of theobject

FreeCAD is modified. See possibly this discussion on onChanged vs. execute In this forum

exchange I encountered properties of the type PropertyPythonObject :

✔ according to the documentation, such a property is intended to store a Python object (variable, sutrcture, function); I would have to reread the previous page in detail (???); ✔ for such a property, it does not seem possible to see it in the “Property” window; ✔ According to this forum exchange, it has to do with __getstate __ () and __setstate __ (). It is not yet very clear to me ???

How to make so that the 3D representation reacts immediately to the modification by the up / down arrows of a property of type dimension?

Back to Table of Contents p. 27 03/19/21 (6:36))

IV.2.f Installation, creation of commands ✔ Once the classes have been created,must be installed the corresponding files. Otherwise when, after launching FreeCAD, we open a file containing atype FeaturePythonobject non- standard, we get an error message like: : Module __main__ has no class xxxxxx ✔ I was inspired by this that I understood in this forum exchange, and I usually place the class-defining file in the Mod / fpo subdirectory of the directory that FreeCAd explores at startup (under linux, it's .FreeCAD, see this page for other systems). Warning If the file containing the code comes from themacro editor FreeCAD, you must change the extension, from .FCMacro to .py, otherwise Python will not be able to find it. ✔ You also need to place a file named __init__.py in the Mod / fpo directory to tell Python that this directory contains modules that it can eventually use.

For more details, see below in the example of cycloids.

Note In this page it says that thisfile __init__.py would no longer be needed from version 3.3 of Python? However, the one we use with FreeCAD is 3.8.6 as we can verify with: import sys sys.version

Possible improvements ✔ We can then easily make a command as explained in the last part of this page (from "Of course it would be tedious "). ✔ A window can also be associated with it to define the characteristics of the expected curve right from the construction: see the section concerning Qt. ✔ You can create a new workshop containing this function as at the end of this page. IV.3. Example of object construction: epi (hypo) cycloid Following a question from a member of FABLAB, I tried to construct plates whose outer contour is an epicycloid or a hypocycloid. In all the scripts that follow, I will use the following function: def cyclo_p (R, k, t): x = R * (1 + 1 / k) * math.cos (t) -R / k * math.cos ((k + 1) * t) y = R * (1 + 1 / k) * math.sin (t) -R / k * math.sin ((k + 1) * t) return Base.Vector ([ x, y, 0]) whose input parameters are:

Back to Table of Contents p. 28 03/19/21 (6:36))

✔ R which is the radius of the base circle (on which the small circle rolls) ✔ k whose absolute value is the ratio of the radii of the circles; if k> 0 (resp. k <0), it is an epicycloid (resp. hypocycloid) ✔ t which measures in radians the angle between Ox and OI, with I the point of contact of the two circles. It returns the three coordinates of the current point of the cycloid. Although two coordinates are sufficient for a point on a plane, it is preferable for the following that the result is in the form of a Base.Vector, which is a type often used by FreeCAD. Note Obviously, this definition must be preceded by two instructions: import math from FreeCAD import Base IV.3.a Extrusion from a script First, I built the profile formed by the curve in a sketch using using themacro Rosace_Epi_Hypo_Cycloide_A01.FCMacro. Before launching thefunction curve () that it defines, open a newfile FreeCAD and create a sketch there, named Sketch. Explanations ✔ We start by sampling the segment [0,2 * pi] lst_t = [2 * math.pi * t / Nb_Pnt for t in range (Nb_Pnt)] ✔ Using the previous list, we create the list of Bases. Vector defining the vertices lst_pnt_geo = [cyclo_p (Radius, Ratio, t) for t in lst_t] ✔ It must then be closed with the first point (otherwise, problem to extrude then) lst_pnt_geo.append (lst_pnt_geo [0]) ✔ The previous list allows to add segments to the geometry of the sketch, and it is necessary to put coincidence constraints to ensure the closing of the polygon. while (i 0): sk.addConstraint (Sketcher.Constraint ('Coincident', i -1,2, i, 1)) i = i + 1 ✔ Finally we end with a doc.recompute (). After having executed curve (), we can extrude the sketch, after having closed it if it was open. Remarks ✔ At first, I discovered thefunctions addGeometry and addConstraint by looking at what is written in the Python console when I work with theGUI FreeCAD : it is often the first source of documentation for me.

Back to Table of Contents p. 29 03/19/21 (6:36))

✔ But then I found this Python sketch constraints page and this forum post. ✔ The previous diagram works fine if the sketch is empty when used. But if the sketch already contains elements, it is necessary to use sktch.GeometryCount which gives the number of elements already present (and which I also found using the completion) IV.3.b Direct construction of the body Next, j I have with the macro Rosace_Epi_Hypo_Cycloide_B01.FCMacro directly build the body without going through a sketch. The essential is in the block: def rosace_epi_hypo (Radius = 10, Rapport = 3, Thick = 3, Nb_Pnt = 50): ✔ After starting as in the previous macro builds the list lst_pnt_geo, we first transform it into an object Part.wire, which is a closed, threadlike outline. lst_pnt_wire = Part.makePolygon (lst_pnt_geo) ✔ We then create the full face corresponding to the interior of this contour. lst_pnt_face = Part.Face (lst_pnt_wire) ✔ And an extrusion makes it possible to obtain an object of type Shape lst_pnt_shape = lst_pnt_face.extrude (Base.Vector (0,0, Thick)) ✔ We can then add to the document an object of type Part :: Feature, and put in itsproperty Shape what we have just calculated. feat = doc.addObject ("Part :: Feature", "Rosace_Feature") feat.Shape = lst_pnt_shape ✔ But thisobject feat is of type Part and not of type PartDesign, which prevents working on it, if only for make a hole in the middle. To have a Body, you must: • add one to the document: ros = doc.addObject ("PartDesign :: Body", "Rosace_Body") • then point itsproperty BaseFeature to the object there feature previous: ros.BaseFeature = feat • We can also take the opportunity to turn off this feat.ViewObject.Visibility = False

As always during testing, I started by copying this macro, in theconsole Python. ✔ We can then l 'use with the default values by typing: rosace_epi_hypo () ✔ But if you want, for example, a hypocycloid with 5 cusps, just type: rosace_epi_hypo (Report = -5)

Back to Table of Contents p. 30 03/19/21 (6:36))

The previous approach is essentially based on procedural programming even if it s 'applies toobjects FreeCAD. But it is more interesting (and a little less obvious) to create classes and use object programming. This is the purpose of what follows. IV.3.c First use of class By being inspired primarily by this page (and its continuation) and by using what precedes, I in the macro Rosace_Epi_Hypo_Cycloide_C01.FCMacro, created the class Cycloid ; it essentially contains two functions: ✔ the called each time an object of this class is created: __init __ (self, obj) • Theparameter obj designates an object from thefile FreeCAD previously added to the file by an instruction of the type: obj = App. ActiveDocument.addObject ('Part :: FeaturePython', "Cycloid") • The first instruction points the Proxy of theobject FreeCAD to theobject Python : obj.Proxy = self • Then, properties are added which will be displayed in the window Property / Data and that the user can modify as he modifies the dimensions of a Box in theworkshop Part. For example regarding the radius of the base circle: obj.addProperty ('App :: PropertyFloat', 'Radius', 'Dimensions', 'Radius of the base circle'). Radius = 10.0 For more information on properties, see the previous section (??? ref). ✔ the special function execute (self, obj) • It is this function which provides all the instructions for the effective realization of our object: we find there the instructions seen in the “Direct construction of the body” part. • It first constructs a Shape and then ends with the instruction that assigns it to obj.Shape : obj.Shape = lst_pnt_shape • This function is executed at each doc.recompute () ; it is this which allows the update of the form each time the data is modified. • We could add anmethod onChanged(self.obj, prop), which would then be called on each modification of a property, even with the up / down arrows; the name of the modified property being contained in thevariable prop, we can test what has been modified. The above allows you to create an object and insert it into thefile FreeCAD. But this is not yet sufficient to have a screen representation of it. For this, the ideal would be to define aclass ViewProviderCycloid defining how the object is displayed.

Back to Table of Contents p. 31 03/19/21 (6:36))

✔ However for an object of the FeaturePython type, thisclass ViewProviderCycloid is not essential at first, and one can be satisfied with the assignment: obj.ViewObject.Proxy = 0 ✔ In a second realization of this macro, j ' I used a ViewProvider which I only used to define a particular icon for the cycloidal contour objects that I had just defined. This is done by themethod getIcon . • I defined it in XPM, but it seems to be an old thing! • You can also use afile .svg or .png by returning its name to getIcon.

Each time you execute thefunction create (), which allows you to package all of this, you easily build an expected shape, and you can modify its characteristics with thewindow Properties / Data. Everything is fine until we save a file containing such an object and then want to reload it in a new FreeCAD session. IV.3.d Installation The previous macro works fine and provides a object editable on the fly using thewindow Properties / Data but there are two drawbacks. ✔ Each timerestarted FreeCAD is, this macro must be loaded / executed. ✔ If we open afile FreeCAD containing a cycloid before having executed the definition of the classes, then errors are generated and the objects are no longer editable. To remedy this, you need to install these class definition files in a location where FreeCAD can find them. ✔ To allow FreeCAD to load the Python code defining theclass Cycloid, I started by renaming the file to cycloid.py. Because by default the Macros files of FreeCAD have the extension .FCMacro. ✔ Then, I placed this file in the Mod / fpo subdirectory of the directory that FreeCAd explores at startup for Macros and add-ons ; under linux, it is .FreeCAD, see this page for other systems. However, the following structure must be respected: .FreeCAD Directory containing macros and add-ons Mod Directory containing the modules fpo Directory feature ptyhon objects | __init__.py Empty file | cycloid Directory dedicated to cycloids | __pycache__ Directory created by Python | __init__.py Empty file | cycloid.py File containing class definitions Thefiles __init__.py can be left empty: their role is to indicate to Python that the corresponding directories contain modules (see this page or this other).

Back to Table of Contents p. 32 03/19/21 (6:36))

With such an installation, ✔ theclass Cycloid is loaded when FreeCAD needs it, and there is no longer an error openingfiles FreeCAD containing objects of this class; ✔ rather than copy / paste program lines or execute them via themenu of FreeCAD, we can use import in the Python console: with the above layout, we can for example write: from cycloid.cycloid import * ✔ we can then notice that there has been creation of a __pycache__ directory where Python stores a compiled version of the modules; this is also a way to check that the module is loaded: just delete it to check that it is generated again?

Note As indicated on this page (Setting_things_up), I first installed thedirectory fpo in thedirectory Macro of mydirectory .FreeCAD (under linux). but I had problems because I used to browse my user macros directory depending on the projects I am working on: when thedirectory Macro I chose when I last used FreeCAD is not the one by default, FreeCAD cannot find the classes during launch, which causes errors. IV.3.e Make an order ?? We can then easily make an order as explained in the last part of this page (from "Of course, it would be tedious ").

To go further openBrain offers: For the creation dialog (and if you want to push it further), what would be good is to convert it to a widget and use the setEdit () / unsetEdit () methods to display it in the task panel. Like that even after creation, we can still use the GUI to edit. https://forum.freecadweb.org/viewtopic.php?t=55169 https://forum.freecadweb.org/viewtopic.php?t=5977 ✔ Macro: Task Panel Usage and Documentation see this example https://github.com/mnesarco/FreeCAD_Uti ... pov.py # L37

03/19/21 (18:36)

IV.4. Deepening ??? This part is still under construction ??? IV.4.a ViewProvider Classes This part contains references on the construction of ViewProvider competitive, sometimes giving (cf. the history of the molecule ) a very different representation of what the object really is. This forced me to go to the Scenegraph and themodule Coin : it's not easy!

Back to Table of Contents p. 33 03/19/21 (6:36))

It was while reading this discussion (especially from the 7th post) that I was led to look at this very interesting page on scripted objects (which also exists in French). First it took me some time to realize that: ✔ some objects are created there as Part :: Feature, for which according to the previous remark one can dispense with describing a ViewProvider ; ✔ while others are created there as App :: Feature, for which it is essential to create a ViewProvider. See possibly this diagram of the relations between the classes

Concerning the previous discussion : ✔ see this bug report (indicated in the discussion); ✔ see also this modification concerning the molecule ; ✔ all the rest is about So… and I have to understand it.

The main page on Viewprovider (but not much except geticon) Regarding the example of the Octahedron https://wiki.freecadweb.org/index.php?title=Scripted_objects ✔ I started by putting a FreeCAD.ActiveDocument.recompute () ✔ Contrary to what happens for a Box type object, the “Coordinate3” part of the ViewObject is not updated when we change a dimension! And indeed, there is nothing about this in the updatedata function!

See Ref Api ViewProvider ??? or this page or this one

See this dedicated page https://wiki.freecadweb.org/Viewprovider ???? All a part on the part on the ViewProvider of a Part :: Feature

https://wiki.freecadweb.org/Viewprovider

IV.4.b Scenegraph, Coin and Some explanations concerning the terms Coin, scenegraph and other Open Inventor languages that are often encountered in this context. ✔ A scenegraph is a data structure often used by a graphics program,

Back to Table of Contents p. 34 03/19/21 (6:36))

Return to Table of Contents p. 35 03/19/21 (18:36)

like for example FreeCAD ✔ The page of the FreeCAD doc on scenegraph where we find: One of the big jobs FreeCAD does for you is translating OpenCASCADE geometry information into OpenInventor language. There are also three lines of macros allowing to visualize the scenegraph of an object or rather its representation incode Open Invenror: obj = FreeCAD.ActiveDocument.ActiveObje ct viewprovider = obj.ViewObject print viewprovider.toString () ✔ To handle all this we useinterface Pivy : • On this page : we find the following statement: Therefore, in FreeCAD, the terms "Pivy", "Coin" or "Open Inventor" refer to the same thing essentially. • There is also a code showing how coin allows to track by callback the events linked for example to the mouse. • To understand a little better all these stories ofOpen Inventor Language andfunctions Soxxx (), I found the book The Inventor Mentor of which I have a on disk.

Possibly see how to insert an object in the scenegraph

IV.5. Other perhaps interesting references ✔ When looking for information on writing in Python, remember to use the where we sometimes find interesting things. But it's not always easy. ✔ ✔ The hours istoires mouse and cursor change ✔ Ideas needed how to pause a macro until some imputs / selections are done ✔ ✔ An old post (2012) on the recovery of scripted objects where we stress the importance of the attach () method and where we talk about __getstate__ () and __setstate __ (). • https://forum.freecadweb.org/viewtopic.php?t=40812 • https://wiki.freecadweb.org/Scripted_objects_saving_attributes

Back to Table of Contents p. 35 03/19/21 (6:36))

• In https://wiki.freecadweb.org/Scripted_objects/en we find: It is possible to package Python code in a FreeCAD file using json serialization with an App: : PropertyPythonObject, but this code can never be executed directly and therefore has little use for our purposes here. ✔ ✔ QT: how to detect a click in the 3D view? And this post ✔ To do a merge see https://wiki.freecadweb.org/Scripts ✔ Link with Pyramids-and- Polyhedrons / tree ???? ✔ About compound type objects

Back to Table of Contents p. 36 03/19/21 (18:36)

Another interesting exchange about the transition from cpickle to Json: thus we can no longer store a python class in the Proxy

or even (for the most advanced) an interface creation page

Maybe something interesting to watch

Access by a variable to a property of a FeaturePython and modify it

Loop on Part :: FeaturePython onChanged

App :: FeaturePython equivalent toPart :: Multi Union / Fuse

FeaturePython / Scripted Object question

FeaturePython restoring on document load https://raw.githubusercontent.com/FreeCAD/FreeCAD/master/src/Mod/Templat ePyMod/ FeaturePython.py https://forum.freecadweb.org/viewtopic.php?t=47132 https://forum.freecadweb.org/viewtopic.php?f=10&t=24734&p=194209&hilit=proxy#p19420

9

Another interesting page on FreeCAD default directories

Back to Table of Contents p. 36 03/19/21 (6:36))

Something to watch https://forum.freecadweb.org/viewtopic.php?f=22&t=45754&start=20

Back to Table of Contents p. 37 IV.6. Topological and geometric sub-objects This text reflects my experience of discovering these notions following in particular the reading on the forum of this post of Chris_B or this other. One should not seek in what follows an exhaustive list of the properties concerned (which would be impossible) but rather an introduction allowing the reader to become a little more autonomous in the discovery of their manipulation. Aobject FreeCADnaturally exposes some of its characteristics. ✔ A Box for example exposes its three dimensions in thewindow Property / Data, and the user can easily modify them there with immediate visualization of the result. ✔ It is the same for a (trunk of) cone, which exposes angle, height and its two radii. ✔ For aobject PartDesign, it is in the functions (features) which were used to construct it that we find certain properties such as for example dimension of a protusion; and we can also modify them with immediate effect on therepresentation 3D.

Back to Table of Contents p. 37 03/19/21 (6:36))

✔ For an object of type FeaturePython, the designer can also expose some properties in thewindow Property / Data (cf. addProperty)

But there are many other entities that can be found in an object and which are linked to the format thatuses FreeCAD to represent itsobjects 3D internally: the B-Rep (Boundary RepresentationEdge in English) translated as Frontier or RepresentationRepresentation. In FreeCAD, with the exception of Mesh type objects, almost all objects with a 3D representation have a Shape (of class Part :: TopoShape). ✔ For example: a Body is built from a Part Feature created with the P artDesign workshop ✔ A Shape is an internal object, sub-object of a Body (Bodyxxx.Shape) ✔ Atype object Part which groups together several Bodies has therefore a collection of Shapes, but has no form of its own.

Unlike CSG which works from simple solids and Boolean operations, with B-Repaobject 3D is fully represented by its edge. It is a technique which separates: ✔ on the one hand, the topological elements, of type 'Part :: TopoShape', such as for example faces, edges, vertices) and the relations (adjacency, incidence) which they have between them; ✔ on the other hand, geometric elements of the Part :: Geom… type, such as Part :: GeomLine (for a line) or 'Part :: GeomCircle' (for a circle); we can see them as the supports of the preceding ones, which define their position in space.

On this page, we find a brief presentation and an interesting organization chart. For a given box, all of these entities are in itssub-object Shape ; for example, for a Box created with theworkshop Part, and which can be handled in Python using: >>> obj = App.ActiveDocument.Box these topological and geometric entities are found in: >>> obj_shape = obj.Shape It is the same for anyobject 3D FreeCAD, however you build it. IV.6.a Subobjects topological descending order of complexity, the main topological features of aobject obj 3D of FreeCAD returned by the following properties. ✔ obj.Shape.Faces returns the list of faces of obj. • Thus for any integer i strictly less than len (obj_shape.Faces), obj.Shape.Faces [i] gives a reference to the face with index i of obj. • Beware thatprogramming, Pythonthe index i starts at 0,while in the Gui FreeCAD,the indices of the faces that appear in the status bar start at 1. ✔ obj.Shape.Wires returns the list of closed contours planes of obj.

Back to Table of Contents p. 38 03/19/21 (6:36))

• Thus for any integer j strictly less than len (obj_shape.Wires), obj.Shape.Wires [j] gives a reference to the closed contour of index j of obj. • Same warning as above concerning the domain wherevaries j. • However Wires is also a property of a face object and the statement: obj.Shape.Faces [i] .Wires returns the list of all closed contours of the face with index i of obj. • However, automatic completion does not work if you type obj.Shape.Faces [i]. When the point “ . »Is thus preceded by a selector, the completion window does not seem to work correctly; to find it I had to make the assignment: f = obj.Shape.Faces [i] before typing f., and to be able to find it. ✔ obj.Shape.Edges returns the list of edges of obj. • We can make exactly the same remarks as previously concerning the index k allowing access to an element of such a list. • Thisproperty Edges can be applied to aobject as well as to one 3Dof its Faces, or even to one of the Wires ; it then returns the corresponding edges. ✔ Obj.Shape.Vertexes lists the vertices of obj ; but as before, this property can also be applied to one of its Faces, one of its Wires or one of its Edges.

As can be verified using the Python console, each of the preceding sub-objects has the same type, which is Part :: TopoShape. >>> obj.Shape.Faces [0] .TypeId, obj.Shape.Vertexes [0] .TypeId 'Part :: TopoShape' , Part :: TopoShape '

On the other hand, each category has a ShapeType different: >>> obj .Shape.Faces [0] .ShapeType, obj.Shape.Vertexes [0] .ShapeType 'Part :: TopoShape', 'Vertex'

Each of the preceding topological entities is associated with a geometric entity, the support on which it is built: a point, curve or surface. We study them below. IV.6.b Support of a Vertex (Point) ✔ If Box is a default cube built with Part, we get the list of its vertices with: >>> App.ActiveDocument.Box.Shape.Vertexes [, ,…. ] ✔ To obtain the vertex which is displayed as Vertex6 in the status bar, type:

Back to Table of Contents p. 39 03/19/21 (6:36))

>>> v = App.ActiveDocument.Box.Shape.Vertexes [5] # Offset of 1 ✔ The recovery of the vertex coordinates is then do with: >>> v.Point Vector (10.0, 0.0, 0.0) ✔ If we only want the list of points of Face3, we type: >>> App.ActiveDocument.Box.Shape.Faces [2 ] .Vertexes [, ,…] IV.6.c Support of an Edge (Curve) If e is a stop, therefore with e.ShapeType == 'Edge', then e. Curve returns a reference to a curve containing it and which FreeCAD most often treats as a parameterized curve. Take the example of the (truncated) cone defined with the default values of theworkshop Part. ✔ Let's start by getting the Shape of the object: >>> obj_sh = App.ActiveDocument.Cone.Shape ✔ In my case, the top circle shows up in the status bar as Edge1, so I get it with: >>> edg_1 = obj_sh.Edges [0] I can display its ShapeType >>> edg_1.ShapeType 'Edge' ✔ I then point curv_1 to its Curve >>> curv_1 = edg_1.Curve ✔ This curve is of type ' Part :: GeomCircle ' and, as can be seen, FreeCAD uses a parametric representation with an angle varying from 0 to 6.28… = 2π radians. >>> curv_1.TypeId, curv_1.FirstParameter, curv_1.LastParameter 'Part :: GeomCircle', 0.0, 6.283185307179586 ✔ I discovered the previous three properties using the usual completion in theconsole Python. It also allows you to find lots of other properties like for example: >>> curv_1.isPeriodic (), curv_1 .__ doc__ # which returns the docstring True, 'Describes a circle in 3D space….' ✔ Note that we can also find the domain of variation of the parameter at thelevel Edge.

Back to Table of Contents p. 40 03/19/21 (6:36))

>>> edg_1.ParameterRange (0.0, 6.283185307179586) Now let's take a look at the generator colored in green. ✔ In my case, I see it showing in the status bar like Edge2, so I get it back with: >>> edg_2 = obj_sh.Edges [1] ✔ I can display its ShapeType >>> edg_2.ShapeType

'Edge' ✔ I then point curv_2 to its Curve >>> curv_2 = edg_2.Curve ✔ This curve is of type 'Part :: GeomLine ' >>> curv_2.TypeId 'Part :: GeomLine' ✔ If, as before, we try to find the domain of the parameter, with curv_2 : >>> curv_2.FirstParameter, curv_2.LastParameter -2e + 100, 2e + 100 and with the topological object of which it is the support: >>> edg_2.ParameterRange (0.0, 10.198039027185569) we see that FreeCAD treats here differently • the stop (Edge) which is a segment therefore bounded, • its support which is an almost unbounded line (2e + 100 playing the role of infinity).

Back to Table of Contents p. 41 03/19/21 (6:36))

If we cut the cone by a plane which is not orthogonal to its axis of symmetry, we obtain an ellipse or a hyperbola or even exceptionally a parabola depending on the orientation of the plane. ✔ If, as opposite, the ellipse is displayed as Edge1, we get it the topological object by: edg = App.ActiveDocument.Cut.Shape.Edges [0] then its support by: curv = edg. Curve ✔ With the automatic completion, we see that we can have: curv.Eccentricity curv.Focus1 curv.MajorRadius whose names are sufficiently eloquent.

The curious reader will be able to verify: ✔ that in the case of an ellipse, the limits of the parameter are the same with edg and with curv, ✔ whereas in the case of a hyperbola, the topological object remains bounded while its geometric support ( as for the right) is almost infinite! IV.6.d Support of a Face (Surface) If f is a face, so with f.ShapeType == 'Face', then f.Surface returns a reference to a surface containing it, which FreeCAD treats as a parameterized surface , the parameters being called U and V.

Let us take the example of the (trunk of) cone defined with the default values of theworkshop Part. ✔ Let's start by getting the Shape of the object: >>> obj_sh = App.ActiveDocument.Cone.Shape ✔ In my case, the side surface (in green) is displayed in the status bar as Face1, and I have it thus recover with: >>> fac_1 = obj_sh.Faces [0] Let us recall that for the index there is a shift of 1 between what is seen in the GUI and that of thelist Python. ✔ I can display the ShapeType : >>> fac_1.ShapeType 'Face' ✔ I then point surf_1 to its Surface which is of type 'Part :: GeomCone'

Back to Table of Contents p. 42 03/19/21 (6:36))

>>> surf_1 = fac_1.Surface >>> surf_1.TypeId 'Part :: GeomCone' ✔ Using completion, we see that we can then find its vertex, its axis (point & vector), its half-angle at the vertex, ... >>> surf_1.Apex Vector (0.0, 0.0, -10.0) >>> surf_1.Center, surf_1.Axis Vector (0.0, 0.0, 0.0), Vector (0.0, 0.0, 1.0) >>> surf_1.Radius 2.0 >>> surf_1.SemiAngle 0.19739555984988078 ✔ This surface, of type 'Part :: GeomCone', is parameterized by the angle of rotation around the axis of the cone and the distance on the edge which is worth at most 10 / cos (surf_1.SemiAngle) because the cone is height 10mm. We find this upper limit with the ParameterRange of the face, but not with the surface whose generatrices are straight lines, therefore “infinite”. >>> fac_1.ParameterRange (0.0, 6.283185307179586, 0.0, 10.198039027185569) >>> surf_1.bounds () # do not forget the () because it is a method (0.0, 6.283185307179586, -2e + 100, 2e + 100)

Note The set of coules (U,V) making it possible to describe the entire surface is therefore the rectangle defined by: 0 ≤ U ≤ 6.28… and 0 ≤ V ≤ 10.19… Let's do the same thing with the upper face of this cone, in green on the drawing opposite. In my case, it shows up in the status bar as Face2. ✔ Itherefore recover it with: >>> fac_2 = obj_sh.Faces [1] ✔ I can display its ShapeType : >>> fac_2.ShapeType 'Face' ✔ I then point surf_2 to its Surface which is of type 'Part :: GeomPlane' >>> surf_2 = fac_2.Surface >>> surf_2.TypeId 'Part :: GeomPlane'

The surface, of type 'Part :: GeomPlane', is a plane parameterized by its two coordinates;

Back to Table of Contents p. 43 03/19/21 (6:36))

✔ as such a plane is unbounded, the bounds () method applied to this surface returns “infinite” values of the order of 2e + 100, >>> surf_2.bounds () (-2e + 100, 2e + 100 , -2e + 100, 2e + 100) ✔ while the parameters describing the face are the same coordinates but bounded by 4 : >>> fac_2.ParameterRange (-4.0, 4.0, -4.0, 4.0)

IV.6.e Curves coordinates of a surface To visualize the way in which a surface is parameterized with the values U and V, we can draw the two families of coordinate curves, at U constantfor the first and at V constantfor the second. For this, in addition to what we have already seen, we use: ✔ first surface.uIso (u) which returns the coordinate curve of surface at U constant; it is a geometric object; ✔ then the toShape (v_min, v_max) method which transforms the previous geometric object into a topological object which can then be added to the current document.

Note You can also use themethod toShape without parameters when the curves being handled are bounded; but in the case of a cone for example, the generatrices (geometric lines) are unbounded and it is essential to put limits. The following function is used to view these two families of lines.

def trace_isoline (body_name, face_number, nb_curves = 10):

# get the face (here face_number is what we see with the GUI) face = App.ActiveDocument.getObject (body_name) .Shape.Faces [face_number-1] # get the geometric surface of the face surface = face.Surface

# get the parametric bounds (u_min, u_max, v_min, v_max) of the (parametric ) surface # One can also use limits = surface.bounds (), # but it is "inifnite" for non bound objects such lines

Back to Table of Contents p. 44 03/19/21 (6:36))

limits = face.ParameterRange u_min, u_max, v_min, v_max = limits

# Drawing of the u- isoparametric curve u = u_min h = (u_max-u_min) / nb_curves while u <= u_max: # get the u-isoparametric curve lu = surface.uIso (u) # Add it to the document with blue color obj = App.ActiveDocument.addObject ('Part :: Feature', "ligne_Iso_u") obj.ViewObject.LineColor = (0.0,0.0,1.0) # Put the Shape of the curve into the object # (the use of v_min and v_max is madatory in the case of line, to clip it) obj.Shape = lu.toShape (v_min, v_max) # Next u value u + = h

# Likewise drawing of the v-isoparametric curve v = v_min h = (v_max-v_min) / nb_curves while v <= v_max: Face1 lv = surface.vIso (v) obj = App.ActiveDocument.addObject ('Part :: Feature', "ligne_Iso_v") obj.Shape = lv.toShape (u_min, u_max) obj.ViewObject.LineColor = (1.0,0.0, 0.0) v + = h

Back to Table of Contents p. 45 03/19/21 (6:36))

This function can be used to draw these coordinate curves on the green surface of a cone named Cone obtained with theworkshop Part. As it is displayed as Face1, we type: >>> trace_isoline ('Cone', 1) We then see: ✔ the blue curves: on each of them, the angle U is constant, while V varies by 0 to the maximum length of the edge. ✔ the red curves: on each of them, the distance V is constant, while the angle U varies from 0 to 2π.

If we then use thisfunction trace_isoline to obtain the curves coordinated with U and V constantof the upper face of the same cone: >>> trace_isoline ('Cone', 2) we obtain the grid opposite, which corresponds well to the domain given by the ParameterRange : -4 ≤ U ≤ 4 and -4 ≤ V ≤ 4 but which is not quite what we expect.

To retrieve the circle, we can use OuterWire, which returns a Wire from which we can then extract the circle. >>> e = fac_2.OuterWire.Edges [0] >>> e.Curve Circle (Radius: 4, Position: (0, 0, 10), Direction: (0, 0, 1))

Note In a case like the one on the right, where ✔ the intersection of the plane with the cone is a hyperbola, ✔ the initial generator of the cone is below, the OuterWire has three components, which is not obvious at first glance! >>> f = App.ActiveDocument.Cut.Shape.Faces [2]

Back to Table of Contents p. 46 03/19/21 (6:36))

>>> f.OuterWire.Edges [, , ] IV.6 .f Example with B-Splines Let us look at the case of the green face of the loft opposite made between a rectangle of the plane z = 0 and a circle of the plane z = 50. As it displays as Face6, I put: >>> f = App.ActiveDocument.Body.Shape.Faces [5] >>> c = f.Surface >>> c.TypeId 'Part :: GeomBSplineSurface'

For this surface of thetype B-Spline the limits of the parameters U and V are the same, whether they are taken on the topological object f or on the geometric object c. >>> c.bounds (), f.ParameterRange (0.0, 62.340035, 0.0, 1.0), 0.0, 62.340035, 0.0, 1.0)

To view this setting, you can run: >>> trace_isoline ('Body', 6) ✔ each blue curve corresponding to a given value of U chosen between 0 and 62.34 ..., while V varies from 0 to 1. ✔ each red curve corresponding to a given value of V chosen between 0 and 1, while U varies from 0 to 62.34 ...

IV.6.g And the reverse: from simple to complex? Conversely, on this page, one can find how to build geometric objects as well as topological objects. ✔ Some functions like Part.makeLine () or Part.makePolygon () directly give an object of type 'Part :: TopoShape', and you have to go through .Curve to get the underlying geometric object.

Back to Table of Contents p. 47 03/19/21 (6:36))

✔ Others like Part. LineSegment () or Part.BezierCurve () return a geometric object, and you must then use amethod .toShape () to transform it into a topological object, of type 'Part :: TopoShape'. ✔ We can also look for example at this post which talks about it. IV.6.h The toShape (...)

function I dissected the function in Curve2dPyImp.cpp

toShape (...) method of Part.Line

instance Return the shape for the

geometry.

toShape (...) method of Part.Plane

instance Return the shape for the

geometry.

# I shelled the function in Curve2dPyImp.cpp PyArg_ParseTuple ()

https://matthieu-brucher.developpez.com/tutoriels/python/api-c-numpy/ (for O!)

Http://sdz.tdct.org /sdz/introduction-au-scripting-avec-python.html

https://python.jpvweb.com/python/mesrecettespython/doku.php?id=example_python_cp p

https://www.oreilly.com/library/view/python -in-a / 0596001886 /

re1107.html https://docs.python.org/3/c-api/arg.html (for O!)

https://docs.python.org/fr/3.7/c- api / arg.html (for O!)

https://askcodez.com/lextension-de-python-avec-c-passer-dune-liste-a- pyarg_parsetuple.html

int PyArg_ParseTuple (PyObject * args, const char * format , ...)

Back to Table of Contents p. 48 03/19/21 (6:36))

Parse the parameters of a function that takes only positional parameters into local variables. Returns true on success; on failure, it returns false and raises the appropriate exception. 03/19/21 (18:36)

IV.7. BULK IV.7.a Selection

See the script on this page on the selection See also https://wiki.freecadweb.org/Selection_API to distinguish between getSelection and getSelectionEx IV.7.b B-Spline A little theory on curves de Bézier and the B-spline https://wiki.freecadweb.org/B-Splines

https://forum.freecadweb.org/viewtopic.php?t=13124 https://fr.wikipedia.org/wiki/Spline https://fr.wikipedia.org/wiki/B-spline https://pages.mtu.edu/~shene/COURSES/cs3621/NOTES/note s.html

https://www- ljk.imag.fr/membres/Nicolas.Szafran/ENSEIGNEMENT/MASTER2/CS/courbespolynomiales.pdf

http://info.usherbrooke.ca/ogodin/seignement/imn428/Chapitres/imn428-chap05.pdf https://www.fil.univ-lille1.fr/~aubert/m3ds/m3ds_courbe.pdf https://team.inria.fr/virtualplants/files/2014/09/cours_NURBS.pdf https://forum.freecadweb.org/viewtopic.php?f=22&t=55630

the NURBS = Non Uniform Rational Basis Spline surface flattening IV.7.c Open-Cascade https://dev.opencascade.org/doc/refman/html/index.html https://dev.opencascade.org/doc/refman/html/_b_rep___tool_8hxx.html

✔ An index of everything what we can do with openCascadehandles

Back to Table of Contents p. 49 03/19/21 (6:36))

✔ An interesting page on https://dev.opencascade.org/doc/overview/html/occt__tutorial.html IV.7.d vrac In this post from Chris_G, we find:Second important thing: get a clear understanding of BREP () used by OpenCascade to create geometric objects. It is separated into 2 levels: - Geometry (points, curves, surfaces) that are used as support entities to define topology - Topology (vertexes, edges, faces, wires, shells, solids) that are "visible" (and bounded) objects

Return Table of Materials p. 48 03/19/21 (18:36)

built upon a geometry http://free- cad.sourceforge.net/SrcDocu/d9/d35/classPart_1_1TopoShapeFacePy.html see alwaysfrom chris_G (review whole discussion) https: // forum.freecadweb.org/viewtopic.php?p=232159

https://forum.freecadweb.org/viewtopic.php?t=7316 https://forum.freecadweb.org/viewtopic.php?t=53782 https: / /forum.freecadweb.org/viewtopic.php?t=15313 https://forum.freecadweb.org/viewtopic.php?t=15313

Looks like Surface and Curve are defined in see

https: //

dev.opencascade.org/doc/refman/html/class_geom___surface.html

Back to Table of Contents p. 50 03/19/21 (6:36))

Back to Table of Contents p. 49 V. Animation V.1. Before Assembly 3 V.1.a The Animation workshop To make animation, we see a lot of videos using theworkshop Animation that we can theoretically install with theadd-on manager. But it no longer works with the latest versions, which use Python 3 ✔ An example of gear animation with thegear Fcgearworkshops ✔ A nice (complicated) example of animation with a ball track ✔ We also find this nice video. But it's quite old and I couldn't get it to spin. The workshop V.1.b A2plus ✔ A gear assembly in French (the Pascaline) withmodule A2plus (you need to download the Manager ofadd-on). • It uses independent files for both media and gears. • One sees there the use of the constraints of coplanarity and coaxiality But nothing moves at the end! It is not animation. ✔ Assemblinga library with themodule A2plus(not yet looked at) ✔ Another example of assembling with themodule A2plus ; there is also anothervideo (more complicated)showing how to cut parts.

V.2. Theworkshop Assembly 3 A very interesting site on Assembly 3 (to be reviewed in detail and in priority) https://bassmatifreecad.github.io/FreecadUserBook/en/asm3/link.htm https://www.youtube.com/watch?v=UYHIX1IEfTE&feature=youtu.be (private video ???) The wiki page to which many references lead A tutorial on this page https://bassmatifreecad.github.io/FreecadUserBook/en/asm3/asm.htm (broken) https://wiki.freecadweb.org/Assembly3_Workbench (global page)

https://github.com/ceremcem/freecad-notes https://www.youtube.com/watch?v=KJ3Dm6Rt4Nc https://youtu.be/oFXlDKFzync?t=263

Back to Table of Contents p. 51 03/19/21 (6:36))

V.3. Theworkshop Assembly 4 V.3.a Introduction Theworkshop Assembly4 allows you to make assemblies and also animations. But we must admit that it is not very easy to learn. It is not part of the workshops originally installed and you have to use theAdd-on manager : installation long enough for me, do not get impatient. ✔ The official page of Assembly4 (very poor at the moment 01/02/20) ✔ A general presentation (English) by its main designer and the tutorials he made. In particular this tutorial and its version written to position on an axis three ball bearings (imported in .step), but all this seems very complicated for the result obtained! ✔ See more technical (but also redundant) explanations on this page or that one. V.3.b First examples There are many simple examples, see simplistic and in which the use ofAssembly4 does not seem essential (we can get out of it with a simple placement) ✔ An assembly of gears (in English) • It's a pretty simple assembly of two small gears that turn at the end! In fact it uses the " Placement " of each gear and Assembly4 only allows it to enter the terminals and the angle increment in windows instead of doing it in programming. • He also said around 10mn30 that "theworkshop Assembly4 is difficult to use and that it is better to start by trying A2plus ". ✔ An interesting animation with Assembly4 of a disc and an arm (connecting rod / crank type).

There is antopic on the forum Assembly 4 workbench which contains some interesting examples. ✔ First simple examples • How to see screwing a bolt • How to drag a nut (and the FreeCAD file) • a 5-sided chain that wraps around ✔ Then come more interesting (and more difficult) animations • First a two piston engine • A completely different idea: scissors / elevator A • whole cabinet (with doors) • How to put bolts with Asm4 (fixed bolts) • An interesting monster on this page. See also the associated exchange ✔ One of theparticipants ppemawm showed some really very thorough examples:files FreeCAD are not available on the forum but he sends them on request. We can cite:

Back to Table of Contents p. 52 03/19/21 (6:36))

• an example of a carburettor (cf this carburator this carburator subassembly ) • an "adjustable clamp" • A mini helicopter whosecan be found planson this site • A lawn mower fairly complexwith several files and sub-assemblies He also explains the top / down method and gives very good advice. ✔ More generally we can take a look at the User ShowCases

V.3.c Extracts (more technical) from the forum It is by dissecting thetopic Assembly 4 Workbench of the forum that I found the following. ✔ With the first versions, it was essential to put each Body in a Part before being able to use it with Assembly 4, but since version 0.9 this is no longer essential, the Part remaining essential for imported objects (such as .step). ✔ The principle of Assembly4 is based on the use of objects App :: Link which allow (even outside of Assembly 4) to create "holograms" and easily multiply an object. ✔ With Assembly 4you can use Fasteners Workbench (screws and bolts). ✔ As explained in this post, understand that Assembly4 is not intended to solve constraints, it can only align LCS (Local Coordinates Systems). If you need constraints, you have to create a Sketch (which knows how to solve the constraints) and align the LCS on it. ✔ To have dependent variables, all you have to do is create them in the “window Add- variables ”of Assembly 4 and define their expressions in thewindow Property / view after selecting in the tree structure. ✔ An example of a mechanism using rotation and sliding (variable using a ternary test) ✔ What is the error Error: Links go out of the allowed scope ? ✔ Be careful, if you edit a sketch there is a risk that the LCS will attachedno longer work because there may be renumbering of the vertices, sides on which they are hung. ✔ About the sharing of variables between several assembly levels ✔ About exploded models V.3.d Hexapod It's this beautiful hexapod video that inspired me to make one! ✔ The video which allowed me to start in FreeCAD ✔ An eduscol project and another allowing to make a hexapod and to control it with an ✔ A problem of CentraleSupelec / 2008 / TSI on the subject Hervé sent me some interesting references

Back to Table of Contents p. 53 03/19/21 (6:36))

✔ A platform of Stewart piloted by ESP-32 ✔ A ball that rolls on a limited surface with steppers ✔ A much more ambitious achievement ✔ Another with legostechnical ✔ A trueplatform (which throws) and last

V.3.e Sub-Assemblies ✔ An interesting video : putting a window with two opening panes on a house. ✔ Another idea of car suspension ✔ How to use LCS in sub-assembly (you must use or the icon ) ✔ A tutorial with subassembly not exceptional but where we see the use of < Import Datum> V.4. Animating with Python Macros I have found two ways to do animation without the previous workshop. ✔ By using, as for this Piston, a master script that we clone. Then you just have to modify this master to animate the whole construction. It is then FreeCAD which recalculates at each moment the different positions of the body and it is therefore not very fast. ✔ By using directly the placement of the objects (case of the gears) and it is much faster because FreeCAD then has almost nothing to calculate. • A first example of a perforated cylinder that turns: there is no oral explanation but it is interesting because we see explained the dependence between what we can create as objects and the corresponding Python script lines . • A simple animation video of two gears very well explained (in English) ✔ Finally, I wanted to mix the two: • I start by doing a tour, letting FreeCAD calculate the positions. • It's quite slow, but we can store these positions in an array (or even several). You can also store them in a file. • We can then replay the animation with these positions and it's much faster I think that's whatis Ric Lefrogdoing on this video (although I wonder if he doesn't do it by hand by adjusting each position?) Warning When you launch a macro, an animation that runs with a timer, it is very difficult to stop it because it runs in a thread of its own and it is impossible to access it using the console . When one tests such a macro, it is thus preferable to make a copy and paste in the python console and to execute it there; you can then easily stop it with timer.stop ().

Back to Table of Contents p. 54 03/19/21 (6:36))

V.5. Engrenages The official page of FCGear which leads to: ✔ the page for gears (involuteInvoluteGear) ✔ the page for rack gears (InvoluteRack) But we also find: ✔ a page on the end screws (WormGear) ✔ a page on gears bevel (BevelGear) ✔ a page on crown gears (CrownGear)

A short interesting presentation of the different terms used

The modulus m is defined by m = / And therefore: m * π = On this page (or here) I found a drawing summarizing things well

Back to Table of Contents p. 55 03/19/21 (6:36))

An interesting poly from PTSI on the types of transmissions (including gearboxes) Do n't forget the wiki

A basic video on therack and pinion system V.6. Collision and contact ✔ A code to look at and especially the collision module of this page which mainly uses common (). I did not find a proximity () there. ✔ A forum post very interestingabout using themethod proximity () with two arguments, the second of which is a tolerance value. To reread in detail! Review But I think there is a bug because if I set the tolerance to 0 it seems to go into an infinite loop (unless the translation is also changed to 10.0). ✔ Other examples of using proximity () (but with only one parameter) and f.tessellate (.1) ??? what's this ??? see the distToShape () method and this post about it also review this research https://dev.opencascade.org/doc/refman/html/ class_b_rep_extrema ___ dist_shape_shape.html # details A theoretical article on 3D collision

V.6.a Numerical approximation of a minimum In this file (which I have on disk Minimization_numerique.pdf), we explain an efficient method of finding a minimum which is based on the diagram opposite using the golden ratio.

Be careful, take k = 0.6180339 (inverse of the golden ratio) and not k = 0.616 as indicated!

Back to Table of Contents p. 56 03/19/21 (6:36))

V.6.b The distToShape () method It is with that I found the best description of thefunction (method) distToShape. It's actually a method of the Shape class (TopoShape). If sh1 and sh2 are two Shapes (Toposhapes) the evaluation of sh1.distToShape (sh2) returns the tuple (dist, vectors, infos). ✔ dist is the distance of the two bodies in mm ✔ vectors is a list of pairs of App.Vector achieving the minimum distance, the first on sh1 and the second on sh2. ✔ Infos contains additional information: it is a list of t-tuples of the type: (topo1, index1, params1, topo2, index2, params2) • topo1, topo2 : identify the type of element: 'Vertex', 'Edge', 'Face'. • index1, index2 are the element indexes (starting from zero). • params1, params2 : internal description parameters of the element. For a vertex: no parameter For a side: a real parameter For a face: a t-uple formed of two real parameters

Back to Table of Contents p. 57 03/19/21 (6:36))

V.6.c Monitor the modifications To solve my contact problems, I needed to make my object evolve contact every time I moved any of the items, so I posted a question on the forum. ✔ We can first add an App :: PropertyLink to the object that we update automatically; for example by creating in the __init) ₍aclass BodyObs def __init __ (self, obj).. . obj.addProperty ("App :: PropertyLink", "BodyLink") then defining thisproperty BodyLink to point it to the object you want to spy on, with for example: fp = App.ActiveDocument.addObject (" Part :: FeaturePython "," BodyObs ") BodyObserver (fp) fp.ViewObject.Proxy = 0 fp.BodyLink = App.ActiveDocument.getObject ('Box') But this has the disadvantage of not updating when the 'we use the up and down arrows to position the spied object: we must wait to change lines. ✔ To correct the previous problem, we can use class DocObs: def slotChangedObject (self, obj, prop): print ("slotChangedObject: {} - {} = {}" .format (obj, prop, getattr (obj, prop)) ) def slotBeforeChangeObject (self, obj, prop): print ("slotBeforeChangeObject: {} - {} = {}" .format (obj, prop, getattr (obj, prop))) do = DocObs () App.addDocumentObserver (do ) # App.removeDocumentObserver (do) Warning it is not for nothing that he put a remove because it seems that the functions are accumulating! ✔ He also gave me two references App document observer and Gui document observer

https://forum.freecadweb.org/viewtopic.php?f=22&t=50756&p=435898&hilit=contact#p4

35898

https://forum.freecadweb.org/viewtopic.php?f=18&t=45330&p=388218&hilit=18contact#p3

88218&hilit=18contact#p388218

https://forum.freecadweb.org/viewtopic.php?f=18&t=45330&p=388218&hilit=contact#p388

218

Back to Table of Contents p. 58 03/19/21 (6:36))

See also what concerns the BoundingBox We changed: https://forum.freecadweb.org/viewtopic.php?f=22&t=39106 https://forum.freecadweb.org/viewtopic.php?t=48182&p=41313 6 https://wiki.freecadweb.org/FeaturePython_methods https://wiki.freecadweb.org/Scripted_objects https://wiki.freecadweb.org/Property_editor

https://wiki.freecadweb.org/Swept-path_Analysis_GSoC_Project https://forum.freecadweb.org/viewtopic.php?f = 22 & t = 12426

https://forum.freecadweb.org/viewtopic.php?f=8&t=9029 https://www.youtube.com/watch?v=RrhAD585WIw

OpenCascade with Python https://www.progmodcon.com/quick-tutorial-for-getting-started- withpythonocc/ https://wiki.freecadweb.org/OpenCASCADE

Interesting program lines in https://github.com/FreeCAD/FreeCAD-

macros/blob/master/Utility/HighlightCommon.FCMacro https://forum.freecadweb.org/

viewtopic.php? f = 18 & p = 340874 # p340494

V.7. Bulk

A great presentation of Git and GitHub and another interesting one (regarding the collaboration with several)

A page to reread (Clerget aircraft engine) if I have the time… and also this one

Back to Table of Contents p. 59 03/19/21 (6:36))

Write Python code correctly (Found on the forum See where to put this ???) ✔ See https://github.com/apps/lgtm-com (which allows to verify python code ??) The previous documents are a bit too technical, so I prefer nicer documents that explain them ✔ How to Write Beautiful Python Code

With PEP ✔ Documenting Python Code: A Complete Guide

See possibly python profiler which should allow to analyze the Python code ✔ ✔ To analyze objects and sub-objects in Pyhton ✔ getSubObject () by default return a Shape of the object. To return the object, add an extra argument retType = 1. Checkout the docstring of getSubObject () to find out more details. To obtain the linked object, you can use obj.getLinkedObject (). This function is available in all types of document object, it will recursively resolve to a non-link type object if it is a link. However, if the object is not a link, it will return itself. Checkout docstring of getLinkedObject () to find out more options. ✔ Macro: TreeToAsci i To expand the entire tree

VI. Using Windows in FreeCAD With FreeCAD, all use of buttons and other graphics goes through PySide, or better still PySide2, which provides an interface to thegraphics library Qt. ✔ For a general introduction to QT see the next section “Qt graphical environment” ✔ But with some knowledge of object oriented programming, we can also start directly with the section ???

VI.1. QT graphical environment ✔ With PySide, we mainly use object oriented programming (OOP): to obtain a window, we generally start by defining a class and then create an object of this class. If necessary, see references in the section “Using classes”. ✔ Thepage beginner-level examples gives two examples that you can copy paste into the Python console to get a first idea. But beware of the last example : • it was written intime Python2's, so you have to add () to the print ; • it is necessary to create routine2, .., routine5 on the model of routine1, if not errors. ✔ On thepage intermediate level examples, you can find other examples to look at, but especially see the "Good practices" part before embarking on their study. ✔ For a precise reference of the Widgets used in a window, we can refer to:

Back to Table of Contents p. 60 03/19/21 (6:36))

• this page for the different usable types, • this other page which talks about the grid layout (the simplest in my opinion); • finally thepage PyQt Quick Guide, which is interesting for searching for a given class. Be careful as these pages (and more generally this whole PyQt tutorial) concerns the use of Qt in a framework that is not that of FreeCAD, each program starts with: app = QtGui.Qapplication (sys.argv) Delete this line qu 'especially not to be used with FreeCAD ! ✔ In this article (see also here) we see how to create a grid with Qt_ Qt_Creator (Qt-Design) ; we can then use it directly with afile .ui without converting it to Python.

VI.2. Good practices Inspired by this forum post (for the line numbers he talks about see the file) or this exchange, full of lessons, I concluded the following. ✔ The PySide Intermediate Templates are not really programmed, and must avoid following like them method using QDialog crude+ StayOnTopHint + instantiation without parent + call with exec,because it has the following disadvantages: • the dialog window is positioned in front all open windows, even those not dependent on FreeCAD ; • the dialog appears as an additional window in the OS task bar; • the dialog is not linked to thewindow FreeCAD, and therefore will not be destroyed if FreeCAD is closed; and if severalinstances FreeCAD are open, we don't know which one opened it: • The StayOnTopHint does not work on all OS. ✔ Its author recommends instead to do as in this example or in this macro. • the dialog class from InheritQtGui.QDialog and instantiate it with FreeCADGui.getMainWindow () as parent QtCore.Qt.Tool as WindowFlag by writing: class GDMLColourMap (QtGui.QDialog): def __init __ (self): super (GDMLColourMap, self) .__ init __ (Gui.getMainWindow (), QtCore.Qt.Tool) self.initUI () • Bring up the dialog by calling show () rather than exec () To understand the difference, see this page, this one or this page last. Preferably do not put this show (), or this exec) ₍ , in thefunction __init__, but rather after creating the widget.

Back to Table of Contents p. 61 03/19/21 (6:36))

• If there is no interest in the dialog remaining loaded after closing, the memory can be freed by setting it theattribute WA_DeleteOnClose (see this page) • You can find here and on the corresponding page , more precise information on the previous parameters, Qt :: Dialog, QT :: Tool and WA_DeleteOnClose ; see in particular why giving them a parent is important in this case. • About Windows Flags ✔ For the window layout • it is better to use the layouts, for example a QGridLayout like in this example where it is easy to understand how it works. • The use of addWidget (QWidget, int r, int c, int rowspan, int columnspan) allows to use several cells to put a field longer than the others. • For the font used, we can createonce newFontand then use it for all the widgets. But there is a smarter way to go: change thedialog only once self.setFont and it will be propagated to all the child widgets.

Other programming remarks seen in this post ✔ Avoid try execpt • favor other test possibilities, such as existence of properties, selections, etc. ; • if you have to use them, you must always specify the type of error you expect to find, for example except KeyError: blabla '. ✔ When the window is not modal, be careful of whatworth ActiveDocument is when using it: the user of the file may have changed the document in the meantime. For example, when making a selection, it is better to use doc = selobj.Document. ✔ To do a "toggle" on a boolean, for example self.MakeFillet • the most obvious is to do self.MakeFillet = not self.MakeFillet ; • But there is more clever: the 'signalclicked'used to call the function emits the state of the checkbox. So you just have to write: (??? to test ???) def onCheckbox1 (self, state): self.MakeFillet = state To put a window in modal mode self.setWindowModality (QtCore.Qt.ApplicationModal)

An interesting remark concerning the garbage collection, which throws away what no longer seems necessary!

✔ A guitar with a multi-tab dialog box

Back to Table of Contents p. 62 03/19/21 (6:36))

✔ https://forum.freecadweb.org/viewtopic.php?t=11801 for getStandardButtons (self): ✔ edit OK and Cance buttons l

SEE THIS TIP ??????????????

To reload a module

# test.FCMacro # - * - coding: utf-8 - * -

if sys.modules .__ contains __ ("MyModule"): del sys.modules ["MyModule"] import MyModule

# Using the MyModulemodule VI. 3. Creating a dialog window In fact, there are the windows which are simple widgets and which will be displayed anywhere you want the windows which will be displayed in the task panel

VI.3 .a Simple windows (????) I don't know whether to keep the following ??????????????? ,, In the vocx post on this pagewe find a very simple example which allows you to build simple dialog windows (which avoids going through QtDesigner and afile ui). But you have to keep this kind of thing for simple cases.

class CustomTaskPanel (QtGui.QWidget): def __init __ (self): self.base = QtGui.QWidget () # ?? It seems to work by just putting self.form = self.base # self.form = QtGui.QWidget () label = QtGui.QLabel (self.form) label.setText ("something") def getStandardButtons (self) : return int (QtGui.QDialogButtonBox.Cancel) | int (QtGui.QDialogButtonBox.Ok) | int (QtGui.QDialogButtonBox.Apply) def clicked

Back to Table of Contents p. 63 03/19/21 (6:36))

(self, bt): if bt == QtGui.QDialogButtonBox.Apply: print ("Apply") def accept (self): print ("Accept") self.finish () def reject (self): print ("Reject") self.finish () def finish (self): Gui.Control.closeDialog () # Gui.ActiveDocument.resetEdit ()

Gui.Control.showDialog (CustomTaskPanel ())

in https: //wiki.freecadweb.org/Manual:Creating_interface_tools we find Once we have our BoxTaskPanel that has 1- a widget called "self.form" and 2- if needed, accept and reject functions, we can open the task panel with it, which is done with these two last lines: panel = BoxTaskPanel () FreeCADGui.Control.showDialog (panel)

It's in thisfile TaskDialogPython.cpp (which I found while searching for SowDialog in the GitHub https://github.com / FreeCAD / FreeCAD) that I vaguely understood why the widget that we send to ShowDialog must contain a widget called "form". Indeed we see that ShowDialog calls TaskDialogPython () and it is this last method which tests if there is a "form" attribute in the object.

Back to Table of Contents p. 64 03/19/21 (6:36))

VI.4. Widgets, QmainWindow and QDialog From this presentation of Widgets and from this page I have drawn the following. ✔ Widgets are basic blocks for graphical user interfaces(GUI) ✔ Each component GUI (button, label, input) is a widget that is placed inside a window, which is itself a separate window. Each type of widget is derived from theclass QWidget, which itself inherits from theclass QObject. ✔ QWidget is not an abstract class and can be used as a container for other widgets. From this class, we can easily derive other custom classes. ✔ QWidget allows you to create a window inside which you can place other widgets. ✔ As a QObject, each QWidget can be created with a parent who is then its owner; this ensures that the window is displayed inside its parent's area and that it will be destroyed when the parent is closed. ✔ A widget that is not embedded in another parent widget is called a window. • It is usually of type QMainWindow or of a class inherited from Qdialog. • Such a window is generally provided with a frame and a title bar. • It is associated with an icon in the task bar. ✔ There is normally a single application of thetype QmainWindow which produces the general framework with possibly toolbar, menu bar, status bar, etc. ✔ In this main window, there are secondary windows of the type (inherited from) Qdialog, which, as their name suggests, allow you to dialogue with the user. VI.5. To sort

See some macros

How to stop an animation launched with a timer

It is on this page (even if it deals with the use of FreeCAD in other applications) that I found the function getMainWindow (), or more precisely Gui.getMainWindow (), which returns the main window of FreeCAD . ✔ I was then able to retrieve its geometry (), which gives its position as well as its size. This is very useful when using two screens to be sure that the window you open will be in the same area as thewindow FreeCAD.

Back to Table of Contents p. 65 03/19/21 (6:36))

✔ At first I tried QtGui.getMainWindow (), as shown on the page, but it didn't work: for now, I still don't see the difference between Gui and QtGui. ✔ I also found the use of metaObject (). ClassName () : I have the impression that testing its equality with "Gui :: View3DInventor" allows us to know if we are dealing with a representation window of 'aobject FreeCAD. ✔ There is also the use of childs and findChildren (QtGui.QmainWindow) (to find all the children of a window ???)

On this page, some details about the geometry of a window (dimensions and position): There arein Qt two types of functions: ✔ those that include the window frame: x (), y (), frameGeometry (, pos () and move () . ✔ those that exclude the window frame: geometry (), width (), height (), rect () and size () .

Sketch constraints https://wiki.freecadweb.org/Sketcher_ConstrainCoincident/en

On the mouse position https://stackoverflow.com/questions/52429399/pyside2-how-to-get-mouse- position For the global window ww = Gui.getMainWindow () ww.geometry ()

For the active window ww = doc .ActiveView ww.getSize (): gives the size getCursorPos () returns the position of the mouse 03/19/21 (18:36)

VII. FEM workshop

Back to Table of Contents p. 66 03/19/21 (6:36))

https://wiki.freecadweb.org/FEM_ConstraintContact

General presentation https://forum.freecadweb.org/viewtopic.php?t=37162 The official page An Example of a house with a roof loaded An Example of torision in a video in German https://www.youtube.com/watch?v=Y9l1zYnMj4g (German) https://www.youtube.com/watch?v=dhrynRdBOIg

Plenty of references on this page

Review create Task Panel on this page

Back to Table of Contents p. 67 03/19/21 (6:36))

Back to Table of Contents p. 68

VIII. Bulk

How to build a wireframe A story of pulleys and belt length (interesting, must see)

See https://wiki.freecadweb.org/OpenSCAD_Module/en

A long discussion on Links in the forums

About documentation of Pyhton scripts / projects (especially docstrings)

In this forum post we talk about functions allowing to detect missing or non-coincident points skt.detectMissingPointOnPointConstraints () skt. makeMissingPointOnPointCoincident ()

See general description of Part_Feature objects which branch in particular on this page of the forum and that one in French where we talk aboutproblemsAngular deflection.

See function allowing to transform a Face into Sketch

An example of Maltese Cross with Fusion

In FreeCAD there is a pyramids and polyhers workshop

Link and clone https://forum.freecadweb.org/viewtopic.php?t=6662 ???? A very interesting discussion on the fact that one cannot create a PartDEsign Body from a sketch link

https://www.youtube.com/watch?v=3VSIDv2x8tY (screw and nut BA BA) On the site https://wayofwood.com we find some interesting videos with FreeCAD 0.19 ✔ First to make a benchdog (use of the Part workshop) ✔ Then to make a model to make mortises (use of the PartDesign workshop)

Back to Table of Contents p. 68 03/19/21 (6:36))

Review everything what is below this video

https://www.youtube.com/watch?v=0Mz6o9sqde4

https://www.dailymotion.com/video/x4q9ffg (nice piece)

How to arrange the shapes to cut

How to make text from an image

Make a sweep along a curve

The tutorials can be interesting in French on tracing, cutting and engraving.

We find on this page some interesting remarks on engraving and cutting mode with a deliberately out of adjustment Z-set.

Make a "drawing" of your 3D object with Freecad 17 (cut ???) Write on a cylindrical object (cup, ring ...) See

Pyflow ?????

On the page concerning the parameterized objects, there are references to: ✔ an interesting page on the property editor ; we see as an example the explanation of the view and data properties of aobject Part_Design ; ✔ a page explaining how to create objects by script (python) and especially giving the list of possible properties; ✔ a page explaining the positioning of objects in FreeCAD; ✔ finally a page on the activation of the dependency graph .

The DAG view is a new tool to better see the relationships between objects.

Back to Table of Contents p. 69 03/19/21 (6:36))

✔ Also possibly see this page, but maybe it's older ??? ✔ A forum page explaining the DAG. ✔ Compare with dependency graph ??? ✔ https://wiki.freecadweb.org/Feature_editing https://forum.freecadweb.org/viewtopic.php?t=14409 https://forum.freecadweb.org/viewtopic.php?t=40731

An interesting discussion on Placement and Attachment of a sketch, See also https://wiki.freecadweb.org/Std_TreeSyncPlacement ??? The official doc on Attachment and Placement https://wiki.freecadweb.org/Tasks_Placement How to reposition a sketch https://wiki.freecadweb.org/PartDesign_CoordinateSystem https://www.freecad.info/index.php/2020/07/01/part-design-map-a-sketch-to-a-face/

Interesting forum post on MapMode and the list of MapMode vamleurs

A video to build a 3rd hand with Assembly (silent?) Review

https://www.youtube.com/watch?v=qoutY6HQyBY ????

See this research this research

https://duckduckgo.com/?q=freecad+datum+plane+vs+shapebinder&atb=v204-1__&ia=web

https://www.youtube.com/channel/UCoe3BcVuLC9I2_yFud5vp8Q/videos

VIII.1. The LaserCutInterlocking workshop (blah?) ✔ Thanks to themenu , I was able to install the externalworkshop Interlocking laser cut workbench which allows to easily manage the creation of boxes for laser cutters.

Back to Table of Contents p. 70 03/19/21 (6:36))

✔ Then, I followed this video which we find the corresponding text on this page. But I did not see the possibility of setting up with a spreadsheet. ✔ One can also view this page ✔ Another use of Laser Cut Interlocking and 2 Assembly and workshop Path

My Settings Vokoscreen Micro Audio Analog StereoInternet MixerPusle: Pérriphérique Input / microphone (about 45%)

Back to Table of Contents p. 71