Jump to content

Packed Primitive mass, size or area attribute


Recommended Posts

Hi all,

I have a fractured geometry and I need to calculate a mass, size or area attribute for each piece. I'm using an assemble sop to create packed geometry and I animate each piece with a vex expression using the intrinsic transforms of the pieces. However I'd like the animation to be varied by an attribute that holds a relative size value. 

I know the measure sop calculates area, volume etc but how can I "promote" this value to the packed primitives?

A brute approach would be to get the number of points for each packed primitve. Is there any way to get that info from the packed primitive?

Thanks,

Link to comment
Share on other sites

In case anyone finds this useful,

 The way I solved this was by adding any measured data from the unpacked geometry to a primitive attribute on the packed geometry via a primitive wrangle. The class attribute value created by a connectivity sop corresponds to the primitive id after the assemble so I could compare the class attriute with the primnum. I've attached a simple example file. If however someone has a different solution I would still like to know difrerent ways of approaching something like this.

 

PackedPrimitiveMeasure.hipnc

  • Thanks 1
Link to comment
Share on other sites

hey, so if i understood it correctly, you want to do this: pipe your packed geo to a foreach loop. within it, unpack and get whichever attributes you want (with a pointwrangle for example), repack. for something like volume, within the foreach, you add a measure sop, set it to volume, then add an attribute promote sop (attribute "volume", from primitive to detail, method sum), and lastly demote the volume (another attribute promote, "volume" detail to primitive).

hope this helps!
chris

  • Like 1
  • Thanks 1
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...