I am starting out with Part scripting but I am confused by what the differences are between geometry and topology. I have searched for explanations in the forum and wiki but could not find anything.
Also how do vectors relate to geometry and topology? I know what a vector is mathematically but how does it fit in in this context.
I would be thankful for any input.
Sincerely,
Aleksander
Part Scripting: Geometry vs Topology
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Part Scripting: Geometry vs Topology
FreeCAD als Maschinenbauer in die Konstruktion und Fertigung integrieren. Schulung buchen: www.alsado.de/freecad-schulungen
-
- Posts: 326
- Joined: Tue May 28, 2019 10:51 am
Re: Part Scripting: Geometry vs Topology
This link is for Part WB, but I think is still relevant to introduce some of the concepts.
Re: Part Scripting: Geometry vs Topology
-Chris_GThere are 2 different groups of entities : geometry and topology.
Geometry entities are mathematical objects, like vectors, curves (bspline, bezier, circle, ellipse, line, etc) and surfaces (cone, cylinder, plane, bspline surface, etc)
They are invisible objects.
Part.Curve is the parent class of all the curves.
On the other hand, what you see in the 3D view are topology objects, like vertexes, edges, faces.
Vertexes, edges, faces are created on top of geometry objects.
The parent class of the topology objects is Shape.
There are also some aggregation of these 3 base types, like wires, compounds, shells, solids, compsolids.
Depending on your needs, you will work at the geometry level, or the topology level.
geom_object.toShape() is handy for converting a geometry obj to topology.
I think this is a good explanation. Something like this should be added to the wiki on the part scriptng or the topology page.
FreeCAD als Maschinenbauer in die Konstruktion und Fertigung integrieren. Schulung buchen: www.alsado.de/freecad-schulungen
Re: Part Scripting: Geometry vs Topology
While
https://de.slideshare.net/adankevich/ca ... try-basics
explains what geometry and topology are, i still dont understand when you would use one or the other.
Or formulated differently:
Would it be possible to only use topology objects when creatig shapes?
https://de.slideshare.net/adankevich/ca ... try-basics
explains what geometry and topology are, i still dont understand when you would use one or the other.
Or formulated differently:
Would it be possible to only use topology objects when creatig shapes?
FreeCAD als Maschinenbauer in die Konstruktion und Fertigung integrieren. Schulung buchen: www.alsado.de/freecad-schulungen
Re: Part Scripting: Geometry vs Topology
The Part.makeSomething() functions will return a topological shape directly.
Code: Select all
[name for name in dir(Part) if "make" in name]
You can try work with these ones, and you'll see if you need the more low-level geometry functions.['makeBox', 'makeCircle', 'makeCompound', 'makeCone', 'makeCylinder', 'makeFace', 'makeFilledFace', 'makeHelix', 'makeLine', 'makeLoft', 'makeLongHelix', 'makePlane', 'makePolygon', 'makeRevolution', 'makeRuledSurface', 'makeShell', 'makeShellFromWires', 'makeSolid', 'makeSphere', 'makeSplitShape', 'makeSweepSurface', 'makeThread', 'makeTorus', 'makeTube', 'makeWedge', 'makeWireString']
Re: Part Scripting: Geometry vs Topology
FreeCAD als Maschinenbauer in die Konstruktion und Fertigung integrieren. Schulung buchen: www.alsado.de/freecad-schulungen
Re: Part Scripting: Geometry vs Topology
I'm using scripting very often, you will see that you will be using both costruct, as many times you have to access some low level information.
So better to know better both ways.
Part.make...
Are very useful, one of the most useful in my opinion is Part.makePolygon.
Regards
Carlo D.
So better to know better both ways.
Part.make...
Are very useful, one of the most useful in my opinion is Part.makePolygon.
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/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/