{"action":"created","issue":{"url":"https://api.github.com/repos/Hipparchus-Math/hipparchus/issues/41","repository_url":"https://api.github.com/repos/Hipparchus-Math/hipparchus","labels_url":"https://api.github.com/repos/Hipparchus-Math/hipparchus/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/Hipparchus-Math/hipparchus/issues/41/comments","events_url":"https://api.github.com/repos/Hipparchus-Math/hipparchus/issues/41/events","html_url":"https://github.com/Hipparchus-Math/hipparchus/issues/41","id":341026508,"node_id":"MDU6SXNzdWUzNDEwMjY1MDg=","number":41,"title":"Invalid BSPTree created during union","user":{"login":"jerdmanGH","id":25255983,"node_id":"MDQ6VXNlcjI1MjU1OTgz","avatar_url":"https://avatars1.githubusercontent.com/u/25255983?v=4","gravatar_id":"","url":"https://api.github.com/users/jerdmanGH","html_url":"https://github.com/jerdmanGH","followers_url":"https://api.github.com/users/jerdmanGH/followers","following_url":"https://api.github.com/users/jerdmanGH/following{/other_user}","gists_url":"https://api.github.com/users/jerdmanGH/gists{/gist_id}","starred_url":"https://api.github.com/users/jerdmanGH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerdmanGH/subscriptions","organizations_url":"https://api.github.com/users/jerdmanGH/orgs","repos_url":"https://api.github.com/users/jerdmanGH/repos","events_url":"https://api.github.com/users/jerdmanGH/events{/privacy}","received_events_url":"https://api.github.com/users/jerdmanGH/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-07-13T13:49:38Z","updated_at":"2018-07-23T18:00:32Z","closed_at":"2018-07-15T20:49:49Z","author_association":"NONE","body":"It is possible to create an invalid `Sphere2D BSPTree `containing a node with a null `cut `and `attribute `using the `RegionFactory union `method.\r\n\r\nI have been able to trace this down to the `SubCircle split `method. The returned `SplitSubHyperplane `contains one side of the split as null but the `BSPTree split `method assumes that both sides will return non-null values.\r\n\r\nThe code below can be used to reproduce this issue. Note that a lowering the provided tolerance value will \"solve\" the issue but this is an edge case that should still be addressed.\r\n\r\n```\r\n        RegionFactory<Sphere2D> regionFactory = new RegionFactory<>();\r\n        S2Point[] s2pA = new S2Point[]{\r\n                new S2Point(new Vector3D(0.2122954606, -0.629606302, 0.7473463333)),\r\n                new S2Point(new Vector3D(0.2120220248, -0.6296445493, 0.747391733)),\r\n                new S2Point(new Vector3D(0.2119838016, -0.6298173178, 0.7472569934)),\r\n                new S2Point(new Vector3D(0.2122571927, -0.6297790738, 0.7472116182))};\r\n\r\n        S2Point[] s2pB = new S2Point[]{\r\n                new S2Point(new Vector3D(0.2120291561, -0.629952069, 0.7471305292)),\r\n                new S2Point(new Vector3D(0.2123026002, -0.6299138005, 0.7470851423)),\r\n                new S2Point(new Vector3D(0.2123408927, -0.6297410403, 0.7472198923)),\r\n                new S2Point(new Vector3D(0.2120674039, -0.6297793122, 0.7472653037))};\r\n\r\n        final SphericalPolygonsSet spsA = new SphericalPolygonsSet(0.0001, s2pA);\r\n        final SphericalPolygonsSet spsB = new SphericalPolygonsSet(0.0001, s2pB);\r\n        SphericalPolygonsSet invalidSPS = (SphericalPolygonsSet) regionFactory.union(spsA, spsB);\r\n        //Causes a NullPointerException\r\n        System.out.println(invalidSPS.getSize());\r\n```"},"comment":{"url":"https://api.github.com/repos/Hipparchus-Math/hipparchus/issues/comments/407147488","html_url":"https://github.com/Hipparchus-Math/hipparchus/issues/41#issuecomment-407147488","issue_url":"https://api.github.com/repos/Hipparchus-Math/hipparchus/issues/41","id":407147488,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNzE0NzQ4OA==","user":{"login":"jerdmanGH","id":25255983,"node_id":"MDQ6VXNlcjI1MjU1OTgz","avatar_url":"https://avatars1.githubusercontent.com/u/25255983?v=4","gravatar_id":"","url":"https://api.github.com/users/jerdmanGH","html_url":"https://github.com/jerdmanGH","followers_url":"https://api.github.com/users/jerdmanGH/followers","following_url":"https://api.github.com/users/jerdmanGH/following{/other_user}","gists_url":"https://api.github.com/users/jerdmanGH/gists{/gist_id}","starred_url":"https://api.github.com/users/jerdmanGH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerdmanGH/subscriptions","organizations_url":"https://api.github.com/users/jerdmanGH/orgs","repos_url":"https://api.github.com/users/jerdmanGH/repos","events_url":"https://api.github.com/users/jerdmanGH/events{/privacy}","received_events_url":"https://api.github.com/users/jerdmanGH/received_events","type":"User","site_admin":false},"created_at":"2018-07-23T18:00:32Z","updated_at":"2018-07-23T18:00:32Z","author_association":"NONE","body":"I've been playing around with tolerance values to try to determine if there is an \"ideal\" setting that will fit my use case but keep running into issues. The latest is a \"this should never happen\" exception that can be reproduced using the code below. I can submit this as a new issue but it may already be fixed by your previous commit. I'm going to put in a check for minimum allowable size for shapes to see if that gets me past this. I'm hopeful that I can find a workaround without the need for an accelerated release.\r\n\r\n```\r\n        S2Point[] s2pA = new S2Point[]{\r\n                new S2Point(new Vector3D(0.1504230736114679, -0.6603084987333554, 0.7357754993377947)),\r\n                new S2Point(new Vector3D(0.15011191112224423, -0.6603400871954631, 0.7358106980616113)),\r\n                new S2Point(new Vector3D(0.15008035620222715, -0.6605195692153062, 0.7356560238085725)),\r\n                new S2Point(new Vector3D(0.1503914563063968, -0.6604879854490165, 0.7356208472763267))\r\n        };\r\n        final SphericalPolygonsSet spsA = new SphericalPolygonsSet(1E-100, s2pA);\r\n        spsA.getSize();\r\n```"}}
{"actor":{"display_login":"jerdmanGH"}}