<html><head></head><body><div class="ydpbae2769cyahoo-style-wrap" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;"><div style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;"></div>
<div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;">Hi Christiophe,</div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;"><br></div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;">glad to see that this feature has been already formally requested.</div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;"><br></div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;">From my side I have spent some time thinking on how to solve, if possible, this problem with scripting tools only and I came out with the following idea</div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;"><br></div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;">Assumptions:</div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;">1. The ID of the volume to be meshed with layered extrusion is known</div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;">2. The volume is extruded from a surface that belongs to a plane</div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;">3. Embedded curves are present only on top and bottom surfaces of the volume</div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;">4. The embedded curves on top does not match with embedded curves on bottom</div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;"><br></div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;">I assume that if another entity is touching the volume (defined in points 1,2) on its top and bottom surfaces, due to conformal meshing requirements, this will create embedded curves on them hence assumption 3 and 4.</div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;"><br></div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;">The procedure is as follows:</div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;"><br></div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;"><div><div dir="ltr" data-setdir="false">- Select the volume that requires layered extrusion</div><div dir="ltr" data-setdir="false">- Duplicate its bottom surface (including embedded curves) and top embedded curves</div><div dir="ltr" data-setdir="false">- Delete (recursive) the volume </div><div dir="ltr" data-setdir="false">- Duplicate, translate and embed the top embedded curves on the bottom surface</div><div dir="ltr" data-setdir="false">- Extrude the bottom mesh with Extrude{}{ Layers{...}}</div><div dir="ltr" data-setdir="false">- Embed the top curve on top surface generated by Extrude</div><div dir="ltr" data-setdir="false">- Run Coherence/BooleanFragmens</div><div dir="ltr" data-setdir="false"><br></div></div></div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;">The attached script is a simplified version of the above procedure (the volume requiring extrusion is already deleted, top embedded curves, bottom surface and embedded curves already available).</div><div dir="ltr" data-setdir="false">I wanted to prepare a simple script and hopefully get a feedback before I embark on further hours of scripting because there might be subtleties that only Gmsh developers are aware of which, if overlooked, could lead to a unicorn chase from my side :-)<br></div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;"><span></span><br></div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;">The script builds a cylinder inside a parallelepiped.</div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;"><br></div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;">The cylinder is the volume meshed with a layered extrusion (along z) and it features two embedded curves, one on top and one on bottom that are different in shape and location on XY plane. </div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;"><br></div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;">The mesh type in the parallelepiped is arbitrary, it only needs to guarantee that the total mesh (cube + cylinder) is conformal.</div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;"><br></div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;">The results seem to give a conformal mesh and solve the extrusion problem.</div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;"><br></div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;">Any feedback is much appreciated,</div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;"><br></div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;">Many thanks,</div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;"><br></div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;">Marco</div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;"><br></div><div dir="ltr" data-setdir="false" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;"><br></div><div style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;"><br></div><div style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;"><br></div><div style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;"><br></div>
</div><div id="ydp4edb9bcyahoo_quoted_5291609068" class="ydp4edb9bcyahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
Il mercoledì 4 novembre 2020, 09:14:51 CET, Christophe Geuzaine <cgeuzaine@uliege.be> ha scritto:
</div>
<div><br></div>
<div><br></div>
<div><div dir="ltr"><br clear="none"><br clear="none">> On 22 Oct 2020, at 12:56, Marco Antolovic <<a shape="rect" href="mailto:marco_antolovic@yahoo.it" rel="nofollow" target="_blank">marco_antolovic@yahoo.it</a>> wrote:<br clear="none">> <br clear="none">> Hi all,<br clear="none">> <br clear="none">> I'm trying to find the best way to approach the following problem:<br clear="none">> <br clear="none">> I have a parallelepiped with the edge alone z much smaller than that along x and y (this is typical, for example, <br clear="none">> for PCB traces) and I would like to guarantee, in the volume, a predefined number of layers (np_layers) along z<br clear="none">> edge.<br clear="none">> <br clear="none">> If I build the structure in gmsh this is quite simple to obtain by saying:<br clear="none">> <br clear="none">> SetFactory("OpenCASCADE");<br clear="none">> thickness = 140e-6;<br clear="none">> nr_layers = 4;<br clear="none">> surf=newreg;<br clear="none">> Rectangle(surf)={.001,0,0,.001,.001,0};<br clear="none">> Extruded_surf() = Extrude { 0,0, thickness } { Surface{surf}; Layers{nr_layers}; Recombine;};<br clear="none">> <br clear="none">> But how can I apply this in case the parallelepiped is coming from a step file? The command above<br clear="none">> (Extrude{...}{... Layers{}}) can't be used.<br clear="none"><br clear="none">Indeed, we would need to "reverse engineer" the fact that the volume has indeed been created by extrusion. See<br clear="none"><br clear="none"><a shape="rect" href="https://gitlab.onelab.info/gmsh/gmsh/-/issues/929" rel="nofollow" target="_blank">https://gitlab.onelab.info/gmsh/gmsh/-/issues/929</a><br clear="none"><br clear="none">for the issue tracking this feature request.<br clear="none"><br clear="none">Christophe<div class="ydp4edb9bcyqt9105986599" id="ydp4edb9bcyqtfd88929"><br clear="none"><br clear="none"><br clear="none">> <br clear="none">> I was thinking about slicing the Volume with some planes (see example below)<br clear="none">> <br clear="none">> SetFactory("OpenCASCADE");<br clear="none">> thickness = 140e-6;<br clear="none">> nr_layers = 4;<br clear="none">> surf=newreg;<br clear="none">> Rectangle(surf)={.001,0,0,.001,.001,0};<br clear="none">> Extruded_surf() = Extrude { 0,0, thickness } { Surface{surf};};<br clear="none">> vol() = Extruded_surf(1);<br clear="none">> For i In {1:nr_layers-1}<br clear="none">> surf1(i-1)=newreg;<br clear="none">> Rectangle(surf1(i-1)) = {.001, 0, thickness/nr_layers*i, .001, .001};<br clear="none">> EndFor<br clear="none">> results() = BooleanFragments{Volume{vol()};Delete;}{Surface{surf1()}; Delete;};<br clear="none">> <br clear="none">> but when trying to recombine the triangles in the layers I get the following error:<br clear="none">> <br clear="none">> Error : Pyramid top vertex already classified on volume 2 (!= 3) - non-manifold quad boundaries not supported<br clear="none">> yet<br clear="none">> <br clear="none">> Any suggestion on how to address the issue is much appreciated.<br clear="none">> <br clear="none">> Regards,<br clear="none">> <br clear="none">> Marco</div><br clear="none">> <br clear="none">> _______________________________________________<br clear="none">> gmsh mailing list<br clear="none">> <a shape="rect" href="mailto:gmsh@onelab.info" rel="nofollow" target="_blank">gmsh@onelab.info</a><br clear="none">> <a shape="rect" href="http://onelab.info/mailman/listinfo/gmsh" rel="nofollow" target="_blank">http://onelab.info/mailman/listinfo/gmsh</a><br clear="none"><br clear="none">— <br clear="none">Prof. Christophe Geuzaine<br clear="none">University of Liege, Electrical Engineering and Computer Science <br clear="none"><a shape="rect" href="http://people.montefiore.ulg.ac.be/geuzaine" rel="nofollow" target="_blank">http://people.montefiore.ulg.ac.be/geuzaine</a><div class="ydp4edb9bcyqt9105986599" id="ydp4edb9bcyqtfd98136"><br clear="none"><br clear="none"><br clear="none"><br clear="none"></div></div></div>
</div>
</div></body></html>