per-face vertexColors spatialQuery

Hello Guys!

I am trying to create a graph ( not .kl code ) which would sphere sample per-face vertexColors to look at neighbour faces and filter using distance based weighting, and then set back the per-face vertexColors.

I have looked in the documentation, and opened all attributes canvas examples. I simply cannot get a graph to work.

Any help would be appreciated.
Dave Lajoie


  • davethejoydavethejoy Posts: 7

    Hello Guys, just checking if anyone has a graph example of a per-vertex spatial query. any help is welcomed.

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    Hi, Dave,

    I'd try ... although I prefer writing KL to using nodes, of course. But I have to admit that I haven't got the slightest idea what exactly you are looking for. Do you have some example - an image, a video or a use case?


    Marc Albrecht - - does things.

  • davethejoydavethejoy Posts: 7

    Sure, let's assume you start with the demo scene Samples/Canvas/Attributes/04_Colors.canvas

    Assume the following difference with that example scene:

    • instead of being "per vertex" it is "per face"
    • I would like to do a spatialQuery of a given face center, to find its surrounding neighbors, and lookup color per face for each of those neighbors, and then apply a kernel filter to all those color per faces, including the original color per face using a weighted distribution based on distance.

    once blurred it would look like this:

    do I make any sense? :)

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    do I make any sense?

    A lot, Sir! :smile:

    I will have to get back to the whole attribute thing and do some location-to-face experiments in order to get the basic setup working. Haven't done that yet, but want to know how to do it, so ... stand by :)

    In general I would expect it to work something like this:
    You get your hit-face from whatever query you fire. Then you take one of the points of that polygon as your starting index, using getPointSurroundingPoints and getPointPolygon to get the indices of the polygons, then extract the respective colors into an array.
    Or, probably, you can use getPolygonAdjacentPolygon instead of going through the points - I'll have to try that :)

    Working on something else right now, but I'll give it a try ASAP!


    Marc Albrecht - - does things.

  • davethejoydavethejoy Posts: 7

    Hello Marc, sorry for late reply. This is what I had in mind, I guess what I am missing is the network to trigger those spatial query. I just seen a post about spatial query being slow, I will check if there are any example files provided with the post, that might just be the thing I need.

Sign In or Register to comment.