I’d like to calculate the area of a variety of polygonal surfaces starting from a series of lines crossing each other within a rectangular boondary.

Thought about “SplitByPoints” to split the lines into segments using the mutual intersection points between the lines. But how could I obtain a list of polygonal “surfaces” from all those segments to finally extract the areas from?

= = = = =

geometry = [Imperative]

{

// create rectangular line points

start_e1 = Point.ByCoordinates(0,0);

end_e1 = Point.ByCoordinates(10,0);

start_e2 = Point.ByCoordinates(10,0);

end_e2 = Point.ByCoordinates(10,10);

start_e3 = Point.ByCoordinates(10,10);

end_e3 = Point.ByCoordinates(0,10);

start_e4 = Point.ByCoordinates(0,10);

end_e4 = Point.ByCoordinates(0,0);

// create free line points

start_l1 = Point.ByCoordinates(1,0);

end_l1 = Point.ByCoordinates(8,10);

start_l2 = Point.ByCoordinates(4,0);

end_l2 = Point.ByCoordinates(2,10);

start_l3 = Point.ByCoordinates(9,0);

end_l3 = Point.ByCoordinates(6,10);

start_l4 = Point.ByCoordinates(0,2);

end_l4 = Point.ByCoordinates(10,1);

start_l5 = Point.ByCoordinates(0,4);

end_l5 = Point.ByCoordinates(10,8);

start_l6 = Point.ByCoordinates(0,8);

end_l6 = Point.ByCoordinates(10,2);

// create lists of start-/end-points

startpoints = {start_e1,start_e2,start_e3,start_e4,start_l1,start_l2,start_l3,start_l4,start_l5,start_l6};

endpoints = {end_e1,end_e2,end_e3,end_e4,end_l1,end_l2,end_l3,end_l4,end_l5,end_l6};

// create lines

lines = Line.ByStartPointEndPoint(startpoints,endpoints);

return = lines;

};

= = = = =