Jump to content

Delete Boundary primitives


nithish24

Recommended Posts

  Hi guys , I'm trying to delete the boundary primitives of a grid after using convert line node as shown in the pictures below with the help of VEX for procedurally deleting the boundary primitives of a grid . 

Thanks in Advance.

Capture1.JPG

Capture2.JPG

Link to comment
Share on other sites

Hi !

You can do an Edge Group on the grid before the convertline, set to "Include by Edges - Unshared Edges". This'll select the contour of the grid.
The convertline sadly gets rid of all groups, but with a Group Copy, you can copy it back after the convertline.
You'll need to set the "Group Name Conflict" to "Overwrite" on the Group Copy node.
Then, a Dissolve will delete the edges as you want. Blast or Delete won't work with this method.

deleteBoundaryEdges.thumb.gif.0514857d7d762fa16cfe3fb39a1b5969.gif

Link to comment
Share on other sites

... or, if you're adamant on doing it with VEX, here's my take on it

deleteBoundaryEdges_VEX.thumb.gif.4d1953416245965c42a701cad7716fbb.gif

int pts[] = primpoints(0, @primnum);

int count = 0;
foreach(int pt; pts){
    count += neighbourcount(0, pt);
}

if(count <= 6)
    removeprim(0, @primnum, 1);

Basically, the idea is to get how many points are connected to the current primitive's points.
There should be less neighboring points on the contour compared to in the "middle".

In a Wrangle set to Run Over Primitives, get all the current points.
Then, for each points, add up the neighbourcount.
Looking into the Geometry Spreadsheet, we can see that the two lowest numbers are 5 and 6.
So, if the count is 6 or lower, removeprim(0, @primnum, 1).

It feels a bit cleaner with only one node, but it's a bit more complicated.
It's up to you what you prefer more !
I'm sure there are plenty of other ways.

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...