Morph to Twisted Triangular Prism instead of Twisted Box

Hello. Pufferfish “Morph to twisted box” is a great tool but it only works with twisted boxes. I was wondering how to use triangles (or better triangular prisms) to morph geometry. This is my result:

TriPrismMorph.gh (53.7 KB)

It’s a rough sketch and I am curious if someone is interested in developing this further (how about @Michael_Pryor?). The math behid is quite simple (vectors math) and I believe that there is some smarter approach that probably describes the trasformation in a better way.

Brief description:

As a bonus, there’s also my C# attempt to get the same result, but I messed up DataTree branches. But besides that, the script works.

My approach works fine, but there’s an issue transforming mesh normals from the source - I just don’t know yet how transform a vector from source system to target system. Points work just fine…

Also, this tool by @DanielPiker (Cage edit command that can adapt to any form automatically - #46 by DanielPiker) is promising, but it didn’t work correctly in my case.

You can use twisted box. Just make the start and end points of each side the same. (A triangle where point 0 and 3 are the same)

1 Like

Wow, that would be great, Mike. I wished for something like that. It just doesn’t work in my case. Am I missing something important?

TriPrismMorph.gh (53.7 KB)


TriPrismMorph Edited V0.gh (39.2 KB)

1 Like

I did my own version. Sharing as .gha for you guys to try and experiment. No time to hunt for bugs and test that properly, so use this at your own risk. Let me know the result of your experiments :slight_smile:
Three components will appear at “Transform” and “Util” toolbars.

  1. Define Reference Prism using 6 corner points. Order is from bottom triangle to top triangle. Both triangles have to be within World XY plane.
  2. Define Target Prism using 6 corner points. I deconstructed Twisted Box to get these.
  3. Plug that in the TriMorph component to get the geometry. Combine, clean, align vertices.


TriMorphByPetrVacek.gh (29.6 KB)
TriMorph.gha (17.5 KB)

Cheers!

1 Like