Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

Merging polygons with gdspy boolean vs Klayout merge produces different results #238

Open
GaN-T opened this issue Feb 18, 2024 · 0 comments

Comments

@GaN-T
Copy link

GaN-T commented Feb 18, 2024

Hello,

I am trying to merge polygons in my layout but this still results in fractured polygons. However, when i perform a follow up merge operation in Klayout I get the output I need. How do I achieve this result purely in code?

import gdspy
import numpy as np

lib = gdspy.GdsLibrary()
wafer = lib.new_cell("6InchWafer")
waferFlatLen = 57.5e3   # length of wafer flat in µm
waferRad = 75e3         # wafer radius in µm
flatAngle = np.arccos(waferFlatLen/(2*waferRad))
cenDistToFlat = waferRad*np.sin(flatAngle)
cutFlat = gdspy.Rectangle([-30e3,-20e3],[30e3,20e3], layer = 0).translate(0,-cenDistToFlat - 20e3)
waferBody = gdspy.Round((0,0),waferRad, layer=0)

waferBody = gdspy.boolean(waferBody,cutFlat, 'not')
mergedWaferBody = gdspy.boolean(waferBody,None, 'or')

wafer.add(mergedWaferBody)
lib.write_gds("mergeTest.gds")

MergeOutputPictures.zip

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant