So I've been trying to solve this inbetween work for a couple of days now and I just can't seem to fake my way around it.
So I have a bunch of irregular tetrahedrons coming into a for each and I want to morph each piece from an irregular tetrahedron to a regular. The problem I have is aligning the regular one to the irregular one before the blend, thus I have some pieces morph through themselves - as in the example scene here.
And I tried to fake my way around this using sorts and the align SOP, but even though I can get to a point where I get 95% of the pieces aligned, there's always a couple that will still misalign - meaning they'll morph through themselves.
Now, there's either a really simple solution I completely missed or a really complicated solution I'm too stupid to figure out on my own. So yeah, help.
It's very easy, you can do all of this in a single AttribWrangle. There are many ways to do this but doing this would work:
1. Pick the first primitive of each tetrahedron in a Group SOP. 2. Run Over Primitives in AttribWrangle using this group. 3. Using the picked face and a side of this face, compute a transform matrix and reorient this face to world i.e. XZ plane. 4. Compute the average edge length of this face and then resize the first edge of this face to be this length (same direction). 5. Set the third point position from the center of the first edge by 0.5 * sqrt(3) * sideLength in the right axis. In my case it was the X axis. 6. Set the apex point position from the center of the face by sideLength * sqrt(2.0/3) in the right axis. In my case it was the Y axis. 7. Multiply all the new point positions by the inverse of the transform matrix to place the new tetrahedron back to its place. 8. Apply linear interpolation between old and new point positions using a weight attribute.
LOL, when you say it's easy, I logout of the forum for safety reasons.
And much appreciated, Pusat. We actually got it solved at OD Force. Petz initially did a setup like the one you describe, but then he simplified it, doing something I really don't understand yet, he extracted the transforms - though I'm kinda confused about where those transforms came from seeing each tetrahedron was out of a tetrahedralize SOP - well, I'll figure it out when I grow up I guess.