closest point on strand point cloud

Discussions about SOFTIMAGEs© Interactive Creative Environment©
Post Reply
jamination
Posts: 174
Joined: 10 Jul 2009, 21:58

closest point on strand point cloud

Post by jamination » 21 Mar 2011, 07:05

Is it possible to get the closest point on a strand object, my first pass at yield no luck.

Phil
Phil Harbath
Jamination Productions

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 21:11
Location: Zagreb, Croatia
Contact:

Re: closest point on strand point cloud

Post by Mathaeus » 21 Mar 2011, 09:53

No, at least not with out-of-the-box nodes. It works only in one direction, from strand position, not reverse. You can workaround it in some cases, by building a 'target' point cloud around strand positions, or using Helge's extrusions. But this doesn't work in every case, let's say, you won't be able to query the 'self' point cloud.

Cheers

User avatar
Roughy
Posts: 9
Joined: 10 Jul 2009, 20:52

Re: closest point on strand point cloud

Post by Roughy » 22 Mar 2011, 19:06

Would this do? http://www.xsibase.com/forum/index.php? ... adid=44372

As Mathaeus pointed out the first method won't work if you want the closest strand points of the same cloud, but the method used for sticking points to strand segments would do that just fine if you just move the "prepare strand data" stuff over to the cloud you're working in. Well, and remove a bunch of stuff if you only want the closest of the strandposition points rather than the closest point along a segment of the strand.

fabricio.chamon
Posts: 94
Joined: 09 Jun 2009, 23:47

Re: closest point on strand point cloud

Post by fabricio.chamon » 25 Mar 2011, 05:57

Not with default factory nodes, but yes it is possible.

Like Roughy said, it is not trivial to lookup points on segments, but if all you need is to test against strandpositions, here's a simple scene that does what you want.

It is setting a per object stradposition array on the pointcloud that is generating the strands. On the other pointcloud (debug), there is a "get closest point on strand" compound reading the strandposition array and comparing to the specified test position (in this case a null global pos). The compound is outputing both closest strandPosition and its particle location, so that you can extract more information other than the strandposition itself (strandIndex, particle ID, etc).

just be sure to sync the array names on both compounds.
Attachments
get closest point on strand - screen shot
get closest point on strand - screen shot
closest_point_on_strand.png (7.43 KiB) Viewed 1672 times
Get Closest Point On Strand.rar
get closest point on strand
(100.97 KiB) Downloaded 102 times

fabricio.chamon
Posts: 94
Joined: 09 Jun 2009, 23:47

Re: closest point on strand point cloud

Post by fabricio.chamon » 25 Mar 2011, 06:06

...should note that the "Store Per Object Arrays" compound may become slow on complex pointclouds, because ice is traversing the whole dataset and its strandpositions to build the per object arrays. (read: nested Repeat nodes)

It surely can be optimized with a compiled node made by some user that does the per point to per object array conversion, but I don't remember where I saw this node, neither who did it. =)

User avatar
Hirazi Blue
Administrator
Posts: 5107
Joined: 04 Jun 2009, 12:15

Re: closest point on strand point cloud

Post by Hirazi Blue » 25 Mar 2011, 08:20

Do you perhaps mean nassosy's Per Point To Array?
:-\
Stay safe, sane & healthy!

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 21:11
Location: Zagreb, Croatia
Contact:

Re: closest point on strand point cloud

Post by Mathaeus » 25 Mar 2011, 11:22

btw, my answer in second post is based on, probably, specific point of view: using a huge count of strands, and all that by a 'common' user, far away of my assistance (that is, creating hair in ICE). Maybe it's interesting maybe it's not, I've learned ....
1. to generally avoid the usage of custom, hard coded nodes, even ones created by a former SI developer. Because of a much better chance someone will find a combination that cause crash. Not me, author, but someone will..
2. to generally avoid the 'found in array' node, at least if something 'heavy' is plugged in. However, it seems to work very well with 'simple' tasks (for example, 'found or not' when ray-casting..)
3. to avoid creation of 'concatenated' strand arrays - it's slow, at least when something rely on this. I had something along this line, for allowing user to use the ICE multiple port feature, using just one input per styling curve. I had to remove node that used this, finally..
4. factory geometry queries, that's OK, in 99% cases.

From 'common' , 'me and my ninja skills' :) approach to ICE, probably everything is possible - but... it's really not my personal point of view....

Cheers

fabricio.chamon
Posts: 94
Joined: 09 Jun 2009, 23:47

Re: closest point on strand point cloud

Post by fabricio.chamon » 25 Mar 2011, 15:49

@Hirazi: yes, its this one! Thanks. (and thanks Nassosy for providing the compound!)

@Mathaeus: that's totally coherent point of view, I agree with everything you said. On the other hand (regarding 2 and 3), I like the possibility of having a heavy but doable solution instead of nothing at all (when 'concatenated' strand arrays are the only method you can rely on - not saying this is the only answer tho Phil's question though).
I can fully understand you put performance as top priority because you have been doing lots of Hairs in Kristinka (great tool, btw!). I've been doing Trees, which doesn't require the same strand amount, probably that's why I'm trying to put control on the same priority level as performance. That said, yes, I'm also trying to avoid using "find on array" and concatenated arrays as much as possible... =)

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 21:11
Location: Zagreb, Croatia
Contact:

Re: closest point on strand point cloud

Post by Mathaeus » 26 Mar 2011, 10:25

yeah, some more detailed description by a first poster, wouldn't hurt :). Just to finish my part in this thread, I've played with 'closest point on strand point cloud', mainly trying to do some kind of ICE based ambient occlusion. Even I got some close-to-usable-solution in ICE, 3delight's point-based AO was actually what I wanted..

Anyway, it's really great to see the all these new ICE solutions all around.

cheers

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests