openCASCADE Engine¶
Using the openCASCADE kernel instead of the built-in geometry kernel. Models can be built using constructive solid geometry, allowing for 2D and 3D polygon boolean operations.
Geometry¶
- class pygmsh.occ.geometry.Geometry(init_argv=None)¶
Bases:
pygmsh.common.geometry.CommonGeometry
- add_ball(*args, mesh_size=None, **kwargs)¶
- add_box(*args, mesh_size=None, **kwargs)¶
- add_cone(*args, mesh_size=None, **kwargs)¶
- add_cylinder(*args, mesh_size=None, **kwargs)¶
- add_disk(*args, mesh_size=None, **kwargs)¶
- add_ellipsoid(center, radii, mesh_size=None)¶
- add_rectangle(*args, mesh_size=None, **kwargs)¶
- add_torus(*args, mesh_size=None, **kwargs)¶
- add_wedge(*args, mesh_size=None, **kwargs)¶
- boolean_difference(d0, d1, delete_first=True, delete_other=True)¶
Boolean difference, see https://gmsh.info/doc/texinfo/gmsh.html#Boolean-operations input_entity and tool_entity are called object and tool in gmsh documentation.
- boolean_fragments(d0, d1, delete_first=True, delete_other=True)¶
Boolean fragments, see https://gmsh.info/doc/texinfo/gmsh.html#Boolean-operations input_entity and tool_entity are called object and tool in gmsh documentation.
- boolean_intersection(entities, delete_first=True, delete_other=True)¶
Boolean intersection, see https://gmsh.info/doc/texinfo/gmsh.html#Boolean-operations input_entity and tool_entity are called object and tool in gmsh documentation.
- boolean_union(entities, delete_first=True, delete_other=True)¶
Boolean union, see https://gmsh.info/doc/texinfo/gmsh.html#Boolean-operations input_entity and tool_entity are called object and tool in gmsh documentation.
- property characteristic_length_max¶
- property characteristic_length_min¶
- force_outward_normals(tag)¶
- import_shapes(filename)¶
- revolve(*args, **kwargs)¶
Ball¶
- class pygmsh.occ.ball.Ball(center, radius, angle1=- 1.5707963267948966, angle2=1.5707963267948966, angle3=6.283185307179586)¶
Bases:
object
Creates a sphere.
- Parameters
center (array-like[3]) – Center of the ball.
radius (float) – Radius of the ball.
x0 (float) – If specified and x0 > -1, the ball is cut off at x0*radius parallel to the y-z plane.
x1 (float) – If specified and x1 < +1, the ball is cut off at x1*radius parallel to the y-z plane.
alpha (float) – If specified and alpha < 2*pi, the points between alpha and 2*pi w.r.t. to the x-y plane are not part of the object.
char_length (float) – If specified, sets the Characteristic Length property.
- dim = 3¶
Box¶
- class pygmsh.occ.box.Box(x0, extents, char_length=None)¶
Bases:
object
Creates a box.
- Parameters
x0 (array-like[3]) – List containing the x, y, z values of the start point.
extends (array-like[3]) – List of the 3 extents of the box edges.
char_length (float) – Characteristic length of the mesh elements of this polygon.
- dim = 3¶
Cone¶
- class pygmsh.occ.cone.Cone(center, axis, radius0, radius1, angle=6.283185307179586)¶
Bases:
object
Creates a cone.
- centerarray-like[3]
The 3 coordinates of the center of the first circular face.
- axisarray-like[3]
The 3 components of the vector defining its axis.
- radius0float
Radius of the first circle.
- radius1float
Radius of the second circle.
- anglefloat
Angular opening of the the Cone.
- dim = 3¶
Cylinder¶
- class pygmsh.occ.cylinder.Cylinder(x0, axis, radius, angle=6.283185307179586)¶
Bases:
object
Creates a cylinder.
- Parameters
x0 (array-like[3]) – The 3 coordinates of the center of the first circular face.
axis (array-like[3]) – The 3 components of the vector defining its axis.
radius (float) – Radius value of the cylinder.
angle (float) – Angular opening of the cylinder.
- dim = 3¶