How do I create 3D mesh from multiple .stl files?

The graphical user interface of Elmer
Post Reply
Steve
Posts: 1
Joined: 20 May 2010, 04:38

How do I create 3D mesh from multiple .stl files?

Post by Steve »

I'm trying to calculate capacitance of a "fringe capacitor" used in analog integrated circuits.

I added code to the IC layout software I'm working on that allows me to select all the 2D shapes for each "plate" of the capacitor and generate '.stl' files that are effectively extrusions of the 2D layout shapes. I also generate and enclosing 3D box -- 'box.stl'.

I'm using brl-cad 'stl-g' and 'mged' to unite all of the stl solids for each capacitor plate into single .stl solids, 'x0.stl' and 'x1.stl'. I use a script:

Code: Select all

stl-g ../dump0.stl dump0.g
cat <<END | mged -c dump0.g
r x0.r u all;
keep x0.g x0.r;
quit;
END
g-stl -o x0.stl x0.g x0.r

stl-g ../dump1.stl dump1.g
cat <<END | mged -c dump1.g
r x1.r u all;
keep x1.g x1.r;
quit;
END
g-stl -o x1.stl x1.g x1.r
I'm trying to generate a volume mesh defined by the enclosing box with holes defined by x0 and x1. This is easily accomplished with gmsh using the following command file:

Code: Select all

Merge "box.stl";
Merge "x0.stl";
Merge "x1.stl";
Surface Loop (3) = { 1 };
Surface Loop (4) = { 2 };
Surface Loop (5) = { 3 };
Volume (6) = { 3, 4, 5 };
Physical Surface(1)={1};
Physical Surface(2)={2};
Physical Surface(3)={3};
Physical Volume(1)={6};
The key here is the 'Volume' statement -- it generates a volume bounded by "box" with voids bounded by "x0" and "x1".

Is there any way to get this type of behaviour using ElmerGrid/ElmerGUI? It seems to generate better meshes than Gmsh.

... or is there a way to get a better mesh out of Gmsh?
Post Reply