polygon sphere to "cage"

   1525   2   1
User Avatar
Member
383 posts
Joined:
Offline
Hi,

I have a polygon sphere and I try to remove its faces and then make two points poly in place of the old edges.
The polySpline sop doesn't work fine.
I am trying in wrangle but , in my actual wrangle, the 2points are doubled and I can't figure how to script to avoid that.

int myNeigh[] = neighbours(0,@ptnum);
int myPrims[] = pointprims(0,@ptnum);
foreach (int j; pointprims(0,@ptnum)){
    removeprim(0,j,0);
}
foreach (int i; myNeigh){
    int newPr =addprim(0,"polyline"); 
    addvertex(0,newPr,i);
    addvertex(0,newPr,@ptnum);
}

The code doesn't remember the last creations and then double it …

Any help is welcome

Vincent
http://vimeo.com/vbkstudio [vimeo.com]
User Avatar
Member
2040 posts
Joined: Sept. 2015
Offline
When I do vex I just use my own defined ‘for’ loops.

Haven't used foreach yet, so I"m not quit sure what's going on in your code in that regard.

But just a thought, have you considered using the removepoint function? Your using the removeprim but that doesn't remove the points if that's what you were thinking.
Edited by BabaJ - March 13, 2017 19:55:06
User Avatar
Member
670 posts
Joined: Sept. 2013
Offline
Put the sphere in a “convertline”-node and you are done.
https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
  • Quick Links