I think you mean an open polyline. Im sorry for the silyy question.
My confusion arose by the fact that I didn't know how these planar objects are represented in 2D formats like dxf. I was thinking that a path segment with a finite width had to be r…
Hi Mathias,
I have tried anyway your solution and I have discovered that it works. But I do not understand why because, after flattening, there is only one cell left which is named "TOP". Here annexed the updated script.
I forgot to say that with this test case the scale factor, also available in the FC Preferences for Importing dxf files, should be set to 0.001 while the FC length unit should be set to mm (the default).
Unfortunately the micron unit (used in the …
Hi Matthias, the problem shouldn't be related to the cell hierarchy because all the top cells are fully flatten before the merging. I omitted the flattening part for shortness but here I am annexing the full script with the two input files of a te…
Hi Matthias. Thanks for the hint.
But I am wondering if a 0 thickness path segment is exported in the dxf file as a true line segment or as a degenerate rectangle. I mean a rectangle with two coincident edges and two degenerate edges. If the latte…
Hi,
I have tried the following script to merge all shapes in a layer/cell :
import klayout.db as db layout = db.Layout() fname="..." layout.read(fname) for ci in layout.each_top_cell(): c=layout.cell(ci) for li…
The script is updated and successfully tested on a simple case. Updated script and more details at:
https://github.com/realthunder/FreeCAD/issues/422 .
(Image)
Sorry, I have wrongly written lyp file. I should have written instead lyt file (that one including Z stack info).
For the moment I am assuming that the user of my script has to extract the z information from the lyt file (maintaining the same form…
Thanks Matthias. Now it is clear.
I do not need to use a graphical view with the associated Application. The database is sufficient for my script. It was strange also for me that I had to use a layoutView to iterate over the layers data.
But this is…
Thanks for the explanation Mathhias. I will use this snippet of code to improve my python script for generating a step file.
You may look at the post https://github.com/realthunder/FreeCAD/issues/419
to see the current status of this script. As you…
The closest thing I could find is QMainWindow in klayout.QtWidgets. But the command:
(Quote)
gives the error: "AttributeError: type object 'QMainWindow' has no attribute 'instance'"
I have just reinstalled the package "klayout_0.27.9-1_amd64.deb" to compare it with my local build.
I have seen that this package doesn't include any pya module but it still defines the klayout module.
After this installation I could writ…
Hi all,
I am trying to use klayout python module.
First thing I would like to load a dxf file and visualize it from a python script.
I have tried with the following code (inspired by this thread):
(Quote)
Unfortunately it breaks at the second line…
Hi dick_freebird, many thanks for your hints.
I missed the specification of the lyp file in the Technology Manager.
The layer colors are now associated with my custom technology and are properly displayed after opening the project file.