Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
In this final set of tutorials we will explore how RV2 can be extended by using the functionality of the underlying packages directly through basic Python scripting (in Rhino). The following topics will be addressed:
Assignment of variable thickness distributions using Scipy grid data interpolation (and recalculation of the equilibrium geometry for this updated self-weight).
Smoothing and refinement of the thrust surface for further processing and discretisation.
Generation of basic cut data for discretised vault/shell blocks.
For this discretisation exercise, we will use the form diagram and thrust surface resulting from a pattern designed "from freatures" and inspired by the geometry and boundary conditions of the British Museum. We will generate a tessellation based on the dual of a remeshed triangulation of the thrust surface.
We will do this in small incremental steps using JSON files to store various updated versions of the Form Diagram mesh and communicate between parts of the procedure.
To avoid having to process the session file over and over again to extract the information about the form diagram, we export the Form Diagram data to a separate JSON file (form.json
) that can then be used as input instead. We also draw the form diagram as a simple mesh in Rhino.
After exporting the data we can create the form diagram as follows.
To triangulate the Form Diagram mesh we can simply convert all quads to triangles. Note that the quality of the resulting mesh is not considered in this step. This is okay because we will still improve mesh quality through remeshing.
For the remeshing we will use compas_cgal
. The underlying remeshing function in CGAL is documented here: https://doc.cgal.org/latest/Polygon_mesh_processing/index.html#title7
We will remesh in VS Code using the COMPAS viewer for visualisation, and again export the result to JSON to continue working with the remeshed triangulation in Rhino. The result is available for download at the bottom of this page.
Note that you could also do this directly from Rhino using the RPC cloud. However, the current procedure illustrates an alternative workflow using CPython directly in an editor outside of Rhino.
RV2 bundles the following COMPAS packages
When you install RV2 using the installer, these packages are installed in a miniconda environment and registered in Rhino. It is the same as the "normal" installation process of COMPAS packages, but automated. Also the command plugin is installed with an automated version of the typical installation process for COMPAS-based Rhino command plugins.
This means that the COMPAS packages listed above (with the exception of compas_triangle
) are also available in the Rhino PythonScript Editor. To verify this, simply open the editor and run the following snippet:
Note that Rhino uses IronPython 2.7.8
. Therefore print statements are still in the "old" Python 2x format...
In this final tutorial, we will use these packages to extend the functionality of RV2 with custom Python scripts. For communication between these scripts and RV2, we will use the *.rv2
session files.
To load a Form Diagram from a RV2 session file and visualise it in a script, you could do the following:
Save the script in the same directoy as the session file ('bm-3.rv2'
), or provide the full path to the session file. Otherwise Rhino will not be able to find it.
To extract information from the Form Diagram you can simply use the typical COMPAS mechanisms for extracting data out of meshes.
Using the data and attribute "accessors", we can for example extract the values of the reaction forces at the supports, or the axial forces in the edges.
With this we can, for example, compute a rough approximation of the (lumped) stress at the nodes.