Commit befc7564 authored by Luc Maisonobe's avatar Luc Maisonobe
Browse files

Fixed potential infinite loops in tesselation.

This occurs in very rare cases due to numerical noise.

Fixes #792
parent 666ae09d
......@@ -2,7 +2,7 @@
<project name="orekit" default="jar" basedir=".">
<property name="project.version" value="10.3" />
<property name="project.version" value="10.3.1" />
<property name="src.dir" location="src" />
<property name="main.src.dir" value="${src.dir}/main/java" />
......
......@@ -5,7 +5,7 @@
<groupId>org.orekit</groupId>
<artifactId>orekit</artifactId>
<packaging>jar</packaging>
<version>10.3</version>
<version>10.3.1</version>
<name>ORbit Extrapolation KIT</name>
<url>http://www.orekit.org/</url>
......
......@@ -20,6 +20,14 @@
<title>Orekit Changes</title>
</properties>
<body>
<release version="10.3.1" date="2021-06-16"
description="Version 10.3.1 is a patch release of Orekit.
It fixes one critical bug that could cause potential infinite loops in tesselation
in very rare cases due to numerical noise.">
<action dev="luc" type="fix" issue="792">
Fixed potential infinite loops in tesselation in very rare cases due to numerical noise.
</action>
</release>
<release version="10.3" date="2020-12-21"
description="Version 10.3 is a minor release of Orekit.
It includes both new features and bug fixes. New features introduced
......@@ -34,8 +42,8 @@
during state transition matrix calculation. It also fixes issues in Kalman
orbit determination and CCSDS ADM format. See the list below for a full
description of the changes.">
<action dev="bryan" type="update" issue="741">
Updated Hipparchus version to 1.8 and updated code with new functionalities.
<action dev="bryan" type="update" issue="741">
Updated Hipparchus version to 1.8 and updated code with new functionalities.
</action>
<action dev="bryan" type="add" issue="740">
Added aggregator for bounded attitude providers.
......
......@@ -26,6 +26,7 @@ import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Queue;
import org.hipparchus.exception.LocalizedCoreFormats;
import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.hipparchus.geometry.partitioning.BSPTree;
import org.hipparchus.geometry.partitioning.Hyperplane;
......@@ -41,6 +42,7 @@ import org.hipparchus.util.FastMath;
import org.hipparchus.util.MathUtils;
import org.orekit.bodies.GeodeticPoint;
import org.orekit.bodies.OneAxisEllipsoid;
import org.orekit.errors.OrekitException;
import org.orekit.errors.OrekitInternalError;
/** Class used to tessellate an interest zone on an ellipsoid in either
......@@ -65,6 +67,11 @@ import org.orekit.errors.OrekitInternalError;
*/
public class EllipsoidTessellator {
/** Safety limit to avoid infinite loops during tesselation due to numerical noise.
* @since 10.3.1
*/
private static final int MAX_ITER = 1000;
/** Number of segments tiles sides are split into for tiles fine positioning. */
private final int quantization;
......@@ -164,8 +171,13 @@ public class EllipsoidTessellator {
SphericalPolygonsSet remaining = (SphericalPolygonsSet) zone.copySelf();
S2Point inside = getInsidePoint(remaining);
int count = 0;
while (inside != null) {
if (++count > MAX_ITER) {
throw new OrekitException(LocalizedCoreFormats.MAX_COUNT_EXCEEDED, MAX_ITER);
}
// find a mesh covering at least one connected part of the zone
final List<Mesh.Node> mergingSeeds = new ArrayList<Mesh.Node>();
Mesh mesh = new Mesh(ellipsoid, zone, aiming, splitLength, splitWidth, inside);
......@@ -236,8 +248,13 @@ public class EllipsoidTessellator {
SphericalPolygonsSet remaining = (SphericalPolygonsSet) zone.copySelf();
S2Point inside = getInsidePoint(remaining);
int count = 0;
while (inside != null) {
if (++count > MAX_ITER) {
throw new OrekitException(LocalizedCoreFormats.MAX_COUNT_EXCEEDED, MAX_ITER);
}
// find a mesh covering at least one connected part of the zone
final List<Mesh.Node> mergingSeeds = new ArrayList<Mesh.Node>();
Mesh mesh = new Mesh(ellipsoid, zone, aiming, splitLength, splitWidth, inside);
......@@ -317,8 +334,13 @@ public class EllipsoidTessellator {
boolean expanding = true;
final Queue<Mesh.Node> newNodes = new LinkedList<Mesh.Node>();
newNodes.addAll(seeds);
int count = 0;
while (expanding) {
if (++count > MAX_ITER) {
throw new OrekitException(LocalizedCoreFormats.MAX_COUNT_EXCEEDED, MAX_ITER);
}
// first expansion step: set up the mesh so that all its
// inside nodes are completely surrounded by at least
// one layer of outside nodes
......
......@@ -45,7 +45,7 @@ with groupID org.orekit and artifactId orekit so maven
internal mechanism will download automatically all artifacts and dependencies
as required.
#set ( $versions = {"10.3": "2020-12-21", "10.2": "2020-07-14", "10.1": "2020-02-19", "10.0": "2019-06-24", "9.3.1": "2019-03-16", "9.3": "2019-01-25", "9.2": "2018-05-26","9.1": "2017-11-26","9.0.1": "2017-11-03","9.0": "2017-07-26","8.0.1": "2017-11-03","8.0": "2016-06-30","7.2.1": "2017-11-03","7.2": "2016-04-05","7.1": "2016-02-07","7.0": "2015-01-11","6.1": "2013-12-13","6.0": "2013-04-23","5.0.3": "2011-07-13","5.0.2": "2011-07-11","5.0.1": "2011-04-18"} )
#set ( $versions = {"10.3.1": "2021-06-16", "10.3": "2020-12-21", "10.2": "2020-07-14", "10.1": "2020-02-19", "10.0": "2019-06-24", "9.3.1": "2019-03-16", "9.3": "2019-01-25", "9.2": "2018-05-26","9.1": "2017-11-26","9.0.1": "2017-11-03","9.0": "2017-07-26","8.0.1": "2017-11-03","8.0": "2016-06-30","7.2.1": "2017-11-03","7.2": "2016-04-05","7.1": "2016-02-07","7.0": "2015-01-11","6.1": "2013-12-13","6.0": "2013-04-23","5.0.3": "2011-07-13","5.0.2": "2011-07-11","5.0.1": "2011-04-18"} )
#foreach( $version in $versions.entrySet() )
| package | link |
......
......@@ -116,29 +116,30 @@ with version 4.1, and up to 7.2, Orekit depends only on officially released vers
Apache Commons Math. Starting with version 8.0, Orekit has switched from Apache Commons
Math to Hipparchus
version | dependency
---------------|---------------------------------------------
Orekit 4.1 | Apache Commons Math 2.0
Orekit 5.0 | Apache Commons Math 2.1
Orekit 5.0.3 | Apache Commons Math 2.2
Orekit 6.0 | Apache Commons Math 3.2
Orekit 6.1 | Apache Commons Math 3.2
Orekit 7.0 | Apache Commons Math 3.4.1
Orekit 7.1 | Apache Commons Math 3.6
Orekit 7.2 | Apache Commons Math 3.6.1
Orekit 7.2.1 | Apache Commons Math 3.6.1
Orekit 8.0 | Hipparchus 1.0
Orekit 8.0.1 | Hipparchus 1.0
Orekit 9.0 | Hipparchus 1.1
Orekit 9.0.1 | Hipparchus 1.1
Orekit 9.1 | Hipparchus 1.2
Orekit 9.2 | Hipparchus 1.3
Orekit 9.3 | Hipparchus 1.4
Orekit 9.3.1 | Hipparchus 1.4
Orekit 10.0 | Hipparchus 1.5
Orekit 10.1 | Hipparchus 1.6
Orekit 10.2 | Hipparchus 1.7
Orekit 10.3 | Hipparchus 1.8
version | dependency
----------------|---------------------------------------------
Orekit 4.1 | Apache Commons Math 2.0
Orekit 5.0 | Apache Commons Math 2.1
Orekit 5.0.3 | Apache Commons Math 2.2
Orekit 6.0 | Apache Commons Math 3.2
Orekit 6.1 | Apache Commons Math 3.2
Orekit 7.0 | Apache Commons Math 3.4.1
Orekit 7.1 | Apache Commons Math 3.6
Orekit 7.2 | Apache Commons Math 3.6.1
Orekit 7.2.1 | Apache Commons Math 3.6.1
Orekit 8.0 | Hipparchus 1.0
Orekit 8.0.1 | Hipparchus 1.0
Orekit 9.0 | Hipparchus 1.1
Orekit 9.0.1 | Hipparchus 1.1
Orekit 9.1 | Hipparchus 1.2
Orekit 9.2 | Hipparchus 1.3
Orekit 9.3 | Hipparchus 1.4
Orekit 9.3.1 | Hipparchus 1.4
Orekit 10.0 | Hipparchus 1.5
Orekit 10.1 | Hipparchus 1.6
Orekit 10.2 | Hipparchus 1.7
Orekit 10.3 | Hipparchus 1.8
Orekit 10.3.1 | Hipparchus 1.8
### Maven failed to compile Orekit and complained about a missing artifact.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment