# GeometryEngine.Cut inconsistent with result side order

488
2
03-28-2022 01:32 PM
Occasional Contributor

The GeometryEngine.Cut method is inconsistent with which side of the result gets returned first, meaning I have to do additional analysis to figure out which result item is on which side. Coming from ArcObjects, I'm accustomed to the first result being the left side and the second being the right, and that expectation appears to hold based on the documentation's code example. However, the first value returned when cutting a polygon is sometimes the left side and sometimes the right. The order is always the same for a given input, but different inputs may swap the order.

In the image below (created in GeoGebra), one set of inputs/outputs is in blue; the other in orange. Both cut lines are oriented southeast, and the points are the northernmost point of each result's side. The orange line (angle ~330 degrees) returns the left side at index 0, but the blue line (angle ~334 degrees) returns the right side at index 0.

Is the intent for developers to do further analysis to determine which result is the left side? Is there a "rule" for which side is at index 0?

Tags (5)
2 Replies
Occasional Contributor

In case some clarity is needed for the drawing, the points labeled "Left" are from the first result, and the points labeled "Right" are from the second. That means that for the orange set, "vLeft" is the northernmost point in the first result, which matches the "left comes first" expectation from ArcObjects and the documentation. However, for the blue set, "vRight" is the northernmost point in the second result, which goes against the "left comes first" expectation.

Hopefully that helps.

by Anonymous User
Not applicable

Hi Stephen,

The first geometry in the result should be the left one, but I can't reproduce this. Could you share with me the coordinates of the lines and the cutter line?

Thanks,

Annette