Parametric file format

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
keithsloan52
Veteran
Posts: 2764
Joined: Mon Feb 27, 2012 5:31 pm

Re: Parametric file format

Post by keithsloan52 »

adrianinsaval wrote: Sat Aug 07, 2021 6:10 am is it really parametric? I thought it was more like an stp file, not a mesh but not parametric either
It has the parameters, as in variables that make up the shapes, a step file just has the shapes.
User avatar
Zolko
Veteran
Posts: 2213
Joined: Mon Dec 17, 2018 10:02 am

Re: Parametric file format

Post by Zolko »

xryl669 wrote: Sat Aug 07, 2021 7:16 am When I was writing parametric CAD, I was more thinking about the way Solidwork and FreeCAD interprets parametric, not the way Rhino does, that is sketch with constraints based on some dynamic value, then applying functions on it (like pad /pocket / revolve / loft etc) and then getting solid that can be combined (boolean) to make a part.
There are 2 things here:

  • The history of the creation, which is parametric as in "you can change the length of a pad", and corresponds more-or-less to the model tree. This is stored (for FreeCAD) in a XML file
  • The resulting geometry, which is not parametric, as in "this is the result of the creation", and is similar to STEP. This is stored (for FreeCAD) as BRP files
What you would want is an open standard for History and Geometry files: there isn't a chance in Hell that the proprietary vendors will want to go in this direction, so as well stick with the open FreeCAD format (and refine it if necessary) : if/when FreeCAD has conquered the CAD world, this will become the de-facto open standard that you wish for.
try the Assembly4 workbench for FreCAD — tutorials here and here
User avatar
onekk
Veteran
Posts: 6199
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Parametric file format

Post by onekk »

If you start from an STL you will have to guess how the "triangular mesh" that is in the file was created.

STL is a mesh format that is holding only vertexes of the tringles, so if the circle is translates in an hexagon or the hexagon is the original shape in STL you have no clue about it.

This is the main problem when dealing with meshes.

FreeCAD use a different paradigm and not all the brp files in the "FCStd" container could be rebuild from scratch, as some are generated to stay here and no "primitives" are stored in the Document.XML file in the FCstd file.

It would be possible to do some parsing of the Document.XML file and see if the brp file, but has a proper FCStd file format explanation are not around (from my knowledge) it is not trivial to do so, maybe asking for some infomration to some people, that know the format better would be an idea.

Asking for a FCStd format documentation would be a more "On topic" title and maybe will lead to some interaction from the "few" people that know better this matter.

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/
xryl669
Posts: 32
Joined: Fri Jul 31, 2020 1:19 pm

Re: Parametric file format

Post by xryl669 »

I've started to document the file format here since I wasn't able to find any documentation anywhere. Feel free to correct any issue I've missed in my preliminary documentation.

In my Parametizer tool I'm parsing a STL model and try to rebuild an actual parametric geometry out of it. Right now, it's only exporting sketches built from model's sides (with some heuristics to find out the arcs and circles from a polygon) with the constrains it's deducing along the way.

I intend to export to a FreeCAD's FCStd format too so it'll help rebuild the model in a parametric way.

The FCStd file format is not the panacea since it's very specific to the inner working of FreeCAD (like the type attributes of the object are actual C++ types) but at least it's open if not standard.
Post Reply