Jump to content

Infinite knot


mike_

Recommended Posts

@mike_Just rotate .. with this you have endless possibility ...Have Fun ..use after add SOP or skin or copy to points that Star Shape.
 

//detail
int u = chi('u_num');
int v = chi('v_num');
float inner = chf('inner');
float outer = chf('outer');
float pi = $PI *2;

for(int i=0; i<u; i++){
    for(int j=0;j<v;j++){
        float centerX = inner +(outer -inner)*0.5;
        float torusRad = (outer -inner)*0.5;
        float X = centerX +torusRad *cos(pi / u *i);
        float Y = torusRad *sin(pi / u *i);
        vector pos = set(X*cos(pi / v*j),Y,X *sin(pi /v *j));
        
        int pt = addpoint(0,pos);
        setpointattrib(0,'u',pt,i);
        setpointattrib(0,'v',pt,j);
        
        vector centerPt = set(centerX *cos(pi / v *j), 0,centerX *sin(pi /v *j));
        vector normal = normalize(pos -centerPt);
        setpointattrib(0,'N',pt,normal);
        }
   }
int ucount = chi('ucount');
int vcount = chi('vcouont');
float height = chf('height');
float waveslid = chf('waveslid');

int uWaveCount = chi('uWaveCount');
int vWaveCount = chi('vWaveCount');

int u = point(0,'u',@ptnum);
int v = point (0,'v',@ptnum);

vector nor =v@N;

float uRatio = u /float(ucount);
float vRatio = v /float(vcount);
float pi = $PI * 2;

vector newPos = @P + nor *height * sin(pi * vRatio *vWaveCount + pi * uRatio *uWaveCount + pi * waveslid);
@P = newPos;


sec wrangle


 

sec.jpg

jk665f.gif

kni.jpg

jk665fdd.gif

Edited by Librarian
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...