c4d.utils.Neighbor.GetPointOneRingPoints() unexpected behavior



  • Environment: R20, Win
    Language: Python

    Hello,

    is it possible that the method c4d.utils.Neighbor.GetPointOneRingPoints() is (currently) bugged? The documentation states that it will return "the points that are attached through one edge to the given point". The problem occurs on points which are either edge or corner cases of a non-closed surface. Below is a simple example to illustrate the problem. The orange points are the inputs for the method, the green points are the output, and red points are points not included in the output - but I would expect them to be included:

    example.png

    1. An edge case. We get the two green points but not the red one.
    2. A default case. Everything is fine here, we get four points.
    3. A corner case. We only get the green point but not the red one.

    One can reproduce the behavior in the console on a similar topology (and different point IDs) with the following code:

    >>> from c4d import utils
    >>> nbr = utils.Neighbor()
    >>> nbr.Init(op)
    True
    >>> nbr.GetPointOneRingPoints(26) #edge case
    [52, 27]
    >>> nbr.GetPointOneRingPoints(39) #default case
    [65, 38, 40, 13]
    >>> nbr.GetPointOneRingPoints(25) #corner case
    [24]
    

    Thank you for your attention,
    zipit



  • Hello,

    I can confirm this bug. I've reported it.

    It can just return a number of points equal to the number of polygons attached to that point. So for all boundary points it will failed. (corner points are attached to only one poly but have two edges)

    Also the result with ngon is maybe not the one expected (it take into account the ngon lines)

    Cheers,
    Manuel



  • I was probably a bit unclear about my intentions in the initial posting. I am aware that retrieving the connected points with other methods of the Neighborclass is trivial. This posting should be read as either a bug report or at least my opinion that the SDK documentation is very ambiguous about the purpose of the method GetPointOneRingPoints().

    I am not looking for a technical solution. The whole flag your posting thing here confuses me a bit ;)

    cheers,
    zipit



  • Hello,

    I can confirm this bug. I've reported it.

    It can just return a number of points equal to the number of polygons attached to that point. So for all boundary points it will failed. (corner points are attached to only one poly but have two edges)

    Also the result with ngon is maybe not the one expected (it take into account the ngon lines)

    Cheers,
    Manuel



  • Ok, thank you. I was a bit unsure what "one ring points" are supposed to be and if this is actually a bug and not a feature ;)

    Cheers,
    zipit


Log in to reply