I am looking for a functionality to split a group in 2 when a polyline is drawn over a group which starts from one of the edges of the group and ends at the same or any other edge of the group. The original group can be a polygon or a rectangle. Also the two newly created groups after the split can also be of either shapes. Something like below –
The steps can be –
first, check if the polyline has two intersections with group edges, which basically suffices the condition for the split.
second, if first point is true, remove the older group and create two new groups with a little offset.
OR
restructure the older group to create two new groups.