# Export of STEP geometry to Gmsh, cut with plane and re-import STEP

6 messages
Open this post in threaded view
|

## Export of STEP geometry to Gmsh, cut with plane and re-import STEP

 Picking up with the last post in Basic thread: "Integration of Current Density over Slice Intersection"  ( http://forum.featool.com/Integration-of-Current-Density-over-Slice-Intersection-tp180p182.html ) ... Precise Simulation wrote Boundary integration is only available on defined (external and internal) boundaries (not general cut planes). So in your case you would have to split the cylinders in half (or at the plane you want to perform the boundary integration). ... randress wrote ...I still have not figured out how to do the integration over the slice intersection. While constructing these integration surfaces into models as you suggest is certainly a good way to make an internal boundary where I want to do the integration.  However, there may be times when this is not possible (model was imported) or convenient - the desired location of the integration plane may not be known until a complex model is already built, meshed, and solved. I seem to remember (though I cannot recall just where) someone suggesting that I could export the geometry via a STEP file and import it in Gmsh where it could be sliced and then exported and imported back to FEATool. So I am trying it. I built a simple model consisting of a single cylinder, exported it as a STEP file, and then imported it back to FEATool with no problem: I then imported the STEP file in Gmsh (using modified tutorial script t20.geo) and applied an YZ plane slice at x=0.5: . I then exported the modified geometry as a STEP file. And attempted to import it into FEATool, but got this error: Matlab command window had: Warning: Geomtool system call returned error, IER = 2 Should this have worked? If so, what could be my problem? Kind Regards, -Randal
Open this post in threaded view
|

## Re: Export of STEP geometry to Gmsh, cut with plane and re-import STEP

 Administrator The error message indicates that the geometry engine "Geomtool" failed to import or process your geometry file. I can't really tell what has gone wrong, but as Gmsh is a grid/mesh generator and not a CAD tool, it might be better to try to create your geometry in a dedicated CAD program such as FreeCAD, Fusion 360, etc.
Open this post in threaded view
|

## Re: Export of STEP geometry to Gmsh, cut with plane and re-import STEP

 This post was updated on . Precise Simulation wrote The error message indicates that the geometry engine "Geomtool" failed to import or process your geometry file. I can't really tell what has gone wrong, but as Gmsh is a grid/mesh generator and not a CAD tool, it might be better to try to create your geometry in a dedicated CAD program such as FreeCAD, Fusion 360, etc. Here is the file exported from FEATool which was then imported into Gmsh (in re-imports to FEATool without error): cylinder.stpHere is the file that was exported by gmsh after being modified: cylinder_slice_XYZ.stepIf this is functionality that you would like FEATool to have/maintain, perhaps you can see what the problem is. BTW, here is the gmsh script that I am developing  based on a recently updated tutorial (t20.geo) that can be used to make a cut, adding an internal boundary. sliceSTEP.geoAgain, I am not looking for a way to build from the ground up a suitable model (one with internal boundaries where they need to be in order to do the surface integration) ... I can do that with FEATool by doing as you suggested in the other thread - just make two small cylinders (for example) that share a face. This works when I am building the model myself (not importing it from elsewhere). What I want, before I begin my FEA work, is to establish a viable work flow that allows me to add a planar boundary/surface to an existing model (or a complex one that I have built but have not placed the pseudo cut-planes in the correct place). I can try the same export-cut-import routine with Fusion 360... Another option might be to keep the model in Gmsh and generate the mesh there and, instead of exporting the STEP, export the .msh which then could be imported into FEATool at the Grid phase.  I can try that also if you think it would work.   However, I have begun to understand how to specify the mesh sizes for subdomains and boundaries using FEATool and I like having that kind of control.  Since FEATool passes this info to gmsh, the same thing has to be possible in gmsh, but I do not know how. Of course, you could just add the cutplane capability to FEATool :-) I'll keep at it. Kind regards, -Randal
Open this post in threaded view
|

## Re: Export of STEP geometry to Gmsh, cut with plane and re-import STEP

 Administrator randress wrote cylinder_slice_XYZ.step The geometry engine in FEATool can currenly only work with complete (and watertight) solid geometry objects, while the Step geometry you are trying to import does not seem to contain any objects defined as solids. randress wrote Of course, you could just add the cutplane capability to FEATool :-) If your desired cutplane is aligned with the x, y, or z axis you should already be able to do this with the existing capabilities, as for example: 1) Make an in-place copy of the object you want to split using the "Copy/Transform Object..." button or menu item. 2) Create two blocks that touch along the plane you want to split, but extend a bit beyond the object in the other 5 directions/planes. 3) Subtract one block from the orginal object, and the other from the copy. 4) You should now be left with two halves of the original object split along the plane where the two blocks touched.