Skip to content

boolean_union problem on gmsh 4.9.0+ #519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
quintenstar opened this issue Jan 30, 2022 · 0 comments
Open

boolean_union problem on gmsh 4.9.0+ #519

quintenstar opened this issue Jan 30, 2022 · 0 comments

Comments

@quintenstar
Copy link

quintenstar commented Jan 30, 2022

So far working with pygmsh has been great. To being able to create parametric meshes and properly assigning physical labels to all the parts. Definitely would be much harder with pure gmsh.

As part of my mesh creation, I add a bunch of rotated rectangles together. This works perfectly up to gmsh version 4.8-, but fails for gmsh 4.9+ (using the latest pygmsh 7.1.17)

MWE:

import pygmsh
import math

with pygmsh.occ.Geometry() as geom:
   geom.characteristic_length_min = 0.1
   geom.characteristic_length_max = 0.5

   holes = []
   N = 6
   for i in range(N):
       angle = i * 2 * math.pi / N

       hole = geom.add_rectangle((5, 4.5, 0), 4, 1)
       geom.rotate(hole, (5, 5, 0), angle, (0, 0, 1))
       holes.append(hole)

   geom.boolean_union(holes)

   geom.generate_mesh()
   pygmsh.write("test.msh")

Output using gmsh >=4.9.0 :

  Info    : Cannot bind existing OpenCASCADE surface 1 to second tag 2
  Info    : Could not preserve tag of 2D object 2 (->1)
  Info    : Cannot bind existing OpenCASCADE surface 1 to second tag 3
  Info    : Could not preserve tag of 2D object 3 (->1)
  Info    : Cannot bind existing OpenCASCADE surface 1 to second tag 4
  Info    : Could not preserve tag of 2D object 4 (->1)
  Info    : Cannot bind existing OpenCASCADE surface 1 to second tag 5
  Info    : Could not preserve tag of 2D object 5 (->1)
  Info    : Cannot bind existing OpenCASCADE surface 1 to second tag 6
  Info    : Could not preserve tag of 2D object 6 (->1)

Desired output (<=4.8.4) :

desired_holes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant