volmesh_planarise
- compas_3gs.algorithms.volmesh_planarise(volmesh, kmax=100, target_centers={}, target_normals={}, target_areas={}, fix_vkeys=[], fix_boundary_normals=False, fix_all_normals=False, min_area=None, max_area=None, tolerance_flat=0.001, tolerance_area=0.001, tolerance_perp=0.001, callback=None, callback_args=None, print_result_info=False)[source]
Planarises the halffaces of a volmesh.
Planarisation of a volmesh is implemented as a three-step iterative procedure. At every iteration, each halfface is first individually projected to its best-fit plane (unless a target normal is given). Then, each halfface is re-sized to its target area (if given). Finally, the new vertex coordinates are computed by taking the centroid of the disconnected corners of the halffaces.
- Parameters
volmesh (VolMesh) – A volmesh object.
kmax (int, optional [100]) – Number of iterations.
target_face_areas (dictionary, optional [{}]) – A dictionary of fkeys and target areas.
target_face_normals (dictionary, optional [{}]) – A dictionary of fkeys and target face normals.
target_face_centers (dictionary, optional [{}]) – A dictionary of fkeys and target face centers.
omit_vkeys (list, optional [[]]) – List of vkeys to omit from arearisation.
fix_boundary_face_normals (boolean, optional [False]) – Whether to keep the initial normals of the bondary faces.
fix_all_face_normals (boolean, optional [False]) – Whether to keep the initial normals of all faces.
tolerance_flat (float, optional) – Convergence tolerance for face flatness.
tolerance_area (float, optional) – Convergence tolerance for face areas against target areas.
tolerance_perp (float, optional) – Convergence tolerance for face perpendicularity against target normals.
callback (callable, optional) – A user-defined callback function to be executed after every iteration. Default is
None
.callback_args (tuple, optional) – Additional parameters to be passed to the callback. Default is
None
.print_result_info (bool, optional) – If True, print the result of the algorithm.
- Raises
Exception – If a callback is provided, but it is not callable.
.. seealso :: – compas.geometry.mesh_planarize_faces