Index mask
Created by: Durman
Problem statement
According this conversation #2649 (closed), Sverchok is very weak in manipulating with different parts of one mesh. At this moment we split such parts to different meshes for manipulate them freely (moving, scaling or whatever). Such approach has big downside that it can't be vectorized and this process is unlike how users used to deal in Blender.
Solution
Solution I think can be very easy. The goal is to mark different parts of mesh somehow so they can be differed from each other. Most simple way is creating index mask. It can be vertex index mask, edges index mask but for beginning it is better have face index mask above all. Face index mask will be like mask which we already have but instead of True or False values it will be have integer values from 0 to infinity. Index will be mean to which part of mesh current face is related.
Example
Imagine we have added box generator which generates boxes in one object. With object it will generate face index mask. For first box it will generate mask like this [0, 0, 0, 0, 0, 0]
where 0 means flag of part of mesh and number of values is equal to number of generated face. For second box will be generated the same mask but with next index 1. And the same for all other boxes. For 3 boxes faces mask index output will look in this way: [0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2]
.
Such mask already gives opportunity to manipulate parts of mesh with existing tools of Sverchok. Firstly, it is possible to converts index mask to normal mask which will present selection of one or several parts of mesh. In this example boxes was moved by transform selected
node:
Another opportunity is to distribute values. For example we would like to insert faces to the mesh but first part should not have extra faces at all and second and third parts of meshes should have different value of offsetting.
It is possible to do with list item
node. In data socket values should plugged. In index socket should be plugged face index mask.
This two approach gives total control over parts of mesh. For opportunity manipulate parts of objects in space freely apply matrix
nodes should have modes apply matrix per vertex, per edge and per face and matrix
node should be vectorized as it already is.