nghiatranduc94 Posted May 24, 2021 Share Posted May 24, 2021 Hi, So I'm trying to create a point on the center of a primitive like the picture I've attached. Can anyone help me out? - Scatter will create the point but it is randomly, not on the middle of the grid - I've tried other centroid point methods but the point is outside of the mesh. So I'm stuck here Quote Link to comment Share on other sites More sharing options...
nguyenvuquocan Posted May 24, 2021 Share Posted May 24, 2021 (edited) Prim wrangle 1 : int pts[] = primpoints(0,@primnum); vector center = 0; foreach(int pt;pts){ center += point(0,"P",pt); } center /= len(pts); v@center = center; Wrangle 2 ( run in detail ) : int nprim = nprimitives(0); for(int i = 0; i < nprim; i++){ vector center = prim(0,"center",i); int pt = addpoint(0,center); } or you can use two Sop : Enumerate Sop and Extract Centroid sop to do that . Edited May 24, 2021 by nguyenvuquocan Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted May 24, 2021 Share Posted May 24, 2021 Hi Nghia, you could fill the 2D mesh with lots of scattered points and measure / sort their distance to the outline of the mesh. furthest_inside_point.hipnc 1 Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted May 24, 2021 Share Posted May 24, 2021 (edited) To get the furthest mesh point to the outline, try the distance along geometry-node. furthest_mesh_point.hipnc Edited May 24, 2021 by konstantin magnus 3 1 Quote Link to comment Share on other sites More sharing options...
nghiatranduc94 Posted June 2, 2021 Author Share Posted June 2, 2021 On 5/24/2021 at 3:54 PM, konstantin magnus said: To get the furthest mesh point to the outline, try the distance along geometry-node. furthest_mesh_point.hipnc thank guys, odforce really rock!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.