[Gmsh] Adding a boundary surface on a STL model

Dimitrios Stoupis dstoupis at auth.gr
Sun May 17 15:00:56 CEST 2020


I want to run brain simulations with models from the PHM repository
(not relevant to the problem but suits the narrative) which are
shipped in STL format. The meshes of the STL have been fixed using
MeshFix and the attached .geo file has been used to generate the 3D

[file: brain_mesh.geo]

The script successfully meshes the model and the generated mesh is
correct. The problem is how can I add electrodes on the head
(cylindrical volumes) so that later I use those as the boundary
surfaces to add the boundary conditions in the FEM solver.

I have tried creating a cylinder and applying boolean operation with
the STL, but obviously this did not work. How can I create such a
thing on the STL surface? There is no CAD available just the STL
files. For copyright reasons I am not able to share the STL, but I
will try to illustrate below the problem using a sphere in paint.

[image: electrode.png]

I want the electrode (red volume) to be tangent with the surface of
the skin (black sphere). The black sphere is only in STL format.
Triangle position problem

Finally the next problem that will arise is how can I get the
individual triangle positions on the STL surface through the file in
order to be able and add the electrode perpendicular to the surface
and to the right spot, without doing trial and error work to find the

Thank you!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: brain_mesh.geo
Type: application/octet-stream
Size: 1096 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20200517/46b4d0c3/attachment.geo>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: electrode.png
Type: image/png
Size: 7348 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20200517/46b4d0c3/attachment.png>

More information about the gmsh mailing list