mardi 24 septembre 2019

Creating polygon shapes using Nazca

I am new in python and trying to create patterns and export them to .gds, or .dxf file format. I am using predefined Nazca shapes but I have some problems to create square and rectangle. 1) Square rotated like a diamond and couldn't find how to make it square. (Fig. 1 Supposed to be square, not diamond) 2) Tried to generate rectangle in different aspect ratios by adding squares one after another but couldn't find how to generate a rectangle without adding squares. (Fig. 2 Supposed to be rectangle)

import nazca as nd

with nd.Cell('square') as hole:
    square_shape = nd.geometries.circle(radius=25, N=4)
    nd.Polygon(points=square_shape).put(0)

hole.put(array=[200, [100, 0], 200, [0, 100]])
hole.put(array=[200, [100, 0], 134, [0, 150]])

nd.export_gds(filename= 'squtest.gds')

Aucun commentaire:

Enregistrer un commentaire