opened
johnlb
username_0
I guess the windows compiler doesn't know about cmath defines by default...
fixed clipper.hpp for windows compile
issue
created
johnlb
username_0
1. Added ability to "translate" existing objects. This makes building more complex geometries a bit easier (ie. a function might build a basic set of geometries at the origin, which can then be translated to the desired location within the larger scope)

2. Added a "copy" function to duplicate & translate any translatable object

3. Added several tests for these functions in "tutorial.py"

NOTE: There seems to be a bug in the viewer for Labels only. When a label is copied, the original doesn't seem to show up in the viewer. It does, however, show up correctly in the GDS output & the data structure seems to be correct.

I haven't gotten a chance to dig into the viewer yet; do you have any thoughts on what this might be?
comment
created
heitzmann
username_1
A few comments:
- Why make all translations in polar coordinates (direction, distance) instead of rectangular (dx, dy)? The second form seems more straightforward and would make more sense in a doble loop (`for dx in ...`, `for dy in ...`), in my opinion.
- This operation:
`self.points += distance * numpy.array([dx, dy]*n).reshape(n,2)`
can be simply written as
`self.points += numpy.array([distance * dx, distance * dy])`
which runs faster.
- I'm not sure why we have:
```
if direction == None:
    direction = self.direction
else:
    self.direction = direction
```
Only paths have significant directions, bu not other polygons/polygon sets.
- Please fix `IMPROT_TRANS` to `IMPORT_TRANS` in tutorial.py
comment
created
johnlb
username_0
- re: polar coords
Probably one part "stick with the established style," one part generality (can do polar or x-y, though x-y requires two operations instead of one). You're right, though. In practice, you'll use x-y more, so it should be easier to use.
Fixed.

- re: += 
Didn't know numpy automagically did singleton expansion. Guess I should have suspected.
Fixed.

- re: self.direction
Apologies. Copy-paste error (trying to keep coding style same).
Fixed.

- re: IMPROT
Fixed.
comment
created
heitzmann
username_1
Many thanks, @username_0!
comment
created
amccaugh
username_2
@username_1 Any chance you could push the latest version to PyPi ( https://pypi.python.org/pypi/gdspy ) so gdspy can be installed using pip?  Currently when installed from pip, the gdspy example code tutorial.py fails because the translate() is not defined (but is used in the example code).  Also just wanted to say great work on the library!
comment
created
heitzmann
username_1
@username_2 Done!
comment