Skip to content

Fails to Account for non-matching Normals Vector Size #212

@Andr3wPearce

Description

@Andr3wPearce

Within the pybind11 folder, the following code is found for the ccPointCloudPy.normalsFromNPArray_copy:

if (!self.hasNormals())
        self.reserveTheNormsTable();
    const PointCoordinateType *s = reinterpret_cast<const PointCoordinateType*>(array.data());
    for (size_t i=0; i<self.size(); ++i)
    {
        const CCVector3& N = reinterpret_cast<const CCVector3&>(s[3*i]);
        CCVector3 NN = N;
        NN.normalize();
        self.setPointNormal(i, NN);
    }

When I export a cloud from CloudCompare, it has a normals vector with a shape of (1). I'm not entirely sure why this is, but to fix, the code just needs to check the size of the previous normals and confirm they match the shape expected(which is (N, 3)).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions