Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CombineRegions[regions_List] := ReplaceRepeated[regions,
- {a___, {id1_, region1_}, b___, {id2_, region2_}, c___}
- /; RegionMeasure@RegionIntersection[region1, region2] > 0 :>
- {a, b, c, {Join[id1, id2], RegionUnion[region1, region2]}
- }
- ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement