Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with batch mode of XSection after update 1.4 -> 1.7 #29

Closed
qpavsmi opened this issue Nov 2, 2023 · 1 comment
Closed

Issues with batch mode of XSection after update 1.4 -> 1.7 #29

qpavsmi opened this issue Nov 2, 2023 · 1 comment

Comments

@qpavsmi
Copy link

qpavsmi commented Nov 2, 2023

I recently updated XSection from 1.4 to 1.7, and noticed that my scripts relying on calling xsection using batch mode stopped working :(

Boiling the issue down, basically I have this command I execute in terminal:

klayout_app.exe <PATH_TO_INPUT_GEOMETRY> -nc -rx -r <PATH_TO_KLAYOUT>\\salt/xsection/macros/xsection.lym -rd xs_run=<PATH_TO_PROCESS_FILE> -rd xs_cut=0.0,150.0;0.0,-150.0 -rd xs_out=<PATH_TO_OUTPUT>

This used to work before XSection update but now it halts with following error:

RuntimeError: Unexpected object type (expected argument of class DPoint, got Array) for argument #1 ('dpoint') in Point::from_dpoint
in C:\\Users\\PavelSmirnov\\KLayout\\salt/xsection/macros/xsection.lym:33
  C:/Users/PavelSmirnov/KLayout/salt/xsection/ruby/xsection_script.rb:263:in `rescue in run_script'
  C:/Users/PavelSmirnov/KLayout/salt/xsection/ruby/xsection_script.rb:180:in `run_script'
  C:\\Users\\PavelSmirnov\\KLayout\\salt/xsection/macros/xsection.lym:33:in `<module:XS>'
  C:\\Users\\PavelSmirnov\\KLayout\\salt/xsection/macros/xsection.lym:15:in `<main>'

I'm not sure if this is a bug or there was a syntax change with how xs_cut should be stated. Reading up on changelog it seems that a feature was introduced to specify more than one two-point cut.

This is not blocking for me since I can get XSection working by editing editing the line 200 from KLayout/salt/xsetion/ruby/xsection.rb:

        if p1 && p2
        
          # take the given line
          pts << [[[ p1, p2 ]]]
          
        else

to

        if p1 && p2
        
          # take the given line
          pts << [[ p1, p2 ]]
          
        else
klayoutmatthias pushed a commit that referenced this issue Apr 29, 2024
@qpavsmi
Copy link
Author

qpavsmi commented Apr 30, 2024

With the release of XSection 1.8 the batch command outlined above now works. Closing the issue.

@qpavsmi qpavsmi closed this as completed Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant