Torus Knot

Here's the definition - easier than it looks actually. Link to the obligatory wikipedia article is here.

 

Also here's a definition for a version that takes an arbitrary base curve for input (in this case an ellipse for simplicity. By using a curve component one can also start with any arbitrary curve of course.

 

Thanks to my pal Harold for getting me distracted with this!

 

torus%20knot.gh

torus%20knot2.gh

  • Harold Strang

    I tried your definition and it seems to suffer from the same problem as my attempts so far.  The rate of twist around the base curve doesn't appear to be constant.  I'm not 100% sure yet, but I think it is dependent on the vertex spacing, such that the same number of twists appear between vertices, regardless how far apart they are.
  • Harold Strang

    OK, I think I figured it out.  The 't' is not linearly proportional to the length along the curve.  So I used "rs.CurveArcLengthPoint" to find points on the curve at the locations of interest, and then used "rs.CurveClosestPoint" to get the 't' at those locations to feed into the grasshopper "PFrame" component.  The result is HERE