mcneel / compute.rhino3d.appserver

A node.js server for solving Grasshopper definitions on Rhino Compute
116 stars 207 forks source link

Hosting FEA tool on Compute #78

Closed Marco-Pellegrino closed 3 years ago

Marco-Pellegrino commented 3 years ago

Hello.

I am trying to explore the use of a web app to solve some simple FEA Grasshopper model but I am having some issue. The tool required to run an external application (I do it with subprocess) from which we can read an output file. Is it possible? I am getting this error message but I am not able to get any tip.

image

sbaer commented 3 years ago

What does you python script look like?

Marco-Pellegrino commented 3 years ago

Hi Steve!

Thanks for jumping in.

I am posting here the Grasshopper script in case you want to have a better look and try your self. I am going to do a bit of debugging my self deleleting some component until I do understand where the issue is happening.

It requires to download Alpaca4d tool (which I have attached to this thread). Remember to unblock the file and to install the tool inside a Folder called "Alpaca4d".

I have tried to summarise what the tool is trying to do in the picture below. I hope it makes sense.

image

FabianEidnerVase.zip

Alpaca4d.zip

Marco-Pellegrino commented 3 years ago

The error seems to happen in the "assemble" component. The latest output that I can get without any error is when I remove that part.

You can look inside the code of the assemble if you want.

I have converted the output of the other component to a string and convert in mesh to visualise that the others component return an output. image

Marco-Pellegrino commented 3 years ago

Hi @sbaer @pearswj Sorry if I am going to make a silly question but I am trying to understand why the script is failing.

Is rhino.compute able to use ALL the rhinoCommon function?

for example:

Can I use "import ghpythonlib.components as ghcomp"? Can I use Rhino.Geometry.RTree ?

sbaer commented 3 years ago

You can use most of RhinoCommon and ghpythonlib. The area you should stay away from are RhinoDoc and it's views. There is typically no RhinoDoc when running headless

Marco-Pellegrino commented 3 years ago

thanks @sbaer !!! The RhinoDoc makes me wonder where it could be the issue and it is finally working!!!!!

The issue was in rhinoscriptsintax. I was using rs.DocumentPath() to find the working folder but I have solved it using os.getcwd()

I am so glad we have managed to solve it! We can finally run some FEA on the web.

image