-
Notifications
You must be signed in to change notification settings - Fork 17
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
Error for GDML export in FreeCAD 1.0 (RC 1.0 and 2.0) #147
Comments
Not much i can do as i am away till 15th. May i ask how you created the Tessellation, Munther add a facility to perform Automatic Tessellation for various Part options like Loft etc and that has now been extended for general Part objects, for example as created on import of a step file, so there maybe a work around by using a different method of creating the Tessellation. |
Looking further at the error messages please could you post a screen shot of the FC structure?. There should be a App::Part WorldVol and a number of items underneath |
Is it possible to email me the file, or at least the part that is causing the failure? I have fixed several issues recently, but I will have to wait for Keith to get back from vacation to merge the fixes. |
Thank you all for your quick responses! @KeithSloan yes, I made sure the file followed the right "structure" for the world volume. This was a .step geometry that I used the object-to-tesselate function on. I've attached a screenshot of it, as well as the FreeCAD file, to this comment. Interestingly, I was able to export this file to GDML a few days ago with no problem (as commented in the other post) but couldn't do so the day after! I don't know why that would be, because as far as I know, there hadn't been any changes to the GDML workbench or my FreeCAD installation. I've attached that GDML file to this comment as well. @mhindi2 yes, the FreeCAD file is attached to this comment. Attached is also the GDML I was able to successfully export a few days ago. No changes have been made to the FreeCAD file since then. Thank you all again for your help! |
The last update to the Main branch was 27th Sept. If you know how to access git on windows you could try going back to the 23rd with git checkout -b testbranch 228e857 Needs to be performed in the directory where FC has installed the GDML workbench |
@KeithSloan Just gave it a try, changing the branch didn't seem to solve the issue. For reference, the GDML export worked on 10/5, but attempting to export the same file (with no changes) on 10/6 caused the export issues listed above. Take your time and enjoy the vacation! I'm not in a rush because I'm using the STL-to-GDML python tool which is serving me just fine for the time being. Perhaps Dr. Hindi might be able to give it a try in the meantime as well. |
@a-sunkari I responded by email a short time ago, but it seems the response did not make it to this page. So I will paste what I wrote: Thanks for giving me a copy of the file. I am responding to this via email; not sure what will show up on the github page. On my system (FreeCAD 0.21.1) and with my current version of the workbench I don't get the error you reported when I export the file to gdml. See attached screenshot. I can send you the version of the exportGDML.py file that I cam currently using, but this is probably out of step of what's on the github and still has some bugs that I already fixed in a new branch, but I am not ready yet to release the new branch. A question for you, though. All the tessellated shapes (converted from step) seem to be tubes. Is there any reason why you don't build them as tubes instead of importing them as step files. Simulations would run much faster with tubes than with tessellations. |
Thanks for the review! So I went back to 0.21.2 and it seems to export fine, although there are some changes to be made to the repo. One, as mentioned in the other thread is to change the edgelistArea function to match the Python 3.8 interpreter in FreeCAD 0.21. The other error I got:
was also a Python version mismatch; I solved it with adding
and changing the alreadyExported function to
to get around the inability to use the As one last sanity check, I installed 1.0 on my Rocky Linux virtual machine and tried exporting from there, but I ended up getting the same export error. I think that the reason for the export error I have been having in FreeCAD 1.0 is due to the fact that it uses Python 3.11 in the interpreter rather than 3.8; perhaps that causes the problem? I will investigate and update if I find anything. @mhindi2 thanks for the feedback about using tubes versus tessellated shapes! I plan on using more complex geometry in the future, but I just wanted to test a basic geometry to make sure the .step -> tessellation -> GDML conversion works well. |
Thanks for working on this! As far as I know, the type annotation is
something that the python interpreter itself should ignore. But it seems in
Windows the python interpreter complains about types it does not
understand. You could easily just remove the types altogether.
Keith has been looking into issues with FC 1.0; I have not tested that
version myself yet. When Keith returns we will address those issues. Thanks
for sticking with us and don't hesitate to bring up any issues you might
find!
…On Mon, Oct 7, 2024, 12:36 PM a-sunkari ***@***.***> wrote:
Thanks for the review!
So I went back to 0.21.2 and it seems to export fine, although there are
some changes to be made to the repo. One, as mentioned in the other thread
<#146> is to change the
edgelistArea function to match the Python 3.8 interpreter in FreeCAD 0.21.
The other error I got:
"C:\Users\appin\AppData\Roaming\FreeCAD\Mod\GDML\.\freecad\gdml\exportGDML.py",
line 6244, in AutoTessellateExporter def alreadyExported(shape) -> str |
None: <class 'TypeError'>: unsupported operand type(s) for |: 'type' and
'NoneType'
was also a Python version mismatch; I solved it with adding
from typing import Union
and changing the alreadyExported function to
def alreadyExported(shape) -> Union[str, None]:
to get around the inability to use the | syntax in that version of
Python. I will add this to the other thread as well.
I *think* that the reason for the export error I have been having in
FreeCAD 1.0 is due to the fact that it uses *Python 3.11* in the
interpreter rather than 3.8; perhaps that causes the problem? I will
investigate and update if I find anything.
@mhindi2 <https://github.com/mhindi2> thanks for the feedback about using
tubes versus tessellated shapes! I plan on using more complex geometry in
the future, but I just wanted to test a basic geometry to make sure the
.step -> tessellation -> GDML conversion works well.
—
Reply to this email directly, view it on GitHub
<#147 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWV3NCB6KRXKMNHLGBSOWZTZ2LPDDAVCNFSM6AAAAABPOQXA5OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJXG4ZTEMRTGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Please could you email me a copy of the file, so I can check with the version of exportGDML that I and the Repro have. Thanks |
Hello, Just a quick note to say that I am seeing this exact error in FreeCAD 1.0.0. I also could export the day before, but cannot now. The export also fails on the simplest design I could make, a single box GDMLBox inside the worldVOL. |
I just re-downloaded the problem file in this thread and tried with FC1.0.0 on my system and exported okay. Please could you post your FreeCAD info. I also attach a zip of the files concerned My FreeCAD info is OS: macOS 14.4
|
Have had one user on Windows that reported that, they had to save and restart their system to fix an export problem, that suggests to me that there is a memory bug somewhere. Given that you could export the day before maybe you are seeing a similar problem. |
Okay I just updated the package.xml file in the repro to say 2.0.1 Beta You should see the latest version is 2.0.1 Beta. Try uninstall | restart FC | install Ignore install of python gmsh ( There is an issue with FC 1.0.0 and the gmsh python lib ) All non Gmsh facilities should be fine. If you then FreeCAD | About
If you see GDML 2.0.1 Beta (For some reason the addon manager does not pick up on the change)
|
For how to successfully install the gmsh python library see https://github.com/KeithSloan/GDML/issues/154 |
@a-sunkari May I ask why you rotated the WorldVol 90 degrees? This make things very difficult to create valid GDML for its contents. |
@KeithSloan I'm pretty sure I did that to rotate all my geometry because they were imported in the wrong direction. I'm pretty sure I got the error even when I rotated just the individual geometries as well, or even if I didn't rotate anything at all. I'm currently on vacation so I can't see the file right now but I'll be able to check early next week. |
Thanks - If you can provide the original file un-rotated some time, we can look the issue. |
Here's a test file I've been working on that doesn't export for me in 1.0 - but works fine on previous versions, with the small changes to the code I've made. The world volume is not rotated in this file. Let me know if any more info is needed! File provided as link because GitHub doesn't support the uploading of FreeCAD files. |
When I try access the file I get a message that says it has been deleted. Could you please repost, or else email me directly. Thanks. |
OS: Windows 11
FreeCAD Version: 1.0 (In both RC 1.0 and 2.0)
I recently started using the GDML workbench in FreeCAD 1.0 due to an issue in version 0.21 where the tesselate function did not work properly.
The GDML workbench worked fine until today, where I am having the following error after I attempt to export the worldVOL to GDML:
It looks like Part object is not found in childObjects. Considering that the error comes after it's checking the assembly dictionary for the world volume, I think the error has something to do with that?
To double check, I opened a FreeCAD document I was able to successfully export yesterday and tried exporting it today, and I got the same error. I also attempted using both RC 1.0 and 2.0, but the same issue presented itself in both versions.
Let me know if more information is needed, or if there is anything I can do to change the code to get the export function working!
The text was updated successfully, but these errors were encountered: