hi, all!
Have you ever tried to make insets in wz4? I did and faced a problem.
If you, say, wanna make 'windows' in a cube, you subdivide it, select the faces you want to have insets for 'windows' using Select op and then extrude the 'windows' inwards using Extrude op with zero Amount and negative Scale.
What happens next is quite unexpected: the Extrude op changes your selection of faces and leaves only the newly created fases selected, but not the faces you have just extruded. So, in order to select the 'windows' for another extrusion you'll have to use logic by stacking a couple of other Select ops beneath the extrude op. So, my idea is to tweak this behaviour so that you can have original faces selected after extrusion. Two ways possible imho:
1. Modify the existing Extrude op by placing a switch using a boole function which defaults to the current select behaviour (for compartibility). It's _kb's idea, actually ) or
2. Create a duplicate of Extrude op behaving like we wnt, call it Extrude 2 or Inset and populate it over the whole structure.
The hardest part (as always) is implementation ).
It seems that this part of wz4_mesh.cpp is responsible for selection.
// update selection
sFORALL (Vertices,v)
v->Select = 0.0f;
sFORALL (Faces,f)
f->Select = (_i>=originalfacecount)?1.0f:0.0f;
This part calls sFORALL function defined in types.hpp. Apparently, sFORALL forms (or sorts)the respective vert/face array. Then I get lost. I can not figure out how these arrays are sorted and thus can not imagine the order...
Well, then the selecion goes. If new faces are created (_i>=originalfacecount), they get selected (i.e 1.0f), if they are not, the selection must stay the same as original(i.e. 0.0f).
If I change 1.0f to 0.0f, the Extrude op leaves nothing selected at all, which makes me think there must be some sorting problem originating from sFORALL function or maybe v and f do not contain the original faces. What could that be?
Anyway, I'm totally confused and ask for your help. Maybe some C++ guru might take a look at that?
Thank you.
PS I'm total noob to C++ programing, so excuse me if I'd made foolish statements )