Error in OpenCASCADE exception TopoDS::Solid when trying the boolean operation
Hello, I am currently a PhD student and I am very new to the gmsh function in python.
I just to do something using gmsh, so basically, I read a stl file(in this case, it is a surface representation of a cylinder), based on a tutorial, I did a classifysurfaces()
and then gmsh.model.mesh.createGeometry()
. After that, I have following code:
Create a volume from all the surfaces
`s = gmsh.model.occ.getEntities(2)`
`l = gmsh.model.occ.addSurfaceLoop([e[1] for e in s])`
`v = gmsh.model.occ.addVolume([l])`
The error rise in this line v = gmsh.model.occ.addVolume([l])
, it shows Exception: OpenCASCADE exception TopoDS::Solid
, I don't know why and I tried to search the gmsh documentation but cannot find a solution. Then I try using geo
instead of occ
, it worked. But the reason I try to use occ
is that only the OpenCASCADE CAD support the bolean operation, I want the geometry of my stl file can do those operations with another geometry, can you please tell me how to do that? or it is currently unable to do? Right now I am just testing, but in the future, the stl can have the other shape, so I cannot create a shape directly using occ
In order to let you have a better understanding of what I'm talking about, I also include the stl file and the code.
I sincerely appreciate if you can help me with that, the code is based on T13, just for your reference! Thank you!
Update here:
I kind of get the idea that the because this is a stl file, so s = gmsh.model.occ.getEntities(2)
this would get nothing. So this is basically a problem how can I transform a built-in CAD to OpenCASCADE representation and then use all the occ
functions. Is that even possible?