Skip to content
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

GMSH integration yields UContinuity error #1556

Open
bragostin opened this issue Apr 8, 2024 · 6 comments
Open

GMSH integration yields UContinuity error #1556

bragostin opened this issue Apr 8, 2024 · 6 comments
Labels

Comments

@bragostin
Copy link
Contributor

bragostin commented Apr 8, 2024

Dear CQ community,

Using

cadquery @ git+https://github.com/CadQuery/cadquery.git@153ed3f667911e909ba8b93bddd297defc7cd42f
cadquery-ocp==7.7.2
gmsh==4.12.2

the following simple code adapted from #1346

import cadquery as cq
import gmsh

FD_new = cq.Workplane("YZ").center(-2.5, -10).rect(5, 20).extrude(100)

gmsh.initialize()
gmsh.option.setNumber("General.Terminal", 1)
topods = FD_new.toOCC()
volumes = gmsh.model.occ.importShapesNativePointer(topods._address())
gmsh.model.occ.synchronize()
gmsh.option.setNumber("Mesh.Algorithm", 1)
gmsh.option.setNumber("Mesh.MeshSizeMin", 1)
gmsh.option.setNumber("Mesh.MeshSizeMax", 5)
gmsh.model.mesh.generate(3)
gmsh.write("FD_new_mesh.msh")

yields this error

Error   : OpenCASCADE exception GeomAdaptor_Surface::UContinuity
Traceback (most recent call last):
  File "/home/issue_gmsh.py", line 11, in <module>
    volumes = gmsh.model.occ.importShapesNativePointer(topods._address())
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chbrago/cadquery/lib/python3.11/site-packages/gmsh.py", line 8627, in importShapesNativePointer
    raise Exception(logger.getLastError())
Exception: OpenCASCADE exception GeomAdaptor_Surface::UContinuity

any idea what is wrong here?

@bragostin bragostin added the bug Something isn't working label Apr 8, 2024
@jmwright
Copy link
Member

@bragostin Did you install CadQuery via pip? It would be interesting to see if using conda fixes the issue, and also if using an older version of OCP helps (to test for a regression in OpenCASCADE/OCP. If neither of those help, maybe you can check with the gmsh community to see if there is any extra object debugging that can be done on that side?

@bragostin
Copy link
Contributor Author

@jmwright Yes it was a pipinstall.
Reverting to cadquery-ocp==7.7.1 does not solve the issue.
Export in a STEP file and importing via gmsh.merge function works.
I will try with a conda install next.

@bragostin
Copy link
Contributor Author

bragostin commented Apr 11, 2024

@jmwright with a fresh conda install conda create -n cadquery -c conda-forge -c cadquery cadquery=master cq-editor=master and gmsh==4.12.2 (same as pip install) the issue disappears.
So the problem comes from the pip install it seems.

@adam-urbanczyk
Copy link
Member

Then it is likely an ABI compatibility issue. conda-forge avoids this by having a well defined toolchain. That is not the case for pip, everyone can choose a different compiler/flags.

@adam-urbanczyk adam-urbanczyk added pip and removed bug Something isn't working labels Apr 11, 2024
@bragostin
Copy link
Contributor Author

@adam-urbanczyk thank you! Anything that can be done beyond using conda? Like raising the issue with the gmsh team?

@adam-urbanczyk
Copy link
Member

You could try compiling all packages yourself. I don't think this is a gmsh or ocp packaging bug.

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

No branches or pull requests

3 participants