Home Forums Nazca Edge functions for a parallelogram?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #6248
    lumico
    Participant

    Hi,

    Is there any way to provide functions describing the edges of a parallelogram? I want to use a parallelogram so that I can set the location (in y dimension) of the input and output, but I also need to be able to taper one of the vertical edges. Thanks for any help!

    #6250
    Ronald
    Keymaster

    Dear lumico,

    A paralellogram function as you describe can be defined along these lines:

    def paralellogram(x=10, y=20, dy=None, y2=None):
        if y2 is None:
            y2 = y
        if dy is None:
            dy = 0.5 * (y - y2)
        return [(0, 0), (x, dy), (x, y2+dy), (0, y)]
        
    nd.Polygon(points=paralellogram(y2=2), layer=1).put()
    nd.Polygon(points=paralellogram(dy=1, y2=5), layer=1).put(15)
    
    nd.export_png()

    Ronald

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.