Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

* Added a proper RhinoEnvelopeObject to treat the Envelope
* Bumped versions at string req and added option to control min_lb in dome

### Changed

### Removed
Expand Down
2 changes: 1 addition & 1 deletion commands/RV.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

import pathlib

Expand Down
2 changes: 1 addition & 1 deletion commands/RV_dem_blocks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

import rhinoscriptsyntax as rs # type: ignore
from compas_dem.models import BlockModel
Expand Down
23 changes: 6 additions & 17 deletions commands/RV_envelope.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

import rhinoscriptsyntax as rs # type: ignore

Expand All @@ -17,9 +17,6 @@
from compas_tna.envelope import PointedVaultEnvelope


ENVELOPE_LAYER = "RhinoVAULT::Envelope"


def get_location():
option = rs.GetString("Envelope location", "Origin", ["Origin", "Coordinates", "Point"])
if not option:
Expand Down Expand Up @@ -133,8 +130,10 @@ def get_dome():
r_oculus = rs.GetReal("Oculus radius", 0.5, minimum=0.0)
if r_oculus is None or r_oculus >= radius:
return
return DomeEnvelope(center=center, radius=radius, thickness=thickness, n_hoops=40, n_parallels=40, r_oculus=r_oculus)

min_lb = rs.GetReal("Minimum z range of supports (positive downwards)", 0.5, minimum=0.0)
if min_lb is None:
return
return DomeEnvelope(center=center, radius=radius, thickness=thickness, n_hoops=40, n_parallels=40, r_oculus=r_oculus, min_lb=min_lb)

def get_from_middle():
guid = compas_rhino.objects.select_mesh("Select middle mesh")
Expand Down Expand Up @@ -237,17 +236,7 @@ def RunCommand():
envelope.rho_fill = rho_fill

session.clear_envelope(redraw=False)
session["envelope"] = envelope

settings = session.settings.envelope
if envelope.intrados:
session.scene.add(envelope.intrados, disjoint=True, show=settings.show_intrados, name="Intrados", layer=ENVELOPE_LAYER)
if envelope.middle:
session.scene.add(envelope.middle, disjoint=True, show=settings.show_middle, name="Middle", layer=ENVELOPE_LAYER)
if envelope.extrados:
session.scene.add(envelope.extrados, disjoint=True, show=settings.show_extrados, name="Extrados", layer=ENVELOPE_LAYER)
if envelope.fill:
session.scene.add(envelope.fill, disjoint=True, show=settings.show_fill, name="Fill", layer=ENVELOPE_LAYER)
session.add_envelope(envelope)

session.scene.redraw()
rs.Redraw()
Expand Down
2 changes: 1 addition & 1 deletion commands/RV_force.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

import rhinoscriptsyntax as rs # type: ignore

Expand Down
2 changes: 1 addition & 1 deletion commands/RV_force_modify.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

import rhinoscriptsyntax as rs # type: ignore

Expand Down
2 changes: 1 addition & 1 deletion commands/RV_force_solve.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

import rhinoscriptsyntax as rs # type: ignore

Expand Down
2 changes: 1 addition & 1 deletion commands/RV_form.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

import rhinoscriptsyntax as rs # type: ignore

Expand Down
2 changes: 1 addition & 1 deletion commands/RV_form_modify.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

import rhinoscriptsyntax as rs # type: ignore

Expand Down
7 changes: 4 additions & 3 deletions commands/RV_loads.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

import rhinoscriptsyntax as rs # type: ignore

Expand Down Expand Up @@ -42,9 +42,10 @@ def RunCommand():
envelope = None

if option in ("FromEnvelope", "FromFill"):
envelope = session.find_envelope()
if not envelope:
envelopeobject = session.find_envelope()
if not envelopeobject:
return
envelope = envelopeobject.envelope

if option == "FromEnvelope":
normalize = rs.GetString("Normalize loads to envelope self-weight", "Yes", ["Yes", "No"])
Expand Down
2 changes: 1 addition & 1 deletion commands/RV_pattern.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

import rhinoscriptsyntax as rs # type: ignore

Expand Down
2 changes: 1 addition & 1 deletion commands/RV_pattern_boundaries.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0


import rhinoscriptsyntax as rs # type: ignore
Expand Down
2 changes: 1 addition & 1 deletion commands/RV_pattern_modify.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

import rhinoscriptsyntax as rs # type: ignore

Expand Down
2 changes: 1 addition & 1 deletion commands/RV_pattern_relax.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

import rhinoscriptsyntax as rs # type: ignore

Expand Down
2 changes: 1 addition & 1 deletion commands/RV_pattern_supports.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

import rhinoscriptsyntax as rs # type: ignore

Expand Down
2 changes: 1 addition & 1 deletion commands/RV_scene_clear.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

from compas_rv.session import RVSession

Expand Down
2 changes: 1 addition & 1 deletion commands/RV_scene_redraw.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

import rhinoscriptsyntax as rs # type: ignore

Expand Down
2 changes: 1 addition & 1 deletion commands/RV_session_export.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

import pathlib

Expand Down
6 changes: 5 additions & 1 deletion commands/RV_session_open.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

import pathlib

Expand All @@ -22,6 +22,7 @@ def RunCommand():
pattern = session.find_pattern(warn=False)
form = session.find_formdiagram(warn=False)
force = session.find_forcediagram(warn=False)
envelope = session.find_envelope(warn=False)

if pattern:
pattern.layer = "RhinoVAULT::Pattern"
Expand All @@ -32,6 +33,9 @@ def RunCommand():
if force:
force.layer = "RhinoVAULT::ForceDiagram"

if envelope:
envelope.layer = "RhinoVAULT::Envelope"

if form and force:
form.diagram.dual = force.diagram
force.diagram.primal = form.diagram
Expand Down
2 changes: 1 addition & 1 deletion commands/RV_session_redo.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

from compas_rv.session import RVSession

Expand Down
2 changes: 1 addition & 1 deletion commands/RV_session_save.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

import pathlib

Expand Down
2 changes: 1 addition & 1 deletion commands/RV_session_undo.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

from compas_rv.session import RVSession

Expand Down
2 changes: 1 addition & 1 deletion commands/RV_settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

import rhinoscriptsyntax as rs # type: ignore
from pydantic import BaseModel
Expand Down
2 changes: 1 addition & 1 deletion commands/RV_thrust_info.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

from compas_rui.forms.meshinfo import MeshInfoForm
from compas_rv.session import RVSession
Expand Down
2 changes: 1 addition & 1 deletion commands/RV_thrust_modify.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

import rhinoscriptsyntax as rs # type: ignore

Expand Down
2 changes: 1 addition & 1 deletion commands/RV_tna_horizontal.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0


import rhinoscriptsyntax as rs # type: ignore # type: ignore
Expand Down
5 changes: 4 additions & 1 deletion commands/RV_tna_vertical.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0


import rhinoscriptsyntax as rs # type: ignore
Expand Down Expand Up @@ -52,6 +52,9 @@ def RunCommand():

# Redraw the form diagram to show the updated 3D geometry
form.redraw()
envelope = session.find_envelope(warn=False)
if envelope:
envelope.redraw()

print("Vertical equilibrium found!")
print("FormDiagram object updated with target height of {}.".format(zmax))
Expand Down
8 changes: 5 additions & 3 deletions commands/RV_tno_analysis.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! python3
# venv: brg-csd
# r: compas_rv>=0.10.1
# r: compas_rv>=0.11.0

import numpy as np
import rhinoscriptsyntax as rs # type: ignore
Expand Down Expand Up @@ -259,9 +259,10 @@ def RunCommand():
if not formobject:
return

envelope = session.find_envelope()
if not envelope:
envelopeobject = session.find_envelope()
if not envelopeobject:
return
envelope = envelopeobject.envelope

objective = rs.GetString("TNO objective", "MinimumThrust", OBJECTIVES)
if not objective:
Expand Down Expand Up @@ -311,6 +312,7 @@ def RunCommand():

rs.UnselectAllObjects()
formobject.redraw()
envelopeobject.redraw()
if forceobject:
forceobject.redraw()

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ compas_libigl >=0.7.4
compas_rui >=0.5.1
compas_session >=0.5.5
compas_skeleton
compas_tna >=0.8.0
compas_tna >=0.9.0
compas_tno >=0.4.0
compas_triangle >=1.2.1
tessagon
3 changes: 3 additions & 0 deletions src/compas_rv/scene/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from compas.plugins import plugin
from compas.scene.context import register
from compas_tna.envelope import Envelope

from compas_rv.datastructures import ForceDiagram, FormDiagram, Pattern

from .envelopeobject import RhinoEnvelopeObject
from .forceobject import RhinoForceObject
from .formobject import RhinoFormObject
from .patternobject import RhinoPatternObject
Expand All @@ -13,3 +15,4 @@ def register_scene_objects_rhino():
register(Pattern, RhinoPatternObject, context="Rhino")
register(FormDiagram, RhinoFormObject, context="Rhino")
register(ForceDiagram, RhinoForceObject, context="Rhino")
register(Envelope, RhinoEnvelopeObject, context="Rhino")
Loading
Loading