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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

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

randress
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:

Cylinder constructed in FEATool and exported as STEP to Gmsh

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

Reply | Threaded
Open this post in threaded view
|

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

Precise Simulation
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.
Reply | Threaded
Open this post in threaded view
|

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

randress
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.stp

Here is the file that was exported by gmsh after being modified:

cylinder_slice_XYZ.step

If 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.geo

Again, 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



Reply | Threaded
Open this post in threaded view
|

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

Precise Simulation
Administrator
randress wrote
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.

Reply | Threaded
Open this post in threaded view
|

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

randress
This post was updated on .
Precise Simulation wrote
randress wrote
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.
Hmmm... Ok. Thanks for checking.  I suppose the solid designation must have been removed by gmsh... because the same file that was imported to gmsh "cylinder.stp" (attached to previous msg) can be successfully imported by FEATool without error.... does this sound reasonable, that the solid designation disappeared that way after being imported to gmsh?

I repeated the test using Fustion 360: imported cylinder.stp to F360, split it and exported it to:

cylinder-split-F360_v1.step

..... and it was imported without error by FEATool, meshed, solved and post processed.

[Edit: However, when I looked more carefully, the solution did not make sense:
cylinder_splitF360_solved.png
end Edit 5/10/2020]

How can I "look" at these files: "cylinder-split-F360_v1.step" and "cylinder_slice_XYZ.step" to see that one has solid components and the other does not?

randress wrote
Of course, you could just add the cutplane capability to FEATool :-)
Precise Simulation wrote
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.
Thanks for the work flow outline.  I'll give that a try and compare it to the Fusion 360 result.  That would really be best.... If I could just split any model, whether or not the geometry was created by FEATool or imported from a STEP file, using only FEATool geometry tools.  

In general, if I have a STEP file that I wish to import to FEATool geometry, how can I check it (view it?) to see if it is suitable: solid that is water-tight? Other requirements?

Kind regards,
-Randal
Reply | Threaded
Open this post in threaded view
|

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

randress
randress" wrote
Of course, you could just add the cutplane capability to FEATool :-)
Precise Simulation wrote
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.
Thanks for the work flow outline.  I'll give that a try and compare it to the Fusion 360 result.  That would really be best.... If I could just split any model, whether or not the geometry was created by FEATool or imported from a STEP file, using only FEATool geometry tools.  
I think I did what you suggested:
1. Copied C1 inplace creating C2.

2. Created a block, B1, that has a face in the place of the cut and that extends beyond the model boundaries in all 5 other directions. I duplicated B1, creating TF1, and moved it so that it has a side that coincides with the cut plane location.  

3. Then C1-B1 and then C2-TF1.

4. That left CS1 and CS2 which share a face that is the cut plane!



I placed 10V on one end and 0V on the other, 0 current density on the other outer surfaces and continuity on the shared/face/cut-plane. Here is the resultant plots of V:



...and a countour plot from export of fea to Matlab:



This looks really good for the cut-plane functionality.

Thanks for your help.

Kind regards,
Randal