I'm using FreeCAD V0.20 for creating geometry for FEA. My workflow now is to use FreeCAD to create the geometry and then I export to BREP format. I then read in the file and create the mesh using Gmsh. The mesh is then imported and used by the FEA software. The issue that I've encountered is that the length units for the FEA software are "m". Gmsh does not have units so it does nothing to the scaling of geometry. FreeCAD seems to be exporting everything in the default units of "mm". So far I haven't found a way for this workflow to get the right FEA units without making the incorrect geometry in FreeCAD first (I have to scale everything down by a factor of 1000 in order to get the right exported geometry so something that is 1 m in my geometry would have to be created as 1 mm in FreeCAD).
I've searched to see if there are solutions to this but so far I haven't found any. Changing the document units in preferences doesn't seem to change the export units. I'm wondering if I've missed something? Is there a workflow where I can create the correct geometry in FreeCAD and get an export in units of "m"? Thanks.
How to export with different units?
Moderator: bernd
Forum rules
and Helpful information for the FEM forum
and Helpful information for the FEM forum
-
- Posts: 2
- Joined: Sun Oct 23, 2022 6:51 pm
Re: How to export with different units?
Mod edit: Moved to FEM subforum
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: How to export with different units?
Try changing the "Units for export of STEP" (assuming that you will use this most common universal CAD format) in Preferences —> Import-Export.
Re: How to export with different units?
In STEP this seam to work, but with STEP you might loose information. AFAIK STEP does not support CompSolids. For BREP export I am not aware of a solution in the gui.
But with python it should be just a few lines of code to scale and export a objekt. This could be copied in a macro and given an icon and you are fine ...
But with python it should be just a few lines of code to scale and export a objekt. This could be copied in a macro and given an icon and you are fine ...
Re: How to export with different units?
Code: Select all
# create some geometry to have something to export
import Part
box = Part.makeBox(10,10,10)
#
from os.path import join
the_path = "C:/Users/BHA/Desktop"
#
box.exportBrep(join(the_path, "box_mm.brep"))
box.scale(1000).exportBrep(join(the_path, "box_m.brep"))
-
- Posts: 2
- Joined: Sun Oct 23, 2022 6:51 pm
Re: How to export with different units?
Thanks. I had previously tried this setting and generated STEP files for importing to Gmsh. When I tried this out I had found that the units setting for STEP export was not having any impact on the resulting geometry imported into Gmsh. At the time I was under the impression that Gmsh was unit-less in the treatment of geometry but, after reviewing the generated STEP files, it seems that they are indeed different when created with the different export options and that Gmsh is doing some conversion on import depending on the unit description in the STEP files. So I think the STEP file with the "m" export option will work for me after I set the correct Gmsh option. Thanks very much.
Re: How to export with different units?
Keep in mind ... Step does not support compsolids