commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luc Maisonobe (JIRA)" <>
Subject [jira] [Created] (MATH-1266) split and side methods may be inconsistent in BSP trees
Date Fri, 04 Sep 2015 13:55:45 GMT
Luc Maisonobe created MATH-1266:

             Summary: split and side methods may be inconsistent in BSP trees
                 Key: MATH-1266
             Project: Commons Math
          Issue Type: Bug
    Affects Versions: 3.5
            Reporter: Luc Maisonobe
            Assignee: Luc Maisonobe

In BSP trees, there are two related methods dealing with the relative position of a sub-hyperplane
and an hyperplane: side and split.

sub.side(hyperplane) returns an enumerate (PLUS, MINUS, BOTH, HYPER) telling the relative
position of the syb-hyperplane with respect to the hyperplane.

sub.split(hyperplane) splits the sub-hyperplane in two parts, one on the plus side of the
hyperplane and one on the minus side of the hyperplane.

These methods should be consistent, i.e. when side returns BOTH, then split should return
two non-null parts. This fails in the following case:

    public void testSideSplitConsistency() {

        double tolerance = 1.0e-6;
        Circle hyperplane = new Circle(new Vector3D(9.738804529764676E-5, -0.6772824575010357,
        SubCircle sub = new SubCircle(new Circle(new Vector3D(2.1793884139073498E-4, 0.9790647032675541,
                                      new ArcsSet(4.7121441684170700, 4.7125386635004760,
        SplitSubHyperplane<Sphere2D> split = sub.split(hyperplane);
        Assert.assertEquals(Side.MINUS, sub.side(hyperplane));


In fact, it is only one particular case, the same could occur in other spaces (Euclidean or
Spherical, and on various dimensions)

This message was sent by Atlassian JIRA

View raw message