Open WJSchakel opened 1 year ago
OtsPoint3d
, OtsShape
, DirectedPoint
and Bounds
have been removed. Djutils classes are used instead.OtsLine3d
remains, now with 2D underlying information.OtsLine3d
constructors based on jts library objects have been removed. They were not used.OtsLine3d
methods now return a 2D result wrapped in a new OtsLine3d
based on very similar methods in PolyLine2d
from djutils on the underlying 2D line.PerceivedObject2d
and PerceivedObject3d
were removed, they were not used.Point2d.intersectionOfLineSegments()
), a point on the GTU path that is on the line to cross at the end of the lane, may not result in a found intersection. Therefore, if no intersection is found, each point in the path is projected on the line to cross, and if the fraction is within the range [0...1], and the distance is <1e-6, the point is considered to be crossed by the path. 2) Now that lanes are no longer forced to have the first/last segment in the direction of the node, fractional projection required the node directions at the endpoints. Otherwise the reference point could sometimes not be projected to any lane.What still remains is the following:
OtsLine3d
, possibly more) elevation information needs to be added as separate information.How OtsLine3d
returns its information remains to be seen. For example, the get(int)
method now simply returns a Point2d
from the underlying PolyLine2d
.
Rather than adding elevation data to OtsLine3d
, it is instead added to Link
. Therefore OtsLine3d
has also been named OtsLine2d
. The class remains a valid class in OTS as it add features over an PolyLine2d
, most noteworthy the fractional projection.
Link
now has the following methods:
Length getElevation(Length)
Length getElevation(double)
double getGrade(Length)
double getGrade(double)
Both elevation and grade can be requested at a length, or fractional length. The class CrossSectionElement
has the same methods, and refers to the link. Note that in this manner, only the link needs to store elevation data (when relevant). Elevation data may also be null
, in which case the elevation and grade are always 0.
The following classes can be removed, and djutils draw objects can be used instead. If any feature is not yet present in djutils draw, this has to be implemented there before a complete removal.
OtsPoint3d
>Point2d
/Point3d
OtsShape
>Polygon2d
DirectedPoint
>OrientedPoint2d
/OrientedPoint3d
Bounds
>Bounds2d
/Bounds3d
Furthermore,
OtsLine3d
will remain, but use aPolyLine2d
and different elevation information underneath.Other relevant classes are
Bezier
andClothoid
. These contain features not yet placed in djutils draw. In fact, they are quite different. For now it might be better to keep them, until the editor is more developed.Any remaining dependency on the JTS library will also be removed.