define your own stuff your function your prototype(class) MAS (Multi Agent System) basic style on GH MAS_00_20140516.gh
Category: GhPython
example coding for “TODO1”
louver_samples.gh
TODO1
これをGhPythonコンポーネントで作ってみてください。p2の動かし方はなんらか連続性のある変化(サインカーブなど)を考えてください。ルーバーの列毎に開口の大きさが違っているのも面白いかと思います。質問はコメント欄に。 Try to build this function with your scripting. The changes of p2(s) would be nice to have continuity like sine curves. It’s is interesting when each unit has different size of gap. Feel free to put your question as comment.
programming memo 1 (e)
日本語はこちら(去年のポスト) Python: print (command to show text lines of data on console, for checking changes of numerical data mostly invisible in your code) “indent” , “carriage return” are important for python scripting syntax. # for comment out. put ‘#‘ at the beginning of line, then that line will be unfunctional. import (command to import “modules” which extend functions, as can allow you to use the module in short name which you defined) for repeating, possible to code with Lambda functions Grasshopper component: input from left side , output to right side Grasshopper Python component: left side inputs labeled like “x”, “y” can be used in your code as variable namedRead More »
technical memo
質問があったのでメモしておきます。ライノパイソンとGhPythonの主な違いについて technical topics from last(kick start) session, There was question about difference between using rhino-Python and using GhPython Rhino-Python, command “EditPythonScript” and write your script on the editor.. You can run your python script and send command to Rhino directry. You will get the 3d model without preview. http://am.d-xx.com/?p=67 GH-Python, command “grasshopper”, after launching, place Python component and write your script into the component. You can preview the model until you “bake” it. http://am.d-xx.com/?p=54
Utility モジュール / Pythonのリストの入れ子をGrasshopperのデータツリーに
Pythonのリストの入れ子をGrasshopperのデータツリーに 変換する関数 ListlistToTreeをモジュールにしました。 Utility.py ↑をCA_Neighbour.pyと同様 c:\MASunit フォルダに保存して、rhinocerosを再起動してください。 Pythonコンポーネント上で使うときは Utility.ListlistToTree の引数にネストされたリストを渡すと Tree に変換されたデータ型が返ってきます。今後も何かとUtilityモジュールの機能を拡張していきたいと思います。
Pythonのリストの入れ子をGrasshopperのデータツリーに
Python で作ったリストのリストを Grasshopper のデータツリーとして扱えないという問題で、今日はリストのリストを、一つにまとめたリストと各リストに入っていた要素の個数のリストに分割するという方法をとりましたが、Python の中でデータツリーにして出力する方法を堀川さんに教えて頂きました。 以下コードです: 上記のスクリプトを新しく作成した Python コンポーネントに書き込んで、Python のリストを入力してください。細かい原理は難しいのですが、 Python でデータツリーを扱うことがそのままではできないので、scriptcontext, clr で Grasshopper のカーネルにアクセスして拡張する必要があるのだそうです。今後の ghpython のバージョンアップに期待します。
Histogram python Object 改訂版
修正しました。不具合申し訳ないです。 Histogram.ghuser
Simple Histogram python Object
simple_histogram.ghuser 修正版を使ってください。 ヒストグラムを描画するPythonオブジェクトです。GHのワークスペースにドロップすればインストールされます。使い方はオブジェクト内のpythonスクリプトのコメントを読んでください。詳しくはミーティング中に説明します。
ライノオブジェクトを初期シードの設定に影響させる
setByPoints.zip




