はじめに
全ての頂点ではなく一部分のみの頂点に対して操作を行いたい場合どうやって選択すればよいかわからなかったので調査したメモです。
参照元
サンプル

- 少し見辛いが、0 ~ 9 の頂点が並んでいる
- Lineノード によって頂点数が10の Lineを作成している
- Viewer Index + で頂点がどこにあるかを示している
選択
List Item による頂点選択
単一

- ほしい部分の Index の値を設定する
複数選択 Formula

- index が1, 2, 3 のものの取得を試みているが、おそらく今はバグで選択できていない。
- ※通常はこれで取れるらしい
複数選択 List input

- index が1, 2, 3 のものを取得している
List Mask による選択
複数選択 List input

- 1 = True = 選択, 0 = False = 選択しない
- 上記の例では偶数番目の頂点を選択している
ランダム選択 Random Num Gen

- Size は Line の頂点数に合わせて 10 としている
- 最小値(int Low) を0、最大値(Int High) を1 とし、0 または 1の乱数を発生させている
Select mesh elements by location による選択

- このノードは位置的な条件によって選択が出来る
入力
- Vertices
- Edges
- Faces
- Direction(By Side, By normal direction, By plane, By cylinder, By edge directionモード時)
- Center(By center and radius, Normal pointing outside, By bounding boxモード時)
- Percent どれくらいメッシュを選択するか( By side, By normal direction,By edge direction,Normal pointing outside モード時)
- Radius 中心からのどれだけの距離を選択範囲とするか(By plane, By cylinder, By bounding boxモード時)
パラメータ
- Mode 適用する条件タイプ
- By Side メッシュの側面にある頂点を選択する。この側面はDirectionによって指定する。頂上としたいなら Direction(0, 0, 1)とする。選択数は Percent によって決める。1%なら頂上のみ。99%なら底面を除いた全部選択する。
- By normal direction 面を選択する。Directionで指定した法線ベクトルを持つ面を選択する。右側を向いた面を選択などが出来る。選択数はBy side同様にPercent によって決める。
- By center and radius 指定した中心からの半径内に入っている頂点を選択する。言い換えれば、与えられた球の内側にある頂点を選択する。
- By plane 指定した面の半径の内側にある頂点を選択する。面は法線ベクトル (Direction input)と面が属するポイント(Center input)によって指定する。例えばDirection(0,0,1)でCenter(0,0,0)の時、面はOXYとなる
- By cylinder 指定した直線からの半径内にある頂点を選択する? 線はDirectionと線が属するポイント(Center input)によって指定する。例えば、Direction(0,0,1)、Center(0,0,0)なら線はZ軸となる。
- By edge direction 指定した方向ベクトルにほぼ平行な辺を選択する。このモードは辺を非向とみなしている点に注意。結果として、方向の全ての座標の符号を変えることが出来て、出力にも影響しない。
- Normal pointing outside 指定した中心から外側を向いている法線ベクトルを持つ面を選択する。面の選択数は Percent によって指定する
- By bounding box Center入力によって指定されたバウンディングボックス内にある頂点を選択する。Radiusは許容範囲として解釈する。
- Mode 適用する条件タイプ
- 出力
- VerticesMask 選択された頂点のマスク
- EdgesMask 選択された辺のマスク。このマスクはノードに入力された頂点リストに関連しており、このノードによって選択された頂点のリストではないことに注意。
- FacesMask 選択された面のマスク。このマスクはノードに入力された頂点リストに関連しており、このノードによって選択された頂点のリストではないことに注意。
右端の選択 By side
- Direction (1, 0, 0)

右向きの面を選択 By normal direction
- Direction (1, 0, 0)

法線方向による面の選択 By normal direction
- Center(0,0,-0.54)

操作

- List Mask(out) によって頂点を選択
- Move によって頂点の位置を操作
- List Mask(in) によって選択した頂点と非選択の頂点を結合
最後に
参照元にはもっとサンプルがあるので見てみると良いかもしれません。