sverchok
sverchok copied to clipboard
Add a FaceMask input for the Subdivide node
There is an EdgeMask input allowing to choose which edges to cut, but you cannot choose via the faces instead of the edges. In my case, if we take the example of a cube, I would like to subdivide (gridfill) all of its faces but one, then displace the vertices along their normal, normals calculated as if the non subdivided face didn't exist, like it is already done with the edges. Currently, to not subdivide a face I need to unselect all of its edges, but then the adjacent faces are not subdivided, only their selected edges. So, a FaceMask input could be used, telling the node which edges to subdivide and that the subdivided edges have to only be linked to new faces created on the selected faces, so as to not subdivide the unselected faces. As FaceMask and EdgeMask are not compatible, a simple boolean checkbox could be used as a switch between the two masking modes.
Currently the node uses build-in Blender operator which expects selection only in edge mode according to the documentation https://docs.blender.org/api/current/bmesh.ops.html#bmesh.ops.subdivide_edges
So to implement this the operator should be recreated on pure Python or with NumPy. In first case it will be really slow in the second quite tricky to implement.
Also, there could be another checkbox parameter to choose between moving all vertices or only new vertices.