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
No related branches found
No related tags found
No related merge requests found
SetFactory("OpenCASCADE");
//Mesh.Algorithm = 6;
Mesh.CharacteristicLengthMin = 0.1;
Mesh.CharacteristicLengthMax = 0.1;
Mesh.CharacteristicLengthMin = 0.2;
Mesh.CharacteristicLengthMax = 0.2;
DefineConstant[
x = {0, Min -5, Max 5, Step 0.1, Name "Bloc 1/0x"}
......@@ -22,7 +22,7 @@ DefineConstant[
Box(1) = {x,y,z, dx,dy,dz};
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:");
For i In {0:#f()-1}
......
SetFactory("OpenCASCADE");
//Mesh.Algorithm = 6;
Mesh.CharacteristicLengthMin = 0.1;
Mesh.CharacteristicLengthMax = 0.1;
Mesh.CharacteristicLengthMin = 0.2;
Mesh.CharacteristicLengthMax = 0.2;
DefineConstant[
sph = {0, Choices{0,1}, Name "Make sphere a single volume"}
......@@ -15,7 +15,7 @@ Box(1) = {0,0,0, 2,2,2};
Sphere(2) = {xx, 1, 1, rr};
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());
If(sph)
tol = 1e-3;
......
......@@ -36,9 +36,9 @@ DefineConstant[
If(order == 0)
Extrude{0,0,0.3}{ Surface{1:3}; }
Delete{ Surface{1:3}; }
BooleanFragments{ Volume{1}; Delete; }{ Volume{2:3}; Delete; }
BooleanFragments{ Volume{1:3}; Delete; }{}
Else
BooleanFragments{ Surface{1}; Delete; }{ Surface{2:3}; Delete; }
BooleanFragments{ Surface{1:3}; Delete; }{}
a() = Extrude{0,0,0.3}{ Surface{1:5}; };
Printf("returned entities (top, body, laterals, etc.) = ", a());
EndIf
......@@ -28,7 +28,7 @@ Plane Surface(2) = {2};
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?"];
Extrude{0,0,0.3}{ Surface{1:5}; Layers{5}; Recombine rec; }
......@@ -29,6 +29,6 @@ EndFor
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());
......@@ -19,7 +19,7 @@ If(sph)
EndIf
r() = BooleanFragments{ Volume{a()}; Delete; }{ Volume{b()}; Delete; };
r() = BooleanFragments{ Volume{a(),b()}; Delete; }{};
//Recursive Color SteelBlue { Volume{r()}; }
......
......@@ -32,5 +32,5 @@ DefineConstant[
angle = {90, Min 1, Max 360, Step 1,
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}; };
......@@ -32,6 +32,5 @@ DefineConstant[
angle = {90, Min 1, Max 360, Step 1,
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; }
......@@ -27,4 +27,4 @@ Line Loop(2) = {5,6,7,8};
Plane Surface(2) = {2};
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};
Volume(1) = {1};
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}; }
Rotate { {1,0,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*/}; } }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment