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 »

  • Comments Off on programming memo 1 (e)

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

  • Comments Off on technical memo

Utility モジュール / Pythonのリストの入れ子をGrasshopperのデータツリーに

Pythonのリストの入れ子をGrasshopperのデータツリーに 変換する関数 ListlistToTreeをモジュールにしました。 Utility.py ↑をCA_Neighbour.pyと同様 c:\MASunit フォルダに保存して、rhinocerosを再起動してください。 Pythonコンポーネント上で使うときは Utility.ListlistToTree の引数にネストされたリストを渡すと Tree に変換されたデータ型が返ってきます。今後も何かとUtilityモジュールの機能を拡張していきたいと思います。

  • Comments Off on Utility モジュール / Pythonのリストの入れ子をGrasshopperのデータツリーに

Pythonのリストの入れ子をGrasshopperのデータツリーに

Python で作ったリストのリストを Grasshopper のデータツリーとして扱えないという問題で、今日はリストのリストを、一つにまとめたリストと各リストに入っていた要素の個数のリストに分割するという方法をとりましたが、Python の中でデータツリーにして出力する方法を堀川さんに教えて頂きました。 以下コードです: 上記のスクリプトを新しく作成した Python コンポーネントに書き込んで、Python のリストを入力してください。細かい原理は難しいのですが、 Python でデータツリーを扱うことがそのままではできないので、scriptcontext, clr で Grasshopper のカーネルにアクセスして拡張する必要があるのだそうです。今後の ghpython のバージョンアップに期待します。

  • Comments Off on Pythonのリストの入れ子をGrasshopperのデータツリーに

Simple Histogram python Object

simple_histogram.ghuser  修正版を使ってください。 ヒストグラムを描画するPythonオブジェクトです。GHのワークスペースにドロップすればインストールされます。使い方はオブジェクト内のpythonスクリプトのコメントを読んでください。詳しくはミーティング中に説明します。

  • Comments Off on Simple Histogram python Object