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.
Yes, did you try to follow the tutorial and save your rhino session file?
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.
As gif shows it is in the same folder:
The saved session file (json file) is referenced in the python script:
#! 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:
IFILE = pathlib.Path(__file__).parent / "rhinovault_session.json"
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.
How do I tackle this ?
Do I need to know basic scripting in python to go ahead ?
hi,
could you post the json file so i can run it locally?
thanks!
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.
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
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…
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)
let me know if you need help getting this to work. we will update the RV docs asap…