Grasshopper

algorithmic modeling for Rhino

Hello,

I'm working through a uni project in which I'm trying to use Numpy (Numerical Python; one of software for the Python) in Rhino. 

But I am not sure that I can use software for the Python programming language in Rhino.Python.

If you guys already know how to use install software in Rhino, please give some advice.

Thanks in advance for any advice!

TOM

Views: 832

Replies to This Discussion

It is (or at least was) possible to install and run Numpy on 32 Bit Rhino, but it has never exactly been straightforward (search this forum and the discourse forum, there are several posts on this subject and the rabbit hole goes deep). The reason being that Rhino uses the .NET version of Python, known as IronPython (i.e. not CPython for which Numpy is targeted). You'll therefore often likely have more luck implementing a .NET library instead. Depending on your problem, you might be able to use Math.Net instead of Numpy/Scipy.

Thank you for your help. Anders Holden Deleuran

I would like to use Numpy for using F2PY. This F2PY is one of Numpy's functions. If I'll be able to install Numpy, I could call fortran programming language through F2PY like Python can do.

I already made a programing for form-finding analysis using Fortran. I am trying to simulate a movement using this analysis. That's why I really want to connect IronPython and Fortran.

If you come up with some solutions, could you give me some advice? Thanks in advance. 

While it might be possible, I suspect you'll have a seriously hard time getting it working. Basically, IronPython will work well with most pure Python libraries (i.e. written in 100% Python) AND most .NET libraries. The issue with things like Numpy is that they depend on C and Fortran libraries on the backend. And while it is possibly to for instance implement managed C++ libraries in GHPython (using the ctypes module, which is part of the standard Python modules), it is really rather cumbersome. The point is, you'll likely have to do some really deep digging and gluing which might end up becoming pretty brittle. So depending on how large your library is, the path of least resistance might actually be to rewrite it in .NET friendly language (which would definitely also be the way to go, if you plan to share your work with the community at some point). Sorry to only have "bad" news for you ;)

Edit: I would really recommend going through the threads Giulio links to in my second link above, for a very thorough insight as to why running Numpy with GHPython might never be tractable. 

Thank you for your help. Anders Holden Deleuran

I really appreciate everything you that did for me.

I understand how difficult it is to finish this project which I am trying to do. I would like to change a way to do this work. 

All I need to do is to use my code written in Fortran programming language.

(If I cannect this code with any other sofewares, I will print out results on note or Excell file. And Use input this file in Rhino. )

But if you have some ideas, coud you share with me? 

Thank you for all your efforts.

I think we'd need a bit more insight to offer more help. That said, if you run your Fortran code outside of Rhino/Grasshopper, it is pretty straightforward to load in the data it produces as, say, tabular data (in a .CSV for instance). They're might also be more "live" methods of connecting the two environments (COM etc.).

I really appreciate everything you that did for me. Anders Holden Deleuran

Actually, I would like to develop initial design support system for architect using Rhino. Using my code in fortran, Architect creat the shape of the structure with cinsideration for the equilibrium equation.

->> Creat Graphical interfaces in rhino. 

So I prefer connecting fortran with Rhino rather than compiling fortran and showing results in rhino.

Hi Anders,

I'm planning to use numpy and scipy to solve a sparse system in Rhino 64-bit. I follow the tutorial about how to use numpy and scipy in Rhino, but it only works in 32-bit, and the scipy doesn't provide sparse module. I have tried to search other tutorial, but it seems that all solutions are dependent on the egg files of Enthought, which are never updated since 2011.

Does this mean that it is almost impossible to use numpy and scipy in Grasshopper of Rhino 64-bit? 

What's more, would you recommend some tutorials or example codes of Math.Net. I have tried it, but I can't understand how to configure the sparse solver.

Thanks a lot for your help.

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service