Jump to content

Imperfect Voronoi fracture


s---70

Recommended Posts

I am getting an almost perfect voronoi fractured mesh, but at some points the edges on the outside just dont match up. I need a perect outside shell for further processing, so can this somehow be avoided? I tried with voronoi fracture points and with a scatter on an isooffset, both methods result in this problem. I could somehow fix this in VEX probably but I'd rather get this right in the first place...

voronoi.jpg

 

voronoi problem.hiplc

Edited by s---70
Link to comment
Share on other sites

Quote

 

Triangulate non-planar faces using Divide node.

 

thx, that helped but didn't fix it in all occurances.

Quote

Have you tried adjusting the 3D tolerance in the fracture sop?

what do you mean by 3d tolerance?

 

My approach is now to find nearby points and set them to the same position before applying a clean to remove degenerate prims, but its always a bit of a pain in the ass when you have to find a threshold that works and its not really procedural.

Link to comment
Share on other sites

so if anyone is interested, this is how I fixed it:

attribute wrangle running over detail with this code, ch("epsilon") being a float parameter to control the distance in which near points are searched

int npt = npoints(0);
int moved[];
resize(moved, npt);

for(int i=0; i<npt; i++) {

if(moved[i]) continue;

vector pos = point(0, "P", i);
int pcpts[] = pcfind(0, "P", pos, ch("epsilon"), 100);

vector center = 0;
int count = 0;

int tomove[];
push(tomove, pcpts);
foreach(int pt; pcpts) {
    if(moved[pt]) {
        removevalue(tomove, pt);
        continue;
    }
    vector posi = point(0, "P", pt);
    center += posi;
    count ++;
}
foreach(int pt; tomove) {
    moved[pt] = 1;
    setpointattrib(0, "P", pt, center/count);
}

}

after that a clean with default settings

edit: changed the clean afterwards to a simple delete -> delete degenerate primitives and set the tolerance smaller than default, bcause default clean removed some small polygpns.

Edited by s---70
  • Like 2
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...