Skip to content

In ContOrientedBox3 the ResultValid is always false. #211

@cmuschong

Description

@cmuschong

ResultValid is always false. The ResultValid in ContOrientedBox3 is never set to true.

public class ContOrientedBox3
{
public Box3d Box;

public bool ResultValid;

public ContOrientedBox3(IEnumerable<Vector3d> points)
{
    GaussPointsFit3 gaussPointsFit = new GaussPointsFit3(points);
    if (gaussPointsFit.ResultValid)
    {
        Box = gaussPointsFit.Box;
        Box.Contain(points);
    }
}

public ContOrientedBox3(IEnumerable<Vector3d> points, IEnumerable<double> pointWeights)
{
    GaussPointsFit3 gaussPointsFit = new GaussPointsFit3(points, pointWeights);
    if (gaussPointsFit.ResultValid)
    {
        Box = gaussPointsFit.Box;
        Box.Contain(points);
    }
}

}

Fix:

if (gaussPointsFit.ResultValid)
{
ResultValid = true;
Box = gaussPointsFit.Box;
Box.Contain(points);
}

Best regards,
Chris

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions