GeometryBuilder.createCurve(PointArray) always make cycled curve

Description

I wrote psedo code of test creating Curve.

1 2 3 4 5 private Curve readLineString() { double[] pts = readCoordinateSequenceLineString(size); PointArray parr = builder.createPointArray(pts); return builder.createCurve(parr); }

I set values of pts {1.0, 1.0, 0.0, 2.0, 2.0, 0.0, 4.0, 2.0, 1.0, 5.0, 1.0, 1.0 }
I expected that created Curve instance from the builder.createCurve() is not cycled curve,
but "Curve(1.0 1.0 0.0, 2.0 2.0 0.0, 4.0 2.0 1.0, 5.0 1.0 1.0, 1.0 1.0 0.0) "is returned.

When creating LineSegment from the PointArray in createCurve method, this code always make cycled segments.

1 2 3 4 5 6 7 8 9 10 List/*<LineSegment>*/ segmentList = new ArrayList/*<LineSegment>*/(); for( int i = 0; i < points.size(); i++) { int start = i; int end = (i + 1)%points.size(); // this line always makes cycle at the end of loop. DirectPosition point1 = points.getDirectPosition( start, null ); DirectPosition point2 = points.getDirectPosition( end, null ); LineSegment segment = createLineSegment( point1, point2 ); segmentList.add( segment ); } return getPrimitiveFactory().createCurve( segmentList );

Environment

None

Status

Assignee

Aaryn Olsson

Reporter

Hyung-Gyu Ryoo

Triage

Components

Affects versions

16.0
15.0

Priority

High
Configure