Skip to content
dyama edited this page Oct 31, 2016 · 7 revisions

要約

Siren::Vertex (バーテックス) とは、3次元の点を表わすオブジェクトです。Siren::Shape クラスの派生クラスです。

インスタンスメソッド


3次元座標値を配列で返す

xyz -> [x, y, z]
to_a -> [x, y, z]

Siren::Vertex の3次元座標値を配列として返します。

例)

point = Siren.vertex [1, 2, 3]
p point.xyz  # => [1, 2, 3]
p point.to_a # => [1, 2, 3]

座標値から Vec 型を生成する

to_v -> Vec

バーテックスの3次元座標値の x, y, z 要素を持つ Vec 型のオブジェクトを返します。

例)

point = Siren.vertex [1, 2, 3]
p point.to_v # => #<Vec:0x1f9bf50 @x=1.000000, @y=2.000000, @z=3.000000>

Clone this wiki locally