From c01665ba0ee0b80c9e836ccc6fa9a7cefdc82d6c Mon Sep 17 00:00:00 2001 From: tomvanmele Date: Wed, 11 Sep 2024 10:55:33 +0200 Subject: [PATCH] add project --- plugin/COMPAS-Masonry.rhproj | 22 ++++++++++++++-- plugin/Masonry_model.py | 50 ++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 plugin/Masonry_model.py diff --git a/plugin/COMPAS-Masonry.rhproj b/plugin/COMPAS-Masonry.rhproj index 53cc7d1..5b2005b 100644 --- a/plugin/COMPAS-Masonry.rhproj +++ b/plugin/COMPAS-Masonry.rhproj @@ -2,7 +2,7 @@ "id": "4384e04f-2997-429b-b3fc-53e7fe78703e", "identity": { "name": "COMPAS-Masonry", - "version": "0.1.1", + "version": "0.1.1-beta", "publisher": { "email": "tom.v.mele@gmail.com", "name": "Tom Van Mele", @@ -36,7 +36,13 @@ "version": "3.*.*" }, "title": "Masonry", - "uri": "Masonry.py" + "uri": "Masonry.py", + "image": { + "light": { + "type": "svg", + "data": "PHN2ZyBpZD0iT1BFTl94NUZfU0FWRSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMzIgMzIiPgo8L3N2Zz4=" + } + } }, { "id": "04447f90-ccb1-40dd-b091-723956a0b949", @@ -119,5 +125,17 @@ "title": "Masonry_reqs_install", "uri": "Masonry_reqs_install.py" } + ], + "libraries": [ + { + "type": "uri", + "library": { + "base": "file:///Users/vanmelet/Code/compas-Masonry/src/compas_masonry/", + "language": { + "id": "*.*.python", + "version": "3.*.*" + } + } + } ] } \ No newline at end of file diff --git a/plugin/Masonry_model.py b/plugin/Masonry_model.py new file mode 100644 index 0000000..b3d009f --- /dev/null +++ b/plugin/Masonry_model.py @@ -0,0 +1,50 @@ +#! python3 + +import rhinoscriptsyntax as rs # type: ignore + +from compas_session.namedsession import NamedSession + + +def RunCommand(is_interactive): + + session = NamedSession(name="COMPAS-Masonry") + + scene = session.scene() + + # ============================================================================= + # Remove existing model + # ============================================================================= + + # ============================================================================= + # Make new model + # ============================================================================= + + options = ["RhinoBreps", "RhinoMeshes", "MeshGrid", "JSON", "OBJ"] + option = rs.GetString("Make a Masonry Model", strings=options) + if not option: + return + + if option == "RhinoBreps": + pass + + elif option == "RhinoMeshes": + pass + + else: + raise NotImplementedError + + # ============================================================================= + # Update scene + # ============================================================================= + + # ============================================================================= + # Save session + # ============================================================================= + + +# ============================================================================= +# Run as main +# ============================================================================= + +if __name__ == "__main__": + RunCommand(True)