I am trying to build a 3D model using FreeCAD Python software to simulate heat transfer through a material. I am currently trying to create a mesh to simulate a homogenous cube just to make sure it all works. I need to download the FreeCAD module to make the line 'from FreeCAD import Base, newDocument' work. I have tried typing 'conda install FreeCAD' into my Terminal shell, but the response is that there are 'conflicts'. How else can the FreeCAD Python module be installed?
The ultimate goal is to produce a mesh that is in a format compatible with SfePy software.
Here is the code I am trying to run:
import sys
FREECADPATH = '/usr/lib/freecad/lib/'
sys.path.append(FREECADPATH)
from FreeCAD import Base, newDocument
import Part
import Draft
import ProfileLib.RegularPolygon as Poly
doc = newDocument()
box = doc.addObject("Part::Box", "myBox")
box.Height = 5
box.Length = 5
box.Width = 5
doc.recompute()
Part.export(box, 'box.step')
doc.saveAs('box.FCStd')
import MeshPart
mesh = doc.addObject("Mesh::Feature", "Mesh")
mesh.Mesh = MeshPart.meshFromShape(Shape=box.box, MaxLength=0.002)
mesh.Mesh.write("./cube.bdf", "NAS", "mesh")
Thanks in advance.