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

RobustPath : Unsupported types for -: 'tuple' and 'tuple' #219

Open
tristanmelton opened this issue Oct 15, 2022 · 1 comment
Open

RobustPath : Unsupported types for -: 'tuple' and 'tuple' #219

tristanmelton opened this issue Oct 15, 2022 · 1 comment

Comments

@tristanmelton
Copy link

Hey,

I am trying to define a ring with modulation on the width. I'm using a RobustPath with a parametric to define the ring geometry and width functions (see below). when I try and get the bounding box for the path, I get the error that "Unsupported types for -: 'tuple' and 'tuple'. Is there some problem with my code? Seems like a potential bug with RobustPath.

           rb = gdspy.RobustPath([(ring_width + ring_radius + dev_dx, -(wg_width/2 + gap + ring_width/2 + ring_radius) + dev_dy)], width=ring_width, tolerance=path_tol, layer=layer_WGS, max_points=maximum_points)
            #rb.turn(ring_radius, math.radians(360), ring_width)
            #rb.turn(ring_radius, math.radians(0), math.radians(36), ring_width)
            #rb.arc(ring_radius, math.radians(0), math.radians(360))
            rb.parametric(curve_function=lambda u: (-ring_radius + ring_radius*math.cos(2*math.pi*u), ring_radius*math.sin(2*math.pi*u)), width=[lambda u: numpy.cos(2*numpy.pi*u)])
            #ring = gdspy.Round((ring_width + ring_radius + dev_dx, -(wg_width/2 + gap + ring_width/2 + ring_radius) + dev_dy), ring_radius+ring_width/2,ring_radius - ring_width/2, tolerance=path_tol, layer=layer_WGS)
           self.cell.add(rb)


            ## SSC ##
           self.cell.add(gdspy.CellReference(cell_ssc,(0, dev_dy), rotation=180))
           self.cell.add(gdspy.CellReference(cell_ssc,(chip_width_dev, dev_dy + dy)))

          
            # Create offsets for group                       
           dev_dx = dev_dx + ring_width + 2*ring_radius + ring_width + wg_width + 2*wg_sep
           dev_dy = dev_dy + wg_sep

           if ii == 0:
                dy_prime = dy

           self.top = dev_dy - wg_sep
           self.bottom = -dy_prime
           bbox = self.cell.get_bounding_box()
@heitzmann
Copy link
Owner

Please take a look at the documentation: your parametric function must return numpy arrays.

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

2 participants