[Gmsh] Boolean operations with stl files (OpenCASCADE - Gmsh )
Christophe Geuzaine
cgeuzaine at uliege.be
Mon Feb 4 20:00:26 CET 2019
An STL is a just a mesh - so no, there are no boolean operations available.
CG
> On 4 Feb 2019, at 17:47, Octavio Castillo Reyes <ocastilloreyes at gmail.com> wrote:
>
> Dear gmsh team,
>
> I am trying to create meshes with topography (including bathymetry and other complex embedding bodies). I have made several experiments:
>
> * Boolean operations with meshes (not supported by gmsh)
> * Create flat surfaces and then interpolate them to a given topography (works well but is only valid for a physical material/group).
>
> The above led me to try the OpenCASCADE kernel. I am learning to use it and I have modified one of its examples:
>
> SetFactory("OpenCASCADE");
> Mesh.CharacteristicLengthMin = 0.5;
> Mesh.CharacteristicLengthMax = 0.2;
> Box(1) = {0, -1, -1, 2, 2, 2};
> Sphere(2) = {0, 0, 0, 1.};
> BooleanDifference(3) = { Volume{1}; Delete; }{ Volume{2}; Delete; };
>
> However, my input topography is given as a STL file. Therefore,I would like to know if it is possible to carry out operations such as the following:
>
> SetFactory("OpenCASCADE");
> Merge "Box.stl" ; // Volume 1
> Merge "Sphere.stl"; // Volume 2
> Mesh.CharacteristicLengthMin = 0.5;
> Mesh.CharacteristicLengthMax = 0.2;
> BooleanDifference(3) = { Volume{1}; Delete; }{ Volume{2}; Delete; };
>
> Or something like:
>
> SetFactory("OpenCASCADE");
> Merge "Volume_Topo.stl" ; // Volume 1
> Merge "Volume_No_Topo.stl"; // Volume 2
> Mesh.CharacteristicLengthMin = 0.5;
> Mesh.CharacteristicLengthMax = 0.2;
> BooleanDifference(3) = { Volume{1}; Delete; }{ Volume{2}; Delete; };
>
> Is it possible to import STL files and perform boolean operations? How to define a volume from Boolean operations between two STL files (previously created)? Actually, the gmsh error is the following:
>
> Unknown OpenCASCADE entity of dimension 3 with tag 1
> .... Could not apply boolean operator
>
> I am very interested in knowing about the best strategy to perform this task. Unfortunately, until now it has not been clear to me how to solve my problem.
>
> Thank you for your time and support
>
> Best regards!
>
> _______________________________________________
> gmsh mailing list
> gmsh at 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
More information about the gmsh
mailing list