Creating a Faceted torus with a twist in grasshopper

Hello, I am trying to create a grasshopper script that allows me to make a faceted torus with a slight twist. I’ve posted an image of what I’m trying to do.

I am looking to be able to control the number/size of the facets, the overall diameter, the diameter of the cross section, and the degree of twist. I have gotten almost all of that using the lunchbox tools for making a torus and paneling, but I’m having trouble with the twist part. I found some information on making a twist in a torus from another script that google showed me, but it doesn’t seem to be working. I’ve attached my scripts so far. The part circled in red was what I was using to try to make the twist.

Can someone show me how I might go about achieving this? Any information would be greatly appreciated.

Thanks,

Jake

faceted torus with a twist script.gh (8.7 KB)

Hello

there are many solutions to do this.

  1. Nautilus has this component

  1. it is quite trivial if you can program in Python or Csharp. Just one phase in Grok

  2. In Grasshopper it could be possible to do it using a tube then using twist, then bent …



twisted torus.gh (13.4 KB)

Oh wow, Thank you Ali and Laurent! I feel a little foolish that there was a simple way to do this in Nautilus Laurent, but I really love seeing the the whole script Ali. Only way I’m going to learn.

One last question. So I see that by baking the unwelded mesh and converting it to a NURB, I can create two planar triangles in each facet segment. Is it possible for the 4 sided facet to be planar? I’m guessing not with the curved surface geometry.

Thank you!