Jon Parker

jparker

About Me

EXPERTISE
Technical Director

Connect

LOCATION
tokyo, Japan

Houdini Skills

ADVANCED
Procedural Modeling  | Digital Assets  | Mantra  | Lighting  | PDG  | VEX  | Python

Availability

Not Specified

Recent Forum Posts

VEX - xyzdist on overlapping prims May 6, 2024, 2:20 a.m.

animatrix_
Hi,

I don't think xyzdist would return all of them. I haven't tested this but I suspect it returns the polygon whose normal is pointing towards the origin point.

In any case if you want to detect all overlapping polygons, you could use xyzdist first to find the nearest prim and then fire a ray in that direction using the intersect_all VEX function to find all intersected prims along that direction:
https://www.sidefx.com/docs/houdini/vex/functions/intersect_all.html [www.sidefx.com]

intersect_all sounds like a good idea, but I tried this on a point inside of a tetrahedral and intersect_all doesn't seem to be aware that it's within the prim unfortunately, which *does* work when using xyzdist.

An idea for grabbing all prims is to use within a render time shader and accumulate samples, but looping over all prims is going to be too expensive.

A constraint for my requirement is that the points that define the prim don't necessarily overlap, just end up generating a prim that can be found in the same sample point.

VEX - xyzdist on overlapping prims May 3, 2024, 9:16 p.m.

What does xyzdist do if two prims are overlapping identically?

I'm asking because I wonder if there is a way to detect all prims that are exactly the closest (for overlapping triangles or tetrahedrals).

https://www.sidefx.com/docs/houdini/vex/functions/xyzdist.html [www.sidefx.com]

Creating explicit save layers with Python March 26, 2024, 11:23 p.m.

That did it! Thanks for the tip. Very cool to see this works!

EDIT: BTW, I did it manually instead of using loputils to keep the core code free of Houdini dependencies.