# Rhino Vault - Materialization Script

**URL:** <https://forum.compas-framework.org/t/rhino-vault-materialization-script/1028>\
**Category:** compas\
**Created:** [May 1, 2025, 9:12am UTC](https://forum.compas-framework.org/t/rhino-vault-materialization-script/1028 "2025-05-01T09:12:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sushrut\_Shankar](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/sushrut_shankar/32/689_2.png) [@Sushrut\_Shankar](https://forum.compas-framework.org/u/Sushrut_Shankar)\
**Post date:** [May 1, 2025, 9:12am UTC](https://forum.compas-framework.org/t/rhino-vault-materialization-script/1028/1 "2025-05-01T09:12:53Z")

</div>

Hello there,

I have just recently started using the Rhino Vault from the Github tutorial and successfully reached the point where I was able to create the Roof’s Mesh I wanted.  
Now exploring the website - I came across the Materialization scripts provided ( Rhinovault\_session.json ) and wanted to know if its possible to somehow import the mesh I produced into that so I can get the divided hexagonal blocks with shear keys.

 ![Shell Output](https://us1.discourse-cdn.com/flex015/uploads/compas_framework1/original/1X/488f0b9fdbfb268c989d2d9a7d57e05d8da98f68.png)

---

<div class="post-metadata">

**Author:** ![petrasvestartas](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/petrasvestartas/32/305_2.png) [@petrasvestartas](https://forum.compas-framework.org/u/petrasvestartas)\
**Post date:** [May 2, 2025, 4:25pm UTC](https://forum.compas-framework.org/t/rhino-vault-materialization-script/1028/2 "2025-05-02T16:25:03Z")

</div>

Yes, did you try to follow the tutorial and save your rhino session file?

> **[Materialization | RhinoVAULT](https://blockresearchgroup.gitbook.io/rhinovault/next-steps/materialization)**

---

<div class="post-metadata">

**Author:** ![Sushrut\_Shankar](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/sushrut_shankar/32/689_2.png) [@Sushrut\_Shankar](https://forum.compas-framework.org/u/Sushrut_Shankar)\
**Post date:** [May 5, 2025, 9:28am UTC](https://forum.compas-framework.org/t/rhino-vault-materialization-script/1028/3 "2025-05-05T09:28:24Z")

</div>

Hey @petrasvestartas,  
Yes I did save the Rhino vault session of this roof.  
I am confused where do I input this saved session in the step by step  
tutorial provided.

---

<div class="post-metadata">

**Author:** ![petrasvestartas](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/petrasvestartas/32/305_2.png) [@petrasvestartas](https://forum.compas-framework.org/u/petrasvestartas)\
**Post date:** [May 5, 2025, 9:43am UTC](https://forum.compas-framework.org/t/rhino-vault-materialization-script/1028/4 "2025-05-05T09:43:14Z")

</div>

As gif shows it is in the same folder:

 ![](https://us1.discourse-cdn.com/flex015/uploads/compas_framework1/original/1X/a53098e7a908e20c2a2da04e953956a54f7d1016.jpeg)

The saved session file (json file) is referenced in the python script:

```python

#! python3
# venv: brg-csd
# r: compas_rv

import pathlib
import compas
from compas.scene import Scene

# =============================================================================
# Load data
# =============================================================================
IFILE = pathlib.Path( __file__ ).parent / "rhinovault_session.json"
rv_session = compas.json_load(IFILE)
rv_scene: Scene = rv_session["scene"]
pattern = rv_scene.find_by_name("Pattern").mesh

# =============================================================================
# Visualisation
# =============================================================================
scene = Scene()
scene.clear_context()
scene.add(rv_scene.find_by_name("Pattern").mesh)
scene.draw()

```

This line says that the session file is in the same folder as the python script:

```auto
IFILE = pathlib.Path( __file__ ).parent / "rhinovault_session.json"

```

---

<div class="post-metadata">

**Author:** ![Sushrut\_Shankar](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/sushrut_shankar/32/689_2.png) [@Sushrut\_Shankar](https://forum.compas-framework.org/u/Sushrut_Shankar)\
**Post date:** [May 5, 2025, 11:40am UTC](https://forum.compas-framework.org/t/rhino-vault-materialization-script/1028/5 "2025-05-05T11:40:39Z")

</div>

Hey @petrasvestartas, thanks for the promt reply.  
I tried saving my Rhino Vault Session under the same name " rhinovault\_session.json"  
even adding the “.Json” suffix and its working now.

Thanks for pointing that out.  
Out of the 12 steps  
I got to run the first 2 scripts of “000.Pattern” and "001.mesh " successfully.

The moment I tried the next script " 002.remesh " script it gave me an error.

 ![error](https://us1.discourse-cdn.com/flex015/uploads/compas_framework1/original/1X/aaf17317c8ea94e61ec23ee6d897bedc941415a2.jpeg)

How do I tackle this ?  
Do I need to know basic scripting in python to go ahead ?

---

<div class="post-metadata">

**Author:** ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)\
**Post date:** [May 6, 2025, 9:04am UTC](https://forum.compas-framework.org/t/rhino-vault-materialization-script/1028/6 "2025-05-06T09:04:53Z")

</div>

hi,

could you post the json file so i can run it locally?

thanks!

---

<div class="post-metadata">

**Author:** ![Sushrut\_Shankar](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/sushrut_shankar/32/689_2.png) [@Sushrut\_Shankar](https://forum.compas-framework.org/u/Sushrut_Shankar)\
**Post date:** [May 7, 2025, 2:27pm UTC](https://forum.compas-framework.org/t/rhino-vault-materialization-script/1028/7 "2025-05-07T14:27:11Z")

</div>

Hello Tom,  
Thanks for replying.  
I have been updating the form so had to wait before i send you the json file.  
This the what i have been working on.

 ![final roof form](https://us1.discourse-cdn.com/flex015/uploads/compas_framework1/original/1X/bfeba08ba5d70f4abec624c9d022804549132dfe.jpeg)  
Btw I am unable to upload the JSON file here  
so here’s a link - [RhinoVAULT - Roof -2\_vertical thrust with modifications - 4 - Google Drive](https://drive.google.com/file/d/1UTqaFbatSwkYqABo445F8VcwB94iRmSP/view?usp=sharing)

---

<div class="post-metadata">

**Author:** ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)\
**Post date:** [May 7, 2025, 6:56pm UTC](https://forum.compas-framework.org/t/rhino-vault-materialization-script/1028/8 "2025-05-07T18:56:30Z")

</div>

hi,

i haven’t looked at the details of the script in the RV docs, but i assume it uses an older version of the remeshing function.

here is an updated version that uses `compas_cgal` instead. you can just run it in VS Code in an environment that has both `compas_rv` and `compas_cgal` installed…

```python
import pathlib

from compas_cgal.meshing import mesh_remesh
from compas_viewer import Viewer

import compas
from compas.datastructures import Mesh
from compas.scene import MeshObject
from compas.scene import Scene

file = pathlib.Path( __file__ ).parent / "RhinoVAULT - Roof -2_vertical thrust with modifications - 4.json"

session = compas.json_load(file)

scene: Scene = session["scene"]
meshobj: MeshObject = scene.get_node_by_name("ThrustDiagram")
mesh: Mesh = meshobj.mesh

for face in list(mesh.faces_where(_is_loaded=False)):
    mesh.delete_face(face)

length = sum(mesh.edge_length(edge) for edge in mesh.edges()) / mesh.number_of_edges()
mesh.quads_to_triangles()

V, F = mesh.to_vertices_and_faces()
V, F = mesh_remesh((V, F), target_edge_length=length)

mesh = Mesh.from_vertices_and_faces(V, F)

viewer = Viewer()
viewer.scene.add(mesh)
viewer.show()

```

It should produce the following result (press F once the viewer pops up to zoom to the extents of the mesh)

 ![Screenshot 2025-05-07 at 20.53.03](https://us1.discourse-cdn.com/flex015/uploads/compas_framework1/original/1X/df676b2b0e81bd08f3f2bf774368c53c8f2891b2.jpeg)

let me know if you need help getting this to work. we will update the RV docs asap…
