NCF参数化建筑论坛

标题: 分享rhinoscript的array函数库 [打印本页]

作者: 1235813    时间: 2011-5-21 20:15
标题: 分享rhinoscript的array函数库
本帖最后由 1235813 于 2011-5-21 20:18 编辑

来至---RhinoScript.org


' ****************************** RhinoScript.org ******************************
'
'   Array Library, version 1.4
'
'   by Hanno Stehling, published Jun 30, 2008
'
'
'   A collection of functions to make life with arrays in RhinoScript easier
'
'
'
'
'   This RhinoScript Library has been downloaded from RhinoScript.org.
'
'   Rhino versions: Rhino 4
'
'   LICENSE INFORMATION:
'   This script is published under the GNU General Public License, version 3
'   or any later version, and thus comes WITHOUT ANY WARRANTY. You can get
'   the complete license text here: www.rhinoscript.org/gpl
'
' ****************************** RhinoScript.org ******************************

' Array library - Version 1.4
' ---------------------------------------
' Hanno Stehling | post@hanno-stehling.de
'
' This library contains some functions to make working with arrays easier.
' Most functions are inspired by PHPs convenient array_* functions. There is
' a function list directly beneath this text. More detailed documentation is
' given directly with the code of each function.
' IMPORTANT:  Nearly all functions only work with one-dimensional arrays,
' exceptions are explicitely mentioned in the documentation. You can use
' array_2to1dim() or array_3to1dim() to create a nested one-dimensional array
' from a two- or three-dimensional one.
' ALSO IMPORTANT: Many functions alter the array you feed them.
' Those arrays are marked * in the documentation (and of course passed ByRef)

' Function list:
' --------------
'
' array_dimensions: get number of array dimensions
' array_dim: dimension a one-dimensional array
' array_dim2: dimension a two-dimensional array
' array_dim3: dimension a three-dimensional array
' array_fill: dimension a one-dimensional array and fill it with a default value
' array_fill2: dimension a two-dimensional array and fill it with a default value
' array_fill3: dimension a three-dimensional array and fill it with a default value
' array_2to1dimension: convert a two-dimensional array into a nested one-dimensional array
' array_3to1dimension: convert a three-dimensional array into a nested one-dimensional array
' array_flatten: convert a nested array into a flat array
' array_flatten2: convert a two-dimensional array into a flat one-dimensional array
' array_flatten3: convert a three-dimensional array into a flat one-dimensional array
' array_swap: swaps dimensions of a two-dimensional array
' array_count: returns the number of elements in an array
' array_insert: insert a value into an array
' array_extract: extract a value from an array
' array_push: append a value to the end of an array
' array_pop: return and remove a value from the end of an array
' array_unshift: insert a value at the beginning of an array
' array_shift: return and remove a value from the beginning of an array
' array_slice: return part of an array
' array_clean: remove all elements with a given value from an array
' array_unique: remove duplicate values from an array
' array_merge: merge two or more arrays
' array_pad: expand an array to a given size and fill new elements with a default value
' array_sort: sort an array
' array_nsort: sort arrays in a nested array after the element at a given index
' array_reverse: get an array in reversed order
' array_search: search an array for a value
' array_search_neg: search an array for an element that does not equal a value
' array_min: get the minimal value found in an array
' array_max: get the maximal value found in an array
' array_sum: get the sum of all values in an array
' array_product: get the product of all values in an array
' array_rand: get the value at a random position of an array
' array_implode: implode all elements of an array to a string
' array_print: print an array to the Rhino command window

[attach]18957[/attach]
作者: ccc159    时间: 2011-5-21 22:46
其实是好东西啦  不过这个函数  一般用不上。。。
作者: ccc159    时间: 2011-5-21 22:46
mark一下~~
作者: ccomix    时间: 2011-5-22 10:02
为啥仅有array
作者: arvin1018    时间: 2011-5-22 14:47
我的rhinoscript還沒開始!來瞧一下!
作者: wawa    时间: 2011-5-23 11:25
quite good
作者: 1235813    时间: 2011-5-23 16:15
thinks {:3_53:}{:3_52:}
作者: 340019499    时间: 2011-5-24 11:57
又是一个很有用处的东西啊
作者: dandantian    时间: 2011-7-29 21:03
{:3_56:}{:3_56:}
作者: liyanyanhong    时间: 2011-10-15 12:18
.................{:3_46:}




欢迎光临 NCF参数化建筑论坛 (http://bbs.ncf-china.com/) Powered by Discuz! X3.2