MesherObject¶
- class MesherObject(*args)¶
GetFEM MesherObject object
This object represents a geometric object to be meshed by the experimental meshing procedure of Getfem.
General constructor for MesherObject objects
MF = MesherObject('ball', vec center, scalar radius)Represents a ball of corresponding center and radius.MF = MesherObject('half space', vec origin, vec normal_vector)Represents an half space delimited by the plane which contains the origin and normal to normal_vector. The selected part is the part in the direction of the normal vector. This allows to cut a geometry with a plane for instance to build a polygon or a polyhedron.MF = MesherObject('cylinder', vec origin, vec n, scalar length, scalar radius)Represents a cylinder (in any dimension) of a certain radius whose axis is determined by the origin, a vector n and a certain length.MF = MesherObject('cone', vec origin, vec n, scalar length, scalar half_angle)Represents a cone (in any dimension) of a certain half-angle (in radians) whose axis is determined by the origin, a vector n and a certain length.MF = MesherObject('torus', scalar R, scalar r)Represents a torus in 3d of axis along the z axis with a great radius equal to R and small radius equal to r. For the moment, the possibility to change the axis is not given.MF = MesherObject('rectangle', vec rmin, vec rmax)Represents a rectangle (or parallelepiped in 3D) parallel to the axes.MF = MesherObject('ellipse', vec center, scalar r1, scalar r2[, scalar angle])Represents an ellipse in 2D of semi-axes r1 and r2, the first one along the direction of angle angle (in radians, 0 by default) with the x axis.MF = MesherObject('ellipsoid', vec center, vec radii[, mat axes])Represents an ellipsoid in 3D of semi-axes radii (3 values), along the x, y and z axes, or along the columns of the 3 x 3 matrix axes (orthonormalized).MF = MesherObject('polygon', mat vertices[, mat controls])Represents a simple polygon in 2D (not necessarily convex), the columns of vertices (2 x n) being its vertices, in either order. With controls (4 x n), its sides may be curved: the side j, from the vertex j to the vertex j+1 (the last one to the first one), is the cubic Bezier curve of control points the vertex j, (controls[0, j], controls[1, j]), (controls[2, j], controls[3, j]) and the vertex j+1, or a segment if its column of controls is NaN.MF = MesherObject('intersect', MesherObject object1 , MesherObject object2, ...)Intersection of several objects.MF = MesherObject('union', MesherObject object1 , MesherObject object2, ...)Union of several objects.MF = MesherObject('set minus', MesherObject object1 , MesherObject object2, ...)Geometric object being object1 minus object2 (minus the union of object2, object3, … when more objects are given).MF = MesherObject('extrusion', MesherObject object2d, scalar z0, scalar z1)3D object obtained by extruding the 2D object object2d along the z axis, between z = z0 and z = z1.MF = MesherObject('revolution', MesherObject object2d)3D object obtained by the revolution about the z axis of the 2D object object2d, given in the (r, z) half plane (r >= 0). The parts of object2d with r < 0 are ignored.MF = MesherObject('placed', MesherObject object, vec origin, vec axis1[, vec axis2])The object object, given in a local frame, placed with the origin of its frame at origin and its first axes along axis1 (and axis2 in 3D; the third one is axis1 x axis2): a rigid motion. The axes are orthonormalized (axis2 is made orthogonal to axis1). For instance, an extrusion of a 2D object in any plane.
- char()¶
Output a (unique) string representation of the MesherObject.
This can be used to perform comparisons between two different MesherObject objects. This function is to be completed.
- display()¶
displays a short summary for a MesherObject object.
- distance(PTS)¶
The signed distance of the MesherObject at the points PTS (one point per column): negative inside, zero on its boundary (not exactly the euclidean distance for every object, see the mesher).
- project(PTS)¶
The points PTS (one point per column) projected on the boundary of the MesherObject (on its zero level, by Newton iterations along the gradient of its signed distance), e.g. the new boundary nodes of a refined mesh. A point already on it stays; a point whose projection fails stays too.
