Seeking Intro Guide for Base Principles

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
ManOfScience
Posts: 12
Joined: Fri Jan 21, 2022 4:19 pm

Seeking Intro Guide for Base Principles

Post by ManOfScience »

Does anyone know of a very, very, very concept-level beginners rudimentary overview of the *underlying principles* that FreeCAD models are built on so that I can *figure out* how to do X, rather than memorize steps by rote?


I've been working (on and off) at learning to use FreeCAD for a many years now. Since I retired 2 months ago, I've been working on it concertedly on a daily basis - mostly watching videos and trying to work my way through the documentation. I believe I understand the birds-eye view of how FreeCAD approaches CAD and how it differs from things like AutoCAD, Sketchup, or other Direct-modelling systems that most people are familiar with.

What I have not found is an introduction to or overview of the *very most* basic components of how I should understand and define FreeCAD *objects* like Points, Vertices, Lines, Edges, Faces, Planes, Surfaces, Etc.

For example -
For the last couple weeks, I have been working on drawing a basic 12 or 20-sided platonic solid. In my mind, I can think of them as being made of:
a cloud of points connected, edges with coincident ends, triangles with coincident vertices, triangles with coincident edges. If I really had to, I could imagine them as spheres or cubes (or literally any solid) with faces cut from the outside, but that seems absurd and to imply that FreeCAD would define the material on the inside of a solid on an atomic level rather than as bounded space.

So far, on my icosahedron, I have only succeeded in drawing a single triangle sketch within a (otherwise empty) body. I have not yet figured out how to make it a closed face or plane and I am not sure that the sides of my triangle comprise "Edges" that could become edges in a solid.

I am now desperately seeking some kind of basic introduction to how Faces and Solids are defined in FreeCAD. Are they made of Points, Lines, or other more primitive objects? Because FreeCAD is parametric, I know that they are more correctly made of "Operations", but I have not yet figured out how I can conceive the necessary operation since I don't know what the desired operation output should be.

In my Icosahedron example, I've spent several days trying to convert my triangle sketch to a 2-dimensional face - but now think that 2-dimensional objects may not even make sense in FreeCAD. So I need to learn, for example, what a Cube is made of. I know how to generate a Cube, but I don't know what it is comprised of or how I would make a Cube from scratch without the "Additive Box" tool.

All of the videos I've watched are "How to do X", which are great - but only if I need to do X.
All of the documentation I've read assumes a pre-existing understanding of what is being discussed.
Does anyone know of something that starts at the *Very* beginning?


Sorry for not being more concise. The problem is hard to explain.
chrisb
Veteran
Posts: 53937
Joined: Tue Mar 17, 2015 9:14 am

Re: Seeking Intro Guide for Base Principles

Post by chrisb »

If you are interested in sketching, I have tried to collect some information around the idea if constraints and degrees of freedom, links in my signature. If you are short of time, you don't have to read all of it, because it is always the same idea, coming in different flavours. But it turned out, that even people knowing FreeCAD quite well, found some new information in it.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
drmacro
Veteran
Posts: 8870
Joined: Sun Mar 02, 2014 4:35 pm

Re: Seeking Intro Guide for Base Principles

Post by drmacro »

ManOfScience wrote: Fri Jan 21, 2022 5:29 pm ...
I think your concept of what a solid model is is skewed by your exposure to the other systems you mention.

In FreeCAD, at least for basics, there is no need for the user to create points, lines, and faces. You can, but the idea is to let the system create them.

So, if you select the Sketcher workbench, create a sketch and sketch a 10mm square , then close the sketch. Then select the Part workbench. Then select the sketch and click the extrude tool, and enter 10mm for the length, tick the Create solid box and click OK. The system creates the 6 faces of the cube, the 12 edges, and 8 vertexes that define a 10mm cube.

If you had done the same, but, leave the Create solid un-ticked, you would get 4 faces, the 12 edges, and 8 vertexes that define 4 walls that are 10mm high (and infinitely thin, but rendered as opaque), but, don't represent a solid (there is no top and bottom face).

While both consist of the elements you imagine, there is no need for you to create those elements. And, in general, you need not know these elements are there.

In a sense, the direct modeling is done when you click the ok button in the extrude dialog.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
heda
Veteran
Posts: 1348
Joined: Sat Dec 12, 2015 5:49 pm

Re: Seeking Intro Guide for Base Principles

Post by heda »

or just use fc itself to explore that on your own.

take your sketch and do Draft_Upgrade.
the other way around, make a box and use Draft_Downgrade

both of them can be used multiple consecutive times, it will let you know if it cannot do anything with the object.

other than that, Part_Builder kind of tells the complete story on a lower level.
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Seeking Intro Guide for Base Principles

Post by onekk »

FreeCAD has at least two modelling techniques:

CSG

BREP

if you search on internet you will find information about them.

You could see "Topological data scripting" to have an idea of the basics of BREP (no need to code, but the code organization helps to catch the basics.)

You could also create a solid giving points and create edges, wires and faces, join them in shell and create a solid.


Said so FreeCAD is very flexible and there are many ways to do things, so every answer you have received is correct.

It depends from the point if view, or the tool (or tools) the
user has answered you is used to employ.

to create things that rely in math formulas is not difficult to even code the creation using Scripting, this permit sn elevate flexibikity and a robustness as every error you will made (a part of deleting the script snd have no a backup copy) will be easily corrected.

But this is my personal point of view, so is a biased interpretation.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Seeking Intro Guide for Base Principles

Post by GeneFC »

ManOfScience wrote: Fri Jan 21, 2022 5:29 pm Does anyone know of a very, very, very concept-level beginners rudimentary overview of the *underlying principles* that FreeCAD models are built on so that I can *figure out* how to do X, rather than memorize steps by rote?
There are two improvements I would suggest.

First, forget videos at the start. Some are just plain wrong and all of them go too fast for a beginner. It is almost impossible to catch every nuance. Instead try some of the written tutorials from the FreeCAD wiki.

https://wiki.freecadweb.org/Tutorials

You absolutely must work the selected tutorial(s), not just read them. If something does not seem to behave properly go back and reread and try again.

The written materials linked in drmacro's signature are good for beginners as well.

The other recommendation is to pick something that you want to make with FreeCAD. Tutorials and making icosahedrons only go so far. It will be more useful to have some interest in the game so that you will feel accomplishment when you are done.

And most importantly, don't be afraid to ask for help on the forum.

Gene
ManOfScience
Posts: 12
Joined: Fri Jan 21, 2022 4:19 pm

Re: Seeking Intro Guide for Base Principles

Post by ManOfScience »

These answers are absolute gold - Thanks!

I definitely appreciated the terms CSG & BREP, onekk; it's hard to look up things to read about until you find the right terms.

And, geneFC, I think you are right - I have definitely learned more from the tutorials than the videos. When I watch videos, it typically takes me at least an hour (typically more) to get through 10 minutes of video and a large majority of them are useless because they don't increase the size of the mouse pointer so it's invisible in the video, and then use phrases like "click here" - LOL!

heda; I have been focusing on almost entirely on Part_Builder and might simply lack the intelligence to intuit 'the complete story' it is telling, but I had not looked at Part_Downgrade or Part_Upgrade -they look like them might explain a lot for me. Thanks!

drmacro, I think may have mentioned one of the practical keys I need to solve my understanding - I hadn't seen the "Create Solid" check box that you mentioned! The extrude tools have probably always ticked it for me behind the scenes. Maybe with that, I'll be able to create solids beyond those in the list of additive primitives.

and chrisb, I will certainly check out your notes; I really appreciate folks who try to ease the learning curve for others! Thanks!


Thanks to everyone for your tips!
Back to studying :)
ManOfScience
Posts: 12
Joined: Fri Jan 21, 2022 4:19 pm

Re: Seeking Intro Guide for Base Principles

Post by ManOfScience »

Replying to self in case others might benefit from my learning discoveries...

Just discovered a page that, in hindsight, would have been the ideal *starting page* for someone like me to learn FreeCad.
I had already picked up most of the points explained here through piecemeal induction, but could have saved months (or maybe years) had I started on this page:

https://wiki.freecadweb.org/Feature_editing
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: Seeking Intro Guide for Base Principles

Post by TheMarkster »

For the icosahedron this macro will create the vertices for an icosahedron of side length = 2:

Code: Select all

vertices = []
V = FreeCAD.Vector
phi = (1/2) * (1 + 5 **(1/2))
def addV(x,y,z):
    vertices.append(V(x,y,z))

addV(-0,phi,1)
addV(-0,-phi,1)
addV(0,phi,-1)
addV(0,-phi,-1)
addV(1,-0,phi)
addV(-1,-0,phi)
addV(1,0,-phi)
addV(-1,0,-phi)
addV(phi,1,-0)
addV(-phi,1,-0)
addV(phi,-1,0)
addV(-phi,-1,0)

dots = [Part.Vertex(v) for v in vertices]
compound = Part.makeCompound(dots)
Part.show(compound, "Vertices")
Select the Vertices object in the tree, press Ctrl+Shift+P and enter into the python console:

Code: Select all

obj.ViewObject.PointSize = 12
This will make the points larger and easier to see and select.

Select 3 at a time to make each face and run this macro:

Code: Select all

sel = Gui.Selection.getSelectionEx()
v1,v2,v3 = sel[0].SubObjects
lines = [Part.makeLine(v1.Point,v2.Point), Part.makeLine(v2.Point,v3.Point), Part.makeLine(v3.Point,v1.Point)]
wire = Part.Wire(lines)
face = Part.makeFace(wire,"Part::FaceMakerCheese")
Part.show(face,"face")
Note: After running the face maker macro once you can run it again with Ctrl+Shift+1 or from the recent macros menu.

Install Curves workbench from tools menu -> addon manager -> workbenches.

Select all the Faces in the tree view (should be 20 of them when you are done), and use the Solid creation tool (icon is green cube).
Snip macro screenshot-f9f8cd.png
Snip macro screenshot-f9f8cd.png (66.9 KiB) Viewed 1836 times
edwilliams16
Veteran
Posts: 3112
Joined: Thu Sep 24, 2020 10:31 pm
Location: Hawaii
Contact:

Re: Seeking Intro Guide for Base Principles

Post by edwilliams16 »

I thought I'd try scripting an icosahedron in Part Design. I took a sphere and pocketed away all the faces with Datum Planes which go through the vertices of the dual dodecahedron. I end up with the tree littered with the construction objects.

Code: Select all

#icosahedron
#construct dual of dodecahedron
phi = (1 + 5**0.5)/2
rphi = 1/phi
edgeLength = 2/phi
circumradius = 3**0.5

#make a sphere in a body
doc = App.ActiveDocument
body =doc.addObject('PartDesign::Body','Body')
sphere = doc.addObject('PartDesign::AdditiveSphere','Sphere')
body.addObject(sphere)
sphere.Radius = 2*circumradius
doc.recompute()

#vertices of dodecahedron
V3 = Base.Vector
dVertices = [V3(1, 1, 1), V3(1, 1, -1), V3(1, -1, 1), V3(1, -1, -1),
             V3(-1, 1, 1), V3(-1, 1, -1), V3(-1, -1, 1), V3(-1, -1, -1),
             V3(0, phi, rphi), V3(0, phi, -rphi), V3(0, -phi, rphi), V3(0, -phi, -rphi),
             V3(rphi, 0, phi), V3(rphi, 0, -phi), V3(-rphi, 0, phi), V3(-rphi, 0, -phi),
             V3(phi, rphi, 0), V3(phi, -rphi, 0), V3(-phi, rphi, 0), V3(-phi, -rphi, 0)]

#place cutting planes to make the 20 faces
placements = [App.Placement(v, App.Rotation(App.Vector(0, 0, 1), v)) for v in dVertices ]

for placement in placements:
    dPlane = doc.getObject('Body').newObject('PartDesign::Plane','DatumPlane')
    dPlane.Support = [(doc.getObject('XY_Plane'),'')]
    dPlane.MapMode = 'FlatFace'
    dPlane.AttachmentOffset = placement
    dPlane.Visibility = False
    pocket = doc.getObject('Body').newObject('PartDesign::Pocket','Pocket')
    pocket.Profile = dPlane
    pocket.Type = u"ThroughAll"
    pocket.Reversed = True

doc.recompute()

 

Just open a new file and run the code in the Python console
Screen Shot 2022-02-03 at 11.42.40 AM.png
Screen Shot 2022-02-03 at 11.42.40 AM.png (19.91 KiB) Viewed 1756 times
Post Reply