From b8f8e53ef3c3aab25f4993338b8df0537fd5c9e6 Mon Sep 17 00:00:00 2001 From: Chris Mackey Date: Tue, 12 Dec 2023 13:46:49 -0800 Subject: [PATCH] fix(fromgeometry): Add method to extract wireframes from meshes --- ladybug_rhino/fromgeometry.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ladybug_rhino/fromgeometry.py b/ladybug_rhino/fromgeometry.py index e91d9f41..3c86f1a8 100644 --- a/ladybug_rhino/fromgeometry.py +++ b/ladybug_rhino/fromgeometry.py @@ -240,6 +240,21 @@ def from_polyface3d_to_wireframe(polyface): return [f for face in polyface.faces for f in from_face3d_to_wireframe(face)] +def from_mesh3d_to_wireframe(mesh): + """Rhino LineCurves from ladybug Mesh3D. + + Args: + mesh: A Ladybug Mesh3D object to be translated to a wireframe. + + Returns: + A list of Rhino polyline curves for the mesh edges. + """ + line_curves = [] + for edge in mesh.edges: + line_curves.append(rg.LineCurve(from_point3d(edge.p1), from_point3d(edge.p2))) + return line_curves + + def from_face3d_to_solid(face, offset): """Rhino Solid Brep from a ladybug Face3D and an offset from the base face.