> On 31 Mar 2020, at 00:15, Bucksot, Jesse Edward <jesse.buck...@utdallas.edu> > wrote: > > Hi all, > > I’m pretty new here. I’ve had good success with gmsh so far, but I just ran > into an issue when extruding surfaces that have been split into multiple > separate regions due to boolean operations. When I just do one extrude, it > seems to come out right, but then if I try to label the extrusion (e.g. > “Physical Volume("part") = {ex1[]};”) or try to extrude again by extruding > ex1[0], it only does one single part of the surface. > Basically, if I take a rectangle and cut it into two smaller rectangles using > BooleanDifference and then extrude it, the created extrusion (ex1[0],ex1[1]) > only contains one of the smaller rectangles and not both of them. > > Does anyone have any solutions or workarounds to this? > Also, my real geometry is pretty complicated, so I’m not sure how feasible it > is for me to manually check for any instances of surfaces being split apart > before extruding. >
To get something conformal you indeed need to extrude the different parts at the same time. Here's how I would do it: SetFactory("OpenCASCADE"); s2858 = news; Rectangle(s2858) = {-1, -1, 0, 2, 2}; s2859 = news; Rectangle(s2859) = {-0.1, -1, 0, 0.2, 2}; bo1[] = BooleanDifference{ Surface{s2858}; Delete; } { Surface{s2859}; }; If(0) // your code ex1[] = Extrude {0,0,1} {Surface{s2859}; Layers{1}; }; ex2[] = Extrude {0,0,1} {Surface{bo1[]}; Layers{1}; }; ex3[] = Extrude {0,0,1} {Surface{ex1[0]}; Layers{1}; }; ex4[] = Extrude {0,0,1} {Surface{ex2[0]}; Layers{1}; }; Physical Volume("tool") = {ex1[1], ex3[1]}; Physical Volume("cut") = {ex2[1], ex4[1]}; Else // new way ex1[] = Extrude {0,0,1} {Surface{s2859,bo1[]}; Layers{10}; }; ex2[] = Extrude {0,0,1} {Surface{ex1[0],ex1[6]}; Layers{10}; }; Physical Volume("tool") = {ex1[1], ex2[1]}; Physical Volume("cut") = {ex1[7], ex2[7]}; EndIf Christophe > > Thanks in advance! > Jesse > <mesh.geo>_______________________________________________ > gmsh mailing list > gmsh@onelab.info > http://onelab.info/mailman/listinfo/gmsh — Prof. Christophe Geuzaine University of Liege, Electrical Engineering and Computer Science http://www.montefiore.ulg.ac.be/~geuzaine _______________________________________________ gmsh mailing list gmsh@onelab.info http://onelab.info/mailman/listinfo/gmsh