Skip to content
Snippets Groups Projects
Commit d69a7589 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

No commit message

No commit message
parent 3b903b00
No related branches found
No related tags found
No related merge requests found
...@@ -7,12 +7,12 @@ Mesh.CharacteristicLengthMax = 1; ...@@ -7,12 +7,12 @@ Mesh.CharacteristicLengthMax = 1;
Macro dendrite Macro dendrite
For i In {1:5} For i In {1:5}
z = -2+7*i; z = -2+7*i;
r = 1 + 0.6*Sin(2*Pi*i/5.); r = 0.4 + 0.2*Sin(2*Pi*i/5.);
Point(nump+1) = {x,0,z}; Point(nump+1) = {x,y,z};
Point(nump+2) = {x+r,0,z}; Point(nump+2) = {x+r,y,z};
Point(nump+3) = {x,r,z}; Point(nump+3) = {x,y+r,z};
Point(nump+4) = {x-r,0,z}; Point(nump+4) = {x-r,y,z};
Point(nump+5) = {x,-r,z}; Point(nump+5) = {x,y-r,z};
Circle(numc+1) = {nump+2,nump+1,nump+3}; Circle(numc+1) = {nump+2,nump+1,nump+3};
Circle(numc+2) = {nump+3,nump+1,nump+4}; Circle(numc+2) = {nump+3,nump+1,nump+4};
Circle(numc+3) = {nump+4,nump+1,nump+5}; Circle(numc+3) = {nump+4,nump+1,nump+5};
...@@ -26,13 +26,15 @@ Macro dendrite ...@@ -26,13 +26,15 @@ Macro dendrite
reg() += numr; reg() += numr;
Return Return
Sphere(1) = {0, 0, 0, 8}; Sphere(1) = {0, 0, 0, 7};
reg() = {}; reg() = {};
nump = 0; numc = 0; numr = 2; nump = 0; numc = 0; numr = 100;
For x In{-4:4:4} For x In{-2:2:2}
For y In{-2:2:2}
Call dendrite; Call dendrite;
EndFor EndFor
EndFor
DefineConstant[ DefineConstant[
op = {0, Choices{0="None", 1="Union", 2="Intersection", 3="Difference", 4="Fragments"}, op = {0, Choices{0="None", 1="Union", 2="Intersection", 3="Difference", 4="Fragments"},
...@@ -56,6 +58,6 @@ ElseIf(op == 3) ...@@ -56,6 +58,6 @@ ElseIf(op == 3)
ElseIf(op == 4) ElseIf(op == 4)
BooleanFragments { Volume{1}; Delete; }{ Volume{reg()}; Delete; } BooleanFragments { Volume{1}; Delete; }{ Volume{reg()}; Delete; }
If(sph) If(sph)
BooleanUnion{ Volume{1}; Delete; }{ Volume{2,3,4}; Delete;} BooleanUnion{ Volume{1}; Delete; }{ Volume{2:#reg()+1}; Delete;}
EndIf EndIf
EndIf EndIf
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment