skip to main |
skip to sidebar
色を混ぜて遊ぶのはとても楽しいのですが、変化率に一次関数しか使ったことないな、とはずっと思っていたのです。
Line1 は1次関数。Line2 は3次関数。Line3 は10次関数での変化率になっています。次数を上げるほど色が変わり始めるのが遅くなり、変わり方が急激になります。ちょこっと計算してはいますが、最後はちゃんと RGB に入るように Round() で integer にしてあります。
仕事で役に立つのでしょうか... 知りません知りません。
'blend color with polynomial function
'---------------------------------------
Dim aR, aG, aB 'factor for polynomial function
Dim dbl_xR_step, dbl_xG_step, dbl_xB_step
Dim t 'function
t = 3
dbl_xR_step = (gR-sR)/((UBound(arr_str_tangent)))
dbl_xG_step = (gG-sG)/((UBound(arr_str_tangent)))
dbl_xB_step = (gB-sB)/((UBound(arr_str_tangent)))
aR = (gR-sR)/ (UBound(arr_str_tangent))^t
aG = (gG-sG)/ (UBound(arr_str_tangent))^t
aB = (gB-sB)/ (UBound(arr_str_tangent))^t
'with quadratic
R = sR + Round(aR * k^t)
G = sG + Round(aG * k^t)
B = sB + Round(aB * k^t)
Call Rhino.ObjectColor( str_tangent, RGB(R,G,B) )
Call Rhino.EnableRedraw( True )
'---------------------------------------
Simple script to create Rhino Layers by Color. This comes in handy when I'm working back and forth between Rhino and CATIA :) b
When I export geometry from CATIA, iges automatically puts ALL objects in ONE layer, but as long as different colors have been assigned to the geometries, I can separate them by using "select by color" command in Rhino.
I was preparing dxf file for TENSYL (minimal surface analysis software). TENSYL is hypersensitive about layer and geometry standards to run correctly. While troubleshooting the conversion problems from CATIA and Rhino, I did this "select by color" procedure sooooooo many times. I finally gave in and wrote this script.
久しぶりに Rhino Script。
Messing around with Rhino Paneling Tool. If I use EvaluateSurface method to assign points on surface, I cannot avoid non-even distribution of iso curves. (Well... WITHOUT reconstructing the surface.) Rhino Paneling tool has option to distribute points evenly on a surface.
Grid on a blue surface below is by Rhino Paneling Tool.
Grid on a white surface is by Rhino.EvaluateSurface.

Yet, using Rhino Paneling tool only comes with basic patterns and creating 2d patterns looked a bit hassle to me... then I ended up writing Rhino script to generate patterns I want.
Using Rhino Paneling Tool interactively only gives me an array of string points as return. And since ObjectByName method's return is an array -just in case there are items with identical names,- I needed to receive them as arr_str_pt(0).


