If you have a look at the docs for pcfilter, it gives you some VEX code that’s 
the equivalent functionality. You can tweak to suit your needs.

Pasted in from the docs:

- - - - 

float pcfilter(int handle; string channel)
{
    float    sum, w, d;
    float    value, result = 0;
    while (pciterate(handle))
    {
        pcimport(handle, "point.distance", d);
        pcimport(handle, channel, value);
        w = 1 - smooth(0, radius, d);
        sum += w;
        result += w * value;
    }
    result /= sum;
    return result;
}

pcfilter takes the points that were opened by the point cloud and produces a 
filtered value. The following equation shows how the individual points are 
weighted.

w_i = 1-smooth(0, maxd*1.1, d_i);

maxd is the farthest point, and w_i is the weight for a given point at distance 
(d_i). Points that are closer to the center will be weighted higher with that 
formula, rather than it being an average.


> On 26 Apr 2017, at 19:25, Steven Caron <car...@gmail.com> wrote:
> 
> So pcfilter has weighting built into it?
> 
> I guess I want to customize this weighting should I not use pcfilter? and use 
> pcfind and loop over the particles?
> 
> 
> On Wed, Apr 26, 2017 at 11:18 AM, Andy Nicholas <a...@andynicholas.com 
> <mailto:a...@andynicholas.com>> wrote:
> Yep, I’m afraid I’m a complete VEX convert now. I never used to be!
> 
> Cris, don’t mind me posting stuff like that, I’m just doing it in case it’s 
> useful to anyone who’s trying to get into VEX. Actually, when I was learning 
> to do all the point cloud stuff, I found it useful to see the VEX when I was 
> trying to understand how to hook up the pointcloud VOPs. I (still) don’t 
> think it’s obvious how to do it, especially when you start thinking about if 
> it’s necessary to use pcclose() and where that should be wired.
> 
> It’s one of the reasons I moved to VEX, things like “loops" and “if” 
> statements are much easier to understand in VEX than VOPs.
> 
> 
> 
>> On 26 Apr 2017, at 19:07, Steven Caron <car...@gmail.com 
>> <mailto:car...@gmail.com>> wrote:
>> 
>> Thanks guys! I didn't want to use VEX even though I might need to in the 
>> long run.
>> 
>> On Wed, Apr 26, 2017 at 10:57 AM, Andy Nicholas <a...@andynicholas.com 
>> <mailto:a...@andynicholas.com>> wrote:
>> Yep, what Cris said. Here’s some VEX you can drop in a Point Wrangle if you 
>> want to try that approach:
>> 
>> float radius = 1.0;
>> int maxpts = 50;
>> int handle = pcopen(0, "P", @P, radius, maxpts);
>> @P = pcfilter(handle, "P");
>> 
>> 
>>> On 26 Apr 2017, at 18:37, Cristobal Infante <cgc...@gmail.com 
>>> <mailto:cgc...@gmail.com>> wrote:
>>> 
>>> pcopen > pcfilter (P) will give you the nearest positions.
>>> 
>>> 
>>> 
>>> On 26 April 2017 at 18:27, Steven Caron <car...@gmail.com 
>>> <mailto:car...@gmail.com>> wrote:
>>> i hate to do it but i gotta ask this group because of our shared ICE 
>>> knowledge...
>>> 
>>> what is the proper way to get closest points and average their position and 
>>> update the point position?
>>> 
>>> pcfind gives me an integer array, but how do i look up those indices and 
>>> get their point position?
>>> 
>>> pcopen, then pcimport, do work, then pcexport seems like the right thing to 
>>> do, should i just ignore pcfind?
>>> 
>>> thanks
>>> steven
>>> 
>>> ------
>>> Softimage Mailing List.
>>> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com 
>>> <mailto:softimage-requ...@listproc.autodesk.com> with "unsubscribe" in the 
>>> subject, and reply to confirm.
>>> 
>>> ------
>>> Softimage Mailing List.
>>> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com 
>>> <mailto:softimage-requ...@listproc.autodesk.com> with "unsubscribe" in the 
>>> subject, and reply to confirm.
>> 
>> 
>> ------
>> Softimage Mailing List.
>> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com 
>> <mailto:softimage-requ...@listproc.autodesk.com> with "unsubscribe" in the 
>> subject, and reply to confirm.
>> 
>> ------
>> Softimage Mailing List.
>> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com 
>> <mailto:softimage-requ...@listproc.autodesk.com> with "unsubscribe" in the 
>> subject, and reply to confirm.
> 
> 
> ------
> Softimage Mailing List.
> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com 
> <mailto:softimage-requ...@listproc.autodesk.com> with "unsubscribe" in the 
> subject, and reply to confirm.
> 
> ------
> Softimage Mailing List.
> To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com with 
> "unsubscribe" in the subject, and reply to confirm.

------
Softimage Mailing List.
To unsubscribe, send a mail to softimage-requ...@listproc.autodesk.com with 
"unsubscribe" in the subject, and reply to confirm.

Reply via email to