Have an Openscad to Freecad conundrum to solve [solved]
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
-
- Veteran
- Posts: 2764
- Joined: Mon Feb 27, 2012 5:31 pm
Re: Have an Openscad to Freecad conundrum to solve
Just when you thought things could not get worse. I think there maybe issues with the use of dxf files.
If I load insert.dxf into FreeCAD I get If I load it into LibreCAD I get Wondering if all the dotted lines are construction lines, but suspect FreeCAD would just import them and treat as normal lines.
Await other dxf and scad file and the hole gets deeper.
If I load insert.dxf into FreeCAD I get If I load it into LibreCAD I get Wondering if all the dotted lines are construction lines, but suspect FreeCAD would just import them and treat as normal lines.
Await other dxf and scad file and the hole gets deeper.
-
- Veteran
- Posts: 2764
- Joined: Mon Feb 27, 2012 5:31 pm
Re: Have an Openscad to Freecad conundrum to solve
This is what OpenSCAD makes of the DXF file with straight import and linear extrude, wait to see what the OP is trying to do when the missing scad and dxf file are supplied. Maybe he is specifying a layer which would probably help.
Re: Have an Openscad to Freecad conundrum to solve
Thank you all for your responses.
I installed freecad 0.19 at first but trying to install the dependencies of the openscad workbench became a tragedy. A failure. Fought hard to solve the issues that were indicated in the window below each failed attempt. I'm not sure if the openscad workbench wasn't working because the dependencies are not there or because there was something else at play. The case is that when I installed 0.184 the openscad workbench was at least doing some of the work and I was able to process a few simpler parts.
I had a day out in the field today and it is just now that I get to read your responses. I use FC 0.184 in Windows 10 64 bit. I can install freecad 0.19 but I can see myself cornered in the same pit.
The files are attached below.
https://drive.google.com/file/d/1gNlnov ... sp=sharing
https://drive.google.com/file/d/1D-OQ3Q ... sp=sharing
I installed freecad 0.19 at first but trying to install the dependencies of the openscad workbench became a tragedy. A failure. Fought hard to solve the issues that were indicated in the window below each failed attempt. I'm not sure if the openscad workbench wasn't working because the dependencies are not there or because there was something else at play. The case is that when I installed 0.184 the openscad workbench was at least doing some of the work and I was able to process a few simpler parts.
I had a day out in the field today and it is just now that I get to read your responses. I use FC 0.184 in Windows 10 64 bit. I can install freecad 0.19 but I can see myself cornered in the same pit.
The files are attached below.
https://drive.google.com/file/d/1gNlnov ... sp=sharing
https://drive.google.com/file/d/1D-OQ3Q ... sp=sharing
Re: Have an Openscad to Freecad conundrum to solve
Thank you all for your responses.
I installed freecad 0.19 at first but trying to install the dependencies of the openscad workbench became a tragedy. A failure. Fought hard to solve the issues that were indicated in the window below each failed attempt. I'm not sure if the openscad workbench wasn't working because the dependencies are not there or because there was something else at play. The case is that when I installed 0.184 the openscad workbench was at least doing some of the work and I was able to process a few simpler parts.
I had a day out in the field today and it is just now that I get to read your responses. I use FC 0.184 in Windows 10 64 bit. I can install freecad 0.19 but I can see myself cornered in the same pit.
The files are attached below.
https://drive.google.com/file/d/1gNlnov ... sp=sharing
https://drive.google.com/file/d/1D-OQ3Q ... sp=sharing
I installed freecad 0.19 at first but trying to install the dependencies of the openscad workbench became a tragedy. A failure. Fought hard to solve the issues that were indicated in the window below each failed attempt. I'm not sure if the openscad workbench wasn't working because the dependencies are not there or because there was something else at play. The case is that when I installed 0.184 the openscad workbench was at least doing some of the work and I was able to process a few simpler parts.
I had a day out in the field today and it is just now that I get to read your responses. I use FC 0.184 in Windows 10 64 bit. I can install freecad 0.19 but I can see myself cornered in the same pit.
The files are attached below.
https://drive.google.com/file/d/1gNlnov ... sp=sharing
https://drive.google.com/file/d/1D-OQ3Q ... sp=sharing
Re: Have an Openscad to Freecad conundrum to solve
Thank you. You should know that there is no point in running simple extrudes or things like that in the dxf with openscad if you don't have the code.
I wouldn't have expected you all to try that. The openscad is in my previous post.
Wish to add that the open scad just uses items in 4 of the layers of the dxf. The other layers are for other parts. Openscad ignores the rest of all those things in the dxf that are not explicitly invoked by the code. I believe freecad do something similar with the parts that are working. The geometries in all of those layers may be loaded into freecad under the hood but as far I could see, it seemed to me that that was not an issue because the simpler parts were processed successfully even when all of that geometry was involved in the dxf.
You'll see that this part is not crazy complicated.
I wouldn't have expected you all to try that. The openscad is in my previous post.
Wish to add that the open scad just uses items in 4 of the layers of the dxf. The other layers are for other parts. Openscad ignores the rest of all those things in the dxf that are not explicitly invoked by the code. I believe freecad do something similar with the parts that are working. The geometries in all of those layers may be loaded into freecad under the hood but as far I could see, it seemed to me that that was not an issue because the simpler parts were processed successfully even when all of that geometry was involved in the dxf.
You'll see that this part is not crazy complicated.
-
- Veteran
- Posts: 2764
- Joined: Mon Feb 27, 2012 5:31 pm
!!
Please can you explain openscad dependencies THERE ARE NO !!!! I Repeat NO dependencies for the OpenSCAD Workshop.I installed freecad 0.19 at first but trying to install the dependencies of the openscad workbench became a tragedy.
You have OpenSCAD installed ? You just have set the OpenSCAD preference that tells FreeCAD where to find it. If you export a CSG from OpenSCAD and import that, unless you have Hull & Minkowski requests. YOU DON'T EVEN need to tell FreeCAD where OpenSCAD is. SO WHAT ARE THESE DEPENDENCIES Are you living in a parallel universe?
-
- Veteran
- Posts: 2764
- Joined: Mon Feb 27, 2012 5:31 pm
Re: Have an Openscad to Freecad conundrum to solve
When I import your scad I file I get the following
You are hitting a bug related to use of colours in the Draft workbench's DXF import routine ...Mod/Draft/importDXF.py
This importer is pretty much depreciated now as it has been replaced
Code: Select all
07:23:08 ImportCSG Version 0.6a
07:23:08 Start Lex
07:23:08 End Lex
07:23:08 Load Parser
07:23:08 WARNING: Token 'DOT' defined, but not used
07:23:08 WARNING: Token 'WORD' defined, but not used
07:23:08 WARNING: There are 2 unused tokens
07:23:08 Parser Loaded
07:23:08 Start Parser
07:23:08 Vector
07:23:08 Vector
07:23:08 Vector
07:23:08 Vector
07:23:08 Matrix
07:23:08 ('angle', '-100.744')
07:23:08 ('convexity', '6')
07:23:08 ('$fn', '0')
07:23:08 ('$fa', '12')
07:23:08 ('$fs', '2')
07:23:08 ('file', 'Insert.dxf')
07:23:08 ('layer', 'Insert Walls')
07:23:08 2d Point
07:23:08 ('origin', [0.0, 0.0])
07:23:08 ('scale', '1')
07:23:08 ('convexity', '6')
07:23:08 ('$fn', '0')
07:23:08 ('$fa', '12')
07:23:08 ('$fs', '2')
07:23:08 ('timestamp', '1620713944')
07:23:08 Import File
07:23:08 Importing : Insert.dxf Layer : Insert Walls
07:23:08 Process DXF file
07:23:08 File Name : Insert
07:23:08 Layer : Insert Walls
07:23:08 PathName : /Users/keithsloan/Downloads
07:23:08 DXF Full path : /Users/keithsloan/Downloads/Insert.dxf
07:23:08 Loading Mesh module... done
07:23:08 opening /Users/keithsloan/Downloads/Insert.dxf...
07:23:08 Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Applications/FreeCAD 0.19.1.app/Contents/Resources/Mod/OpenSCAD/importCSG.py", line 119, in open
processcsg(tmpfile)
File "/Applications/FreeCAD 0.19.1.app/Contents/Resources/Mod/OpenSCAD/importCSG.py", line 177, in processcsg
result = parser.parse(f.read())
File "/Applications/FreeCAD 0.19.1.app/Contents/Resources/lib/python3.8/site-packages/ply/yacc.py", line 333, in parse
return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
File "/Applications/FreeCAD 0.19.1.app/Contents/Resources/lib/python3.8/site-packages/ply/yacc.py", line 1120, in parseopt_notrack
p.callable(pslice)
File "/Applications/FreeCAD 0.19.1.app/Contents/Resources/Mod/OpenSCAD/importCSG.py", line 752, in p_import_file1
p[0] = [process_import_file(filen,ext,p[3]['layer'])]
File "/Applications/FreeCAD 0.19.1.app/Contents/Resources/Mod/OpenSCAD/importCSG.py", line 770, in process_import_file
obj=processDXF(fname,layer)
File "/Applications/FreeCAD 0.19.1.app/Contents/Resources/Mod/OpenSCAD/importCSG.py", line 834, in processDXF
face = importDXFface(filename,layer,doc)
File "/Users/keithsloan/Library/Preferences/FreeCAD/Mod/OpenSCAD_Alt_Import/OpenSCAD2Dgeom.py", line 485, in importDXFface
layers = importDXF.processdxf(doc,filename,False,False) or importDXF.layers
File "/Applications/FreeCAD 0.19.1.app/Contents/Resources/Mod/Draft/importDXF.py", line 2212, in processdxf
color = tuple(dxfColorMap.color_map[layer.color])
<class 'KeyError'>: -96
This importer is pretty much depreciated now as it has been replaced
Last edited by keithsloan52 on Tue May 11, 2021 8:04 am, edited 2 times in total.
-
- Veteran
- Posts: 2764
- Joined: Mon Feb 27, 2012 5:31 pm
Re: Have an Openscad to Freecad conundrum to solve
What software are you using to create the DXF file?
For the 'Insert Walls Cutter' layer the importer is accessing the layer.color and getting the value -96, which is causing the issue with Draft importDXF routine.
What colour is this layer set to in the DXF file?
For the 'Insert Walls Cutter' layer the importer is accessing the layer.color and getting the value -96, which is causing the issue with Draft importDXF routine.
What colour is this layer set to in the DXF file?
-
- Veteran
- Posts: 2764
- Joined: Mon Feb 27, 2012 5:31 pm
Re: Have an Openscad to Freecad conundrum to solve
I REPEAT - THERE ARE NO DEPENDENCIES to install and your post does not show any window.I installed freecad 0.19 at first but trying to install the dependencies of the openscad workbench became a tragedy. A failure. Fought hard to solve the issues that were indicated in the window below each failed attempt.
-
- Veteran
- Posts: 2764
- Joined: Mon Feb 27, 2012 5:31 pm
Re: Have an Openscad to Freecad conundrum to solve
I loaded you files into OpenSCAD and exported as a CSG which I attach here
You will hit the bug that the Draft Workbench importDXF code that gets used and finds for the Walls layer a colour value of -96
which it does not know how to handle
If you try and import this file you Don't even need to tell the Workbench where to find the OpenSCAD executable.You will hit the bug that the Draft Workbench importDXF code that gets used and finds for the Walls layer a colour value of -96
which it does not know how to handle