diff --git a/CHANGELOG.md b/CHANGELOG.md index 43790d1..df3b724 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +* Changed the RhinoCode command requirements to `compas_rv >=0.10.0`. + ### Added ### Changed diff --git a/README.md b/README.md index c5fde9f..6cdda8d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # RhinoVAULT > [!NOTE] -> The current version of RhinoVAULT on the Rhino Yak package server is `0.5.34.9081`. +> The current version of RhinoVAULT can be downloaded through the Rhino Yak package. > Note that this is still a pre-release! ![RhinoVAULT](compas-RV.jpg) diff --git a/commands/RV.py b/commands/RV.py index 7112bdd..576403d 100644 --- a/commands/RV.py +++ b/commands/RV.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import pathlib diff --git a/commands/RV_dem_blocks.py b/commands/RV_dem_blocks.py index 32906dd..1cd6e94 100644 --- a/commands/RV_dem_blocks.py +++ b/commands/RV_dem_blocks.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import rhinoscriptsyntax as rs # type: ignore from compas_dem.models import BlockModel diff --git a/commands/RV_envelope.py b/commands/RV_envelope.py index 9d8e4f5..0d041ab 100644 --- a/commands/RV_envelope.py +++ b/commands/RV_envelope.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import rhinoscriptsyntax as rs # type: ignore diff --git a/commands/RV_force.py b/commands/RV_force.py index 60e11dc..8b3e50e 100644 --- a/commands/RV_force.py +++ b/commands/RV_force.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import rhinoscriptsyntax as rs # type: ignore diff --git a/commands/RV_force_modify.py b/commands/RV_force_modify.py index e5dd290..c05405f 100644 --- a/commands/RV_force_modify.py +++ b/commands/RV_force_modify.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import rhinoscriptsyntax as rs # type: ignore diff --git a/commands/RV_force_solve.py b/commands/RV_force_solve.py index aa6f246..e38f0b1 100644 --- a/commands/RV_force_solve.py +++ b/commands/RV_force_solve.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import rhinoscriptsyntax as rs # type: ignore diff --git a/commands/RV_form.py b/commands/RV_form.py index e78752a..96c04b1 100644 --- a/commands/RV_form.py +++ b/commands/RV_form.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import rhinoscriptsyntax as rs # type: ignore diff --git a/commands/RV_form_modify.py b/commands/RV_form_modify.py index 4f16cd5..cbbb152 100644 --- a/commands/RV_form_modify.py +++ b/commands/RV_form_modify.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import rhinoscriptsyntax as rs # type: ignore diff --git a/commands/RV_loads.py b/commands/RV_loads.py index 6818592..d51ed9e 100644 --- a/commands/RV_loads.py +++ b/commands/RV_loads.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import rhinoscriptsyntax as rs # type: ignore diff --git a/commands/RV_pattern.py b/commands/RV_pattern.py index 8be3777..e317492 100644 --- a/commands/RV_pattern.py +++ b/commands/RV_pattern.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import rhinoscriptsyntax as rs # type: ignore diff --git a/commands/RV_pattern_boundaries.py b/commands/RV_pattern_boundaries.py index 9a3744d..8821289 100644 --- a/commands/RV_pattern_boundaries.py +++ b/commands/RV_pattern_boundaries.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import rhinoscriptsyntax as rs # type: ignore diff --git a/commands/RV_pattern_modify.py b/commands/RV_pattern_modify.py index f6e85d0..8c328e1 100644 --- a/commands/RV_pattern_modify.py +++ b/commands/RV_pattern_modify.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import rhinoscriptsyntax as rs # type: ignore diff --git a/commands/RV_pattern_relax.py b/commands/RV_pattern_relax.py index eb202ef..bd46fcb 100644 --- a/commands/RV_pattern_relax.py +++ b/commands/RV_pattern_relax.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import rhinoscriptsyntax as rs # type: ignore diff --git a/commands/RV_pattern_supports.py b/commands/RV_pattern_supports.py index c273fe9..cef4727 100644 --- a/commands/RV_pattern_supports.py +++ b/commands/RV_pattern_supports.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import rhinoscriptsyntax as rs # type: ignore diff --git a/commands/RV_scene_clear.py b/commands/RV_scene_clear.py index 6919fe9..30c55d7 100644 --- a/commands/RV_scene_clear.py +++ b/commands/RV_scene_clear.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 from compas_rv.session import RVSession diff --git a/commands/RV_scene_redraw.py b/commands/RV_scene_redraw.py index 5c79035..3d61957 100644 --- a/commands/RV_scene_redraw.py +++ b/commands/RV_scene_redraw.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import rhinoscriptsyntax as rs # type: ignore diff --git a/commands/RV_session_export.py b/commands/RV_session_export.py index 5fe4e43..49febb3 100644 --- a/commands/RV_session_export.py +++ b/commands/RV_session_export.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import pathlib diff --git a/commands/RV_session_open.py b/commands/RV_session_open.py index b71ed83..ef19c2d 100644 --- a/commands/RV_session_open.py +++ b/commands/RV_session_open.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import pathlib diff --git a/commands/RV_session_redo.py b/commands/RV_session_redo.py index 33edb31..8ff9ca3 100644 --- a/commands/RV_session_redo.py +++ b/commands/RV_session_redo.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 from compas_rv.session import RVSession diff --git a/commands/RV_session_save.py b/commands/RV_session_save.py index c478881..7b07394 100644 --- a/commands/RV_session_save.py +++ b/commands/RV_session_save.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import pathlib diff --git a/commands/RV_session_undo.py b/commands/RV_session_undo.py index 00c1ecf..9da5b92 100644 --- a/commands/RV_session_undo.py +++ b/commands/RV_session_undo.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 from compas_rv.session import RVSession diff --git a/commands/RV_settings.py b/commands/RV_settings.py index 1417daa..1d0bb93 100644 --- a/commands/RV_settings.py +++ b/commands/RV_settings.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import rhinoscriptsyntax as rs # type: ignore from pydantic import BaseModel diff --git a/commands/RV_thrust_info.py b/commands/RV_thrust_info.py index ba12f5b..fc4b05d 100644 --- a/commands/RV_thrust_info.py +++ b/commands/RV_thrust_info.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 from compas_rui.forms.meshinfo import MeshInfoForm from compas_rv.session import RVSession diff --git a/commands/RV_thrust_modify.py b/commands/RV_thrust_modify.py index 6855f2f..d8c1ae3 100644 --- a/commands/RV_thrust_modify.py +++ b/commands/RV_thrust_modify.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import rhinoscriptsyntax as rs # type: ignore diff --git a/commands/RV_tna_horizontal.py b/commands/RV_tna_horizontal.py index 4238209..27e67a8 100644 --- a/commands/RV_tna_horizontal.py +++ b/commands/RV_tna_horizontal.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import rhinoscriptsyntax as rs # type: ignore # type: ignore diff --git a/commands/RV_tna_vertical.py b/commands/RV_tna_vertical.py index c5987b4..23f1a71 100644 --- a/commands/RV_tna_vertical.py +++ b/commands/RV_tna_vertical.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import rhinoscriptsyntax as rs # type: ignore diff --git a/commands/RV_tno_analysis.py b/commands/RV_tno_analysis.py index f030bd5..226ddd9 100644 --- a/commands/RV_tno_analysis.py +++ b/commands/RV_tno_analysis.py @@ -1,6 +1,6 @@ #! python3 # venv: brg-csd -# r: compas_rv>=0.9.5 +# r: compas_rv>=0.10.1 import numpy as np import rhinoscriptsyntax as rs # type: ignore @@ -11,6 +11,7 @@ from compas_rv.session import RVSession from compas_rv.solvers import update_force_from_form from compas_tna.envelope import MeshEnvelope +from compas_tna.envelope import ParametricEnvelope OBJECTIVES = [ "MinimumThrust", @@ -22,12 +23,13 @@ ] -def get_optimisation_options(objective): +def get_optimisation_options(objective, envelope): constraint_options = [ ("Funicular", True), ("Envelope", objective != "Bestfit"), - ("ReactionDirections", False), ] + if isinstance(envelope, ParametricEnvelope): + constraint_options.append(("ReactionDirections", False)) constraint_options = rs.CheckListBox(constraint_options, "Validate the constraints of the optimisation.", "TNO Constraints") if constraint_options is None: return @@ -265,12 +267,7 @@ def RunCommand(): if not objective: return - solver = rs.GetString("Solver", session.settings.tno.solver, ["SLSQP", "IPOPT"]) - if not solver: - return - session.settings.tno.solver = solver - - options = get_optimisation_options(objective) + options = get_optimisation_options(objective, envelope) if not options: return constraints, variables = options @@ -286,6 +283,8 @@ def RunCommand(): try: # Apply the envelope bounds and use the loads prepared on the FormDiagram. envelope.apply_bounds_to_formdiagram(formobject.diagram) + if "reac_bounds" in constraints: + analysis.apply_reaction_bounds() if abs(sum(formobject.diagram.vertices_attribute("pz"))) < 0.001: return session.warn("There are no loads applied to the FormDiagram. Use RV_loads before running TNO analysis.") diff --git a/requirements.txt b/requirements.txt index f5e5780..dc30c69 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,11 @@ compas >=2.13 -compas_cgal >=0.9.1 +compas_cgal >=0.9.2 compas_dem >=0.3.3 compas_libigl >=0.7.4 compas_rui >=0.5.1 compas_session >=0.5.5 compas_skeleton -compas_tna >=0.5 +compas_tna >=0.8.0 compas_tno >=0.4.0 compas_triangle >=1.2.1 tessagon