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

show that one can use only the first argument in BooleanFragments

parent d71c0c7a
Branches
Tags
No related merge requests found
SetFactory("OpenCASCADE"); SetFactory("OpenCASCADE");
//Mesh.Algorithm = 6; //Mesh.Algorithm = 6;
Mesh.CharacteristicLengthMin = 0.1; Mesh.CharacteristicLengthMin = 0.2;
Mesh.CharacteristicLengthMax = 0.1; Mesh.CharacteristicLengthMax = 0.2;
DefineConstant[ DefineConstant[
x = {0, Min -5, Max 5, Step 0.1, Name "Bloc 1/0x"} x = {0, Min -5, Max 5, Step 0.1, Name "Bloc 1/0x"}
...@@ -22,7 +22,7 @@ DefineConstant[ ...@@ -22,7 +22,7 @@ DefineConstant[
Box(1) = {x,y,z, dx,dy,dz}; Box(1) = {x,y,z, dx,dy,dz};
Box(2) = {x2,y2,z2, dx2,dy2,dz2}; Box(2) = {x2,y2,z2, dx2,dy2,dz2};
f() = BooleanFragments { Volume{1}; Delete; }{ Volume{2}; Delete; }; f() = BooleanFragments { Volume{1,2}; Delete; }{};
Printf("Resulting elementary entities:"); Printf("Resulting elementary entities:");
For i In {0:#f()-1} For i In {0:#f()-1}
......
SetFactory("OpenCASCADE"); SetFactory("OpenCASCADE");
//Mesh.Algorithm = 6; //Mesh.Algorithm = 6;
Mesh.CharacteristicLengthMin = 0.1; Mesh.CharacteristicLengthMin = 0.2;
Mesh.CharacteristicLengthMax = 0.1; Mesh.CharacteristicLengthMax = 0.2;
DefineConstant[ DefineConstant[
sph = {0, Choices{0,1}, Name "Make sphere a single volume"} sph = {0, Choices{0,1}, Name "Make sphere a single volume"}
...@@ -15,7 +15,7 @@ Box(1) = {0,0,0, 2,2,2}; ...@@ -15,7 +15,7 @@ Box(1) = {0,0,0, 2,2,2};
Sphere(2) = {xx, 1, 1, rr}; Sphere(2) = {xx, 1, 1, rr};
Box(3) = {2,0,0, 2,2,2}; Box(3) = {2,0,0, 2,2,2};
f() = BooleanFragments { Volume{1}; Delete; }{ Volume{2,3}; Delete; }; f() = BooleanFragments { Volume{1:3}; Delete; }{};
Printf("f()", f()); Printf("f()", f());
If(sph) If(sph)
tol = 1e-3; tol = 1e-3;
......
...@@ -36,9 +36,9 @@ DefineConstant[ ...@@ -36,9 +36,9 @@ DefineConstant[
If(order == 0) If(order == 0)
Extrude{0,0,0.3}{ Surface{1:3}; } Extrude{0,0,0.3}{ Surface{1:3}; }
Delete{ Surface{1:3}; } Delete{ Surface{1:3}; }
BooleanFragments{ Volume{1}; Delete; }{ Volume{2:3}; Delete; } BooleanFragments{ Volume{1:3}; Delete; }{}
Else Else
BooleanFragments{ Surface{1}; Delete; }{ Surface{2:3}; Delete; } BooleanFragments{ Surface{1:3}; Delete; }{}
a() = Extrude{0,0,0.3}{ Surface{1:5}; }; a() = Extrude{0,0,0.3}{ Surface{1:5}; };
Printf("returned entities (top, body, laterals, etc.) = ", a()); Printf("returned entities (top, body, laterals, etc.) = ", a());
EndIf EndIf
...@@ -28,7 +28,7 @@ Plane Surface(2) = {2}; ...@@ -28,7 +28,7 @@ Plane Surface(2) = {2};
Disk(3) = {0.6, 0.6, 0, 0.5, 0.3}; Disk(3) = {0.6, 0.6, 0, 0.5, 0.3};
BooleanFragments{ Surface{1}; Delete; }{ Surface{2:3}; Delete; } BooleanFragments{ Surface{1:3}; Delete; }{}
rec = DefineNumber[1, Choices{0,1}, Name "recombine into prisms?"]; rec = DefineNumber[1, Choices{0,1}, Name "recombine into prisms?"];
Extrude{0,0,0.3}{ Surface{1:5}; Layers{5}; Recombine rec; } Extrude{0,0,0.3}{ Surface{1:5}; Layers{5}; Recombine rec; }
...@@ -29,6 +29,6 @@ EndFor ...@@ -29,6 +29,6 @@ EndFor
Printf("disk tags: ", b()); Printf("disk tags: ", b());
c() = BooleanFragments{ Line{t}; Surface{1:6}; Delete; }{ Surface{b()}; Delete; }; c() = BooleanFragments{ Line{t}; Surface{1:6,b()}; Delete; }{};
Printf("all tags (disk and top line tags should be unchanged!): ", c()); Printf("all tags (disk and top line tags should be unchanged!): ", c());
...@@ -19,7 +19,7 @@ If(sph) ...@@ -19,7 +19,7 @@ If(sph)
EndIf EndIf
r() = BooleanFragments{ Volume{a()}; Delete; }{ Volume{b()}; Delete; }; r() = BooleanFragments{ Volume{a(),b()}; Delete; }{};
//Recursive Color SteelBlue { Volume{r()}; } //Recursive Color SteelBlue { Volume{r()}; }
......
...@@ -32,5 +32,5 @@ DefineConstant[ ...@@ -32,5 +32,5 @@ DefineConstant[
angle = {90, Min 1, Max 360, Step 1, angle = {90, Min 1, Max 360, Step 1,
Name "Parameters/Angle"} Name "Parameters/Angle"}
]; ];
BooleanFragments{ Surface{1}; Delete; }{ Surface{2:3}; Delete; } BooleanFragments{ Surface{1:3}; Delete; }{}
a() = Extrude{ {0,1,0}, {0,0,0}, angle*2*Pi/360 }{ Surface{1:5}; }; a() = Extrude{ {0,1,0}, {0,0,0}, angle*2*Pi/360 }{ Surface{1:5}; };
...@@ -32,6 +32,5 @@ DefineConstant[ ...@@ -32,6 +32,5 @@ DefineConstant[
angle = {90, Min 1, Max 360, Step 1, angle = {90, Min 1, Max 360, Step 1,
Name "Parameters/Angle"} Name "Parameters/Angle"}
]; ];
BooleanFragments{ Surface{1}; Delete; }{ Surface{2:3}; Delete; } BooleanFragments{ Surface{1:3}; Delete; }{}
Extrude{ {0,1,0}, {0,0,0}, angle*2*Pi/360 }{ Surface{1:5}; Layers{10}; Recombine; } Extrude{ {0,1,0}, {0,0,0}, angle*2*Pi/360 }{ Surface{1:5}; Layers{10}; Recombine; }
...@@ -27,4 +27,4 @@ Line Loop(2) = {5,6,7,8}; ...@@ -27,4 +27,4 @@ Line Loop(2) = {5,6,7,8};
Plane Surface(2) = {2}; Plane Surface(2) = {2};
Disk(3) = {0.6, 0.6, 0, 0.5, 0.3}; Disk(3) = {0.6, 0.6, 0, 0.5, 0.3};
BooleanFragments{ Surface{1}; Delete; }{ Surface{2,3}; Delete; } BooleanFragments{ Surface{1:3}; Delete; }{}
...@@ -31,4 +31,4 @@ Surface Loop(1) = {1,2,3,4,5}; ...@@ -31,4 +31,4 @@ Surface Loop(1) = {1,2,3,4,5};
Volume(1) = {1}; Volume(1) = {1};
Cylinder(2) = {0.5,0.5,-0.5, 0,0,2, 0.2}; Cylinder(2) = {0.5,0.5,-0.5, 0,0,2, 0.2};
BooleanFragments{ Volume{1}; Delete; }{ Volume{2}; Delete; } BooleanFragments{ Volume{1,2}; Delete; }{}
...@@ -26,6 +26,6 @@ Translate{0.2,0.2,0.2}{ Volume{1}; } ...@@ -26,6 +26,6 @@ Translate{0.2,0.2,0.2}{ Volume{1}; }
Rotate { {1,0,0}, {0,0,0}, Pi/3 } { Volume{1}; } Rotate { {1,0,0}, {0,0,0}, Pi/3 } { Volume{1}; }
Rotate { {0,1,0}, {0,0,0}, Pi/3 } { Volume{1}; } Rotate { {0,1,0}, {0,0,0}, Pi/3 } { Volume{1}; }
f() = BooleanFragments { Volume{1}; Delete; }{ Volume{2}; Delete; }; f() = BooleanFragments { Volume{1,2}; Delete; }{};
Translate{4,0,0}{ Duplicata{ Volume{1/*,2,3*/}; } } Translate{4,0,0}{ Duplicata{ Volume{1/*,2,3*/}; } }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment