Justin K Posted February 2, 2018 Share Posted February 2, 2018 (edited) Hello all, I am trying to remove prims by an attribute value, here prim attr area. I understand you can do this with a blast, a delete, or a primitive wrangle. I have tried all the methods, decided on the primitive wrangle, and for some reason I cannot delete by the attribute @area (calculated in a measure sop), unless the condition is @area == 0, which is not what I want. Code is really simple, Im just confused as hell as to why it wont actually work. I have a primitive @area attribute then run the following if(@area < .1) removeprim(geoself(), @primnum, 1); What gives? Please check scene file if you can! I have used this setup in the past successfully, it doesnt seem to be working here. Many thanks! Modeling_03_Projection_upl.hipnc Edited February 2, 2018 by JKeil Quote Link to comment Share on other sites More sharing options...
ikoon Posted February 2, 2018 Share Posted February 2, 2018 I did not dig deep into it, but it seems to work, if you set the condition to suit just some of the primitives. See also the picture and Geometry Spreadsheet. if(@area < 7.65361e-05) removeprim(geoself(), @primnum, 1); Quote Link to comment Share on other sites More sharing options...
Justin K Posted February 2, 2018 Author Share Posted February 2, 2018 5 minutes ago, ikoon said: I did not dig deep into it, but it seems to work, if you set the condition to suit just some of the primitives. See also the picture and Geometry Spreadsheet. if(@area < 7.65361e-05) removeprim(geoself(), @primnum, 1); Thanks ikoon-- reinforces the idea of being able to at least delete prim values set to 0. I just dont understand why I cant delete by a range of values more arbitrarily-- why would I have to specify a value that already exists within the attribute? This value might change depending on parameters Quote Link to comment Share on other sites More sharing options...
ikoon Posted February 2, 2018 Share Posted February 2, 2018 (edited) I am not sure if I understand. You were doing it right, 0.1 was just too big number. If you want a procedural number to delete by ... for example average between the minimal (nonzero) area and the maximal area, you may do this. Btw I am used to brace { } the the multiline if statement. Edit: I had it running on points in the original reply. Modeling_03_Projection_upl-2.hipnc Edited February 2, 2018 by ikoon Quote Link to comment Share on other sites More sharing options...
Justin K Posted February 2, 2018 Author Share Posted February 2, 2018 (edited) 59 minutes ago, ikoon said: I am not sure if I understand. You were doing it right, 0.1 was just too big number. If you want a procedural number to delete by ... for example average between the minimal (nonzero) area and the maximal area, you may do this. Btw I am used to brace { } the the multiline if statement. Edit: I had it running on points in the original reply. Modeling_03_Projection_upl-2.hipnc As you just said, I now realize that the problem wasnt as much the approach as the values. The number value I needed was very specific. After the zero value faces were deleted, I needed a number slightly less then the maximum as a filter: too far below the value and I would have no result simply because the areas of the primitives were all fairly close value wise to the maximum). Slightly above the maximum and I would obviously have no primitives left at all! I added a channel to replace the /2. In the future, I will utilize the min or max field set up you have here--and include braces . Many thanks for your help! Ive attached the result and a pic-- I used this setup to then apply a geo setup along the uvs of another geo--inspired by the entagma fabric tutorial Modeling_03_Projection_pul.hipnc Edited February 2, 2018 by JKeil 1 1 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.