create_mesh#

sectionproperties.pre.pre.create_mesh(points: list[tuple[float, float]], facets: list[tuple[int, int]], holes: list[tuple[float, float]], control_points: list[tuple[float, float]], mesh_sizes: list[float] | float, min_angle: float, coarse: bool) dict[str, list[list[float]] | list[list[int]]][source]#

Generates a triangular mesh.

Creates a quadratic triangular mesh using the triangle module, which utilises the code Triangle, by Jonathan Shewchuk.

Parameters:
  • points (list[tuple[float, float]]) – List of points (x, y) defining the vertices of the cross-section

  • facets (list[tuple[int, int]]) – List of point index pairs (p1, p2) defining the edges of the cross-section

  • holes (list[tuple[float, float]]) – List of points (x, y) defining the locations of holes within the cross-section. If there are no holes, provide an empty list [].

  • control_points (list[tuple[float, float]]) – A list of points (x, y) that define different regions of the cross-section. A control point is an arbitrary point within a region enclosed by facets.

  • mesh_sizes (list[float] | float) – List of maximum element areas for each region defined by a control point

  • min_angle (float) – The meshing algorithm adds vertices to the mesh to ensure that no angle smaller than the minimum angle (in degrees, rounded to 1 decimal place). Note that small angles between input segments cannot be eliminated. If the minimum angle is 20.7 deg or smaller, the triangulation algorithm is theoretically guaranteed to terminate (given sufficient precision). The algorithm often doesn’t terminate for angles greater than 33 deg. Some meshes may require angles well below 20 deg to avoid problems associated with insufficient floating-point precision.

  • coarse (bool) – If set to True, will create a coarse mesh (no area or quality constraints)

Returns:

Dictionary containing mesh data

Return type:

dict[str, list[list[float]] | list[list[int]]]