3
$\begingroup$

I have two different point clouds. One creates a convex hull, for which I can access normals, face mid points, vertices, edges, etc.

The second point cloud (in blue) is scattered around the scene. For each point of this point cloud, I want to perform the following computation: $$\sum\limits_{\vec{n}} \left[\vec{n}\cdot (\vec{x_b} - \vec{x_g})<0\right]$$

The sum should be performed for each position of a blue point $\vec{x_b}$ over all normals and mid points $\vec{x_g}$ of the convex hull. The sum is a sum of boolean values and in the end, I want to know for each point, whether the sum is zero or larger. I was able to solve the task for one single point, where I had the position of the point as an input vector node and piped it into both geometry lines. But I have no idea, how I can do it for a collection of points, whose positions I do not know a priori.

enter image description here

$\endgroup$
0

1 Answer 1

3
$\begingroup$

Use a repeat zone.

Use Convex Hull > Domain Size (Face Count) to find the face count and use it as the number of iterations of the repeat zone.

Add your custom iterator in the repeat zone (an integer). Sample the convex hull geometry with the index of the iterator.

Store your results in a custom attribute. I used an integer attribute that is increment when your comparison $\vec{n}\cdot (\vec{x_b} - \vec{x_g})<0$ is true.

node tree

You can inspect the value of the custom attribute sum in the spreadsheet editor.

spreadsheet editor

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .