Showing posts with label measure. Show all posts
Showing posts with label measure. Show all posts

Monday, 7 April 2025

getting areas of pieces and removing them. Eg object is being divided somehow.

 


Say you want to blast the large lower shape to just get the caps, but this shape is evolving and moving (and therefore the parts you want to delete are changing in size & number/point count etc!)....
You gotta measure the area of each "connected" piece, then kill them based on a threshold. It's easy when you say that, but actually there's a bit of other stuff involved.
   

This is the rough setup.
So make a For Each block & set it to Primitives. Do a Measure - select Area. This only gives us the area per FACE. We want the whole piece's area. Sooo, we promote it to Detail level & use the SUM promotion method. ie - it adds all the area attribs on a piece together. 


Once this has been done I promote the attribute back to Point level (using average as the promotion method).

Outside of the loop we can write a little wrangle to delete the pieces based on area-

Just a simple removepoint expression. I use a float channel slider so that the value can be tuned for the animation. it might not be necessary for you.

Shoutout to Felix for helping out with the attribute promoting bits!








Wednesday, 29 May 2024

getting distance to object in camera

 vlength(vtorigin(".","../FOCUS_MAN"))


paste this into the Focus Distance parameter, replacing FOCUS_MAN with whichever object/null you're following.