Hello. I am meshing a device by adding and subtracting multiple geometries using geom.boolean_difference and geom.boolean_union. I cannot attach the script as it is proprietary, but I believe you should still be able to address my questions and concerns.
-
Working in occ.Geometry, I define my mesh_size when initializing my geometries (I've tried with geo.Geometry as well). However, once I take their boolean difference, I get this warning:
UserWarning: Specified mesh size for <redacted> discarded in Boolean difference operation.
-
I then attempted to use the geom.set_mesh_size_callback() function, but I keep getting errors and the documentation is very limited. In the README file, you have a few examples using the function, but they do not run. I believe there was another closed issue about the README examples, but the issue persists.
I'm opening a new issue to request improved documentation on how to use the set_mesh_size_callback function in pygmsh. I keep getting the following error, no matter how I structure it:
api_callback_ = api_callback_type_(lambda dim, tag, x, y, z, lc, _ : callback(dim, tag, x, y, z, lc))
TypeError: <lambda>() takes 5 positional arguments but 6 were given
Due to this line, which I copied from the README:
geom.set_mesh_size_callback(lambda dim, tag, x, y, z: abs(np.sqrt(x**2 + y**2 + z**2) - 0.5) + 0.1)
Does this need to be structure as an anonymous function for any specific reason? What to x, y, and z mean as inputs? Are they user-specified points in the mesh? More details on how this mesh refinement function works would be very helpful.
Thanks,
Olivia
Hello. I am meshing a device by adding and subtracting multiple geometries using
geom.boolean_differenceandgeom.boolean_union. I cannot attach the script as it is proprietary, but I believe you should still be able to address my questions and concerns.Working in
occ.Geometry, I define mymesh_sizewhen initializing my geometries (I've tried withgeo.Geometryas well). However, once I take their boolean difference, I get this warning:UserWarning: Specified mesh size for <redacted> discarded in Boolean difference operation.I then attempted to use the
geom.set_mesh_size_callback()function, but I keep getting errors and the documentation is very limited. In the README file, you have a few examples using the function, but they do not run. I believe there was another closed issue about the README examples, but the issue persists.I'm opening a new issue to request improved documentation on how to use the set_mesh_size_callback function in pygmsh. I keep getting the following error, no matter how I structure it:
api_callback_ = api_callback_type_(lambda dim, tag, x, y, z, lc, _ : callback(dim, tag, x, y, z, lc))TypeError: <lambda>() takes 5 positional arguments but 6 were givenDue to this line, which I copied from the README:
geom.set_mesh_size_callback(lambda dim, tag, x, y, z: abs(np.sqrt(x**2 + y**2 + z**2) - 0.5) + 0.1)Does this need to be structure as an anonymous function for any specific reason? What to x, y, and z mean as inputs? Are they user-specified points in the mesh? More details on how this mesh refinement function works would be very helpful.
Thanks,
Olivia