hi all
i try to make this compound: Test Strand inside Geometry (and then deleting this point if he has at least one strandposition outside the geometry)
so i took the point in volume and replaced the get pointposition with get strandposition.
how can i get the point ID of a corresponding Strandposition?
is there a way to find out which strandpositions belong to which point id?
Test Strand inside Geometry
-
caledonian_tartan
- Posts: 253
- Joined: 17 Feb 2010, 14:13
Test Strand inside Geometry
SI 2015 @ WIN7-64
-
Mathaeus
- Posts: 1778
- Joined: 08 Jun 2009, 19:11
- Location: Zagreb, Croatia
Re: Test Strand inside Geometry
'strand point id' , you get this by 'get array subindices'.
Now if there is a 'clean cut' at some point, all strand above this point are on one side, all bellow are on another, you can just convert the Boolean result of 'point in volume', to integer, get array summary - and that's all what you need for "resize array'.
By the way there are two ( I think) compounds in Kristinka Hair, doing a hair cut by geometry in this way, one is by Jonah Friedman of Psyop, second, a bit older, by me. 'kH3 Cut By Geo Volume' or something like. Jonah's compound creates an array of raycasting along tangents, so it has much better precision than mine.
Now if there is a 'clean cut' at some point, all strand above this point are on one side, all bellow are on another, you can just convert the Boolean result of 'point in volume', to integer, get array summary - and that's all what you need for "resize array'.
By the way there are two ( I think) compounds in Kristinka Hair, doing a hair cut by geometry in this way, one is by Jonah Friedman of Psyop, second, a bit older, by me. 'kH3 Cut By Geo Volume' or something like. Jonah's compound creates an array of raycasting along tangents, so it has much better precision than mine.
-
caledonian_tartan
- Posts: 253
- Joined: 17 Feb 2010, 14:13
Re: Test Strand inside Geometry
hey mathaeus
thank you very much. this is great! and working.
i also tried "KH3 Find Cut Point JF" which outputs a scalar. i guess it's the strand ratio where it gets cut.
i just plugged into "multiply" and "kh3 hair length". nice!
btw.: i meant to get the point ID of the point the strands sits on from any of its strandpositions.
the "get array subindices" leads to "strand point id" which won't lead me to it's actual point id.
i this possible, or am i trapped in a brainloop (again)?
again, thanks!
thank you very much. this is great! and working.
i also tried "KH3 Find Cut Point JF" which outputs a scalar. i guess it's the strand ratio where it gets cut.
i just plugged into "multiply" and "kh3 hair length". nice!
btw.: i meant to get the point ID of the point the strands sits on from any of its strandpositions.
the "get array subindices" leads to "strand point id" which won't lead me to it's actual point id.
i this possible, or am i trapped in a brainloop (again)?
again, thanks!
SI 2015 @ WIN7-64
-
Mathaeus
- Posts: 1778
- Joined: 08 Jun 2009, 19:11
- Location: Zagreb, Croatia
Re: Test Strand inside Geometry
if I understand correctly (forget me if I missing the point), mentioned "array summary" is already in per point context, so, if value is anything more than zero, there is intersection for some point position. So you can create/set some custom attribute as Boolean (*if* array summary is more than zero...), then use this as criteria after some geo query (get closest points or so).caledonian_tartan wrote:hey mathaeus
btw.: i meant to get the point ID of the point the strands sits on from any of its strandpositions.
the "get array subindices" leads to "strand point id" which won't lead me to it's actual point id.
Regarding scalar output of Jonah's compound, yes I think it's ratio. Both compounds actually rescales strands, keeping the original size of strand array, instead of 'real' cut. It's cleaner way for possible interpolation later, also makes easier life for some renderers.
-
caledonian_tartan
- Posts: 253
- Joined: 17 Feb 2010, 14:13
Re: Test Strand inside Geometry
cool!
i understand now.
thanks for the tips regarding rendering!
i understand now.
thanks for the tips regarding rendering!
SI 2015 @ WIN7-64