8/01/2017

Gh_CPython Alpha Release !!

Finally!
I managed to finish the Alpha release of Gh_CPython plugin for Grasshopper, and I have used it to create the first plugin (NumpyZerosMatrix) as shown in the image.

GH_CPython, is an CPython plugin for grasshopper. By using it, it is possible to run any sophisticated Python libraries inside grasshopper, such as:  Numpy , scipy, matplotlib, scikitlearn, PyOpenGL, pygame, tensorflow, OpenCV and so on.

I look forward to being consistently developing it and enhancing its features and I'll be grateful to any one who is able to contribute to its development or testing.  and I hope that it will be useful to all users and developers' community.

The attached image shows CPython plugin(down right) , and the first implemented plugin (top right) and the code ide (left)

Feel free to download the plugin,  create new pull requests, submit bugs, comments or wishes on GitHub via this link:

https://lnkd.in/g-RcT4n

ResearchGate:
https://lnkd.in/gScUHgY

Food4Rhino:
https://lnkd.in/gA6QQ_P

I'm so much grateful to everyone who gave me feedback  and suggestions. Thanks so much.





7/13/2017

GHPythonINTERFACE: A Python IDE interface for Rhino\Grasshopper

Running Numpy, SciPy and matplotlib from Rhino and grasshopper has been very demanding problem to developers' community. In this respect, I'm trying to develop a new tool which is intended to be able to import all the required modules such as Numpy ans scipy without problems as well as integrating them within Rhino\Grasshopper. This tool is called GHPythonINTERFACE. It is opensource and will be released under simplified BSD licence.

In the following example, I have applied some modules such as: numpy, scipy, matplotlib, PyOpenGL and Pygame using this new plugin, just to evaluate it. (it is still under development and requires a lot of work). All the work is done in Python Object Oriented Programming (OOP) for my upcoming research project.

Limitations and Further works: 
So far, this plugin is not fully functioning, it still needs a lot of improvements such as efficiency and text highlighting.. Also I'm working on it during my free time. So, any suggested improvements or contributions are most welcome and so much appreciated.

GitHub:
https://github.com/MahmoudAbdelRahman/GhPythonINTERFACE

ResearchGate:
https://www.researchgate.net/project/GHPythonINTERFACE



7/05/2017

Running Python Process in Parallel

I have been trying to run multi-processes using python subprocess module. I'm using Python 2.7 and Yes, it is helpful and saves a lot of time indeed, but, I need to run about 10 thousand daylight simulations simultaneously, it is impossible to do this serially, thus I have to think about parallel computing. Ok, I know that the best solution lies in GPGPU but I would like to start applying CPU parallelism at first. I have stumbled across threading and multiporcessing modules which are thread-based parallelism and processing-based parallelism respectively. I'll spend sometimes trying these two modules and I will write about them soon as possible, If I find something better I'll blog about it as well.

6/29/2017

Visualizing daylight data using matplotlib with radiance


It is possible to output daylight data from radiance using the following command line: 

rtrace [ options ] [ $EVAR ] [ @file ] octree]

Then, using numpy.filetxt() function, you can read the output rsult file for predefined points as an ndArray. After that, it will be easy to plot them either using matplotlib.pcolor() or matplotlib.contourf().
I prefer this method because it gives more flexibility in reading and reporting data. 

Genetic Algorithms Optimization Using Python .

Genetic algorithms have a lot of potentials for building performance, I look forward to using them in my upcoming research. This attempt was conducted using Python 2.7, Numpy and Matplotlib. You can download the IPython notebook via this link on GoogleDrive:
https://drive.google.com/file/d/0B9XCxIWl-sKDWFNqRFVHSEFWV0E/view?usp=sharing