hohlraum / gdsCAD

A simple but powerful Python package for creating photolithography masks in the GDSII format.
GNU General Public License v3.0
88 stars 52 forks source link

shapely.MultiPolygon does not support overlapping geometry #32

Open hohlraum opened 9 years ago

hohlraum commented 9 years ago

This is an issue since MultiPolygon is used to represent Elements as shapely objects.

>>>d1 = shapes.Disk((10,0), 15)
>>>d2 = shapes.Disk((-10,0), 15)
>>>d1.shape.is_valid
True
>>>e = core.Elements([d1,d2])
>>>e.shape.is_valid
False

Further boolean operations on e will fail.

tom-varga commented 9 years ago

Could shapely's cascaded_union operator be used to merge overlapping polygons in a MultiPolygon? I think a polygon merge capability should be added to the list of boolean operators in any case.