Koch Tetrahedron with hoopsnake

Hi guys,

I have created a definition that produces a fractal of regular tetrahedron based on the Koch division. However I am trying to take the next stape and make it recursive with hoopsnake.

My definition essentially takes a regular tetrahedron, then creates a new tetrahedron base (triangle) by connecting the midpoints of the sides of each surface. Then it displaces the midpoint of this new base by the needed height for a regular tetrahedron alongside the normal vector of this surface.

The problem at the moment is that for one of the 3 intial surfaces I get a vector (0.0,0.0,0.0), which essentially is not a vector. This however does not happen when I do the whole process manually.

The result I am aiming for is essentially this.

I attach the definition icluding both the recursive definition as well as the manual one. If anyone has any input, it would be great.

Cheers,

T

  • up

    Marios Tsiliakos

    Hi,

    well its a little bit rough and untidy. And there is plenty of potential for further optimization and debugging  but is working so take a look.

    Best,

    M.

    7
  • up

    Thanasis Korras

    Hi guys,

    I have been trying to make a different version of this definition that is going to be based on triangle meshes and the new tetrahedrons will be generated from the rotation of those triangles instead of rebuilding them (similar to Koch snowflake method of segmenting the lines and rotating the middle segment). However I face two problems. One is that for some reason i get slightly changed values for my triangles' sides. If i set it to be 60, i get one 60, one 60.00001 and one 60.00002. Is there a way to work around that or is it a problem of the mesh geometry? The other problem is that while i try to use the same Brep inclusion method that Marios suggested , it doesn't seem to work anymore which is weird as it essentially the same principle.

    Anyway I attach the new definition if anyone is in the mood of taking a look.

    • up

      Thanasis Korras

      Hi all,

      I am trying to do the same thing but using meshes instead. The only problem is that the "path mapper as tree" command does not work and I only get the recursion on one face each time. I attach the definition for anyone on the mood to help me out!

      Best,

      T

      8