Closed daariioo closed 1 year ago
It seems that your JSON file has some problems. Can you share more details on how you created it? Did you use this script?
Yes, I did use this script. The obtained .json files are already attached as .txt files (GitHub didn't allow me to upload .json files). test10 is the one in pretty, test11 the normal one.
I still can't reproduce your problem.
Can you provide more detail about your:
My code environment looks as follows:
For exporting the file, I first construct the two blocks in Rhino. Then I create a mesh using the polygon mesh command in Rhino. With the provided script, I select the meshes and export them to the .json file.
Thanks for helping me, and please let me know when you need more information.
Can you also provide your Rhino file?
Of course, here it is:
import compas
import rhinoscriptsyntax as rs
from compas_rhino import select_meshes
from compas_cra.datastructures import CRA_Assembly
HERE = os.path.abspath(os.path.dirname(__file__))
PATH = os.path.abspath(os.path.join(HERE, "..", "data"))
guid = select_meshes()
assembly = CRA_Assembly()
assembly.add_blocks_from_rhinomeshes(guid)
filename = rs.GetString("file name (xxx.json):")
file_o = os.path.join(PATH, filename)
compas.json_dump(assembly, file_o,pretty=True)
print("file save to: ", file_o)
Oh, I meant the rhino .3dm file so I can try the geometry you created. 😃
Oh, sorry! In the meanwhile, I've tried out different approaches without any success. Therefore, the Blocks could have moved a little, but the file itself is the same. CRA_Rhino_Test.zip
The mesh geometry in your Rhino file is not clean, so that's why it didn't work. To make it work for the current implementation, two things in your model need to be fixed:
WeldVertices
to make sure there are no duplicated vertices (The mesh must be closed mesh, and all vertices are merged for the solver to solve it.)Additionally, in the current implementation, it's better to make the model smaller and closer to the original to have a better solver's solvability. (Similar scale to those in the CRA examples)
Thanks a lot for helping! The simple model works now, and I can start testing more complicated stuff. :)
Hi,
I'm trying to export a simple two block model out of Rhino. For exporting the geometry, I stick to the tutorial provided on the documentation site. When continuing in VS Code, I still continue as shown in the tutorial, as you can see below. When I try to solve the assembly using cra_solve, the following error occured: "IndexError: index(71) out of range". Does someone know why I run into this error? Below you can find my VS Code and attached there are .txt files (.json not supported to upload) of the two blocks (test10 in pretty and test11 in normal).
Thanks in advance and best, Dario
import os
import compas
import compas_cra
from compas_cra.datastructures import CRA_Assembly
from compas_cra.algorithms import assembly_interfaces_numpy
from compas_cra.equilibrium import cra_solve
from compas_cra.viewers import cra_view
FILE_I = os.path.join(compas_cra.DATA, "test11.json")
assembly = compas.json_load(FILE_I)
assembly = assembly.copy(cls=CRA_Assembly)
assembly.set_boundary_conditions([0])
assembly_interfaces_numpy(assembly)
cra_solve(assembly, verbose=True, timer=True)
cra_view(assembly, resultant=False, nodal=True, grid=True)
test10.txt test11.txt