View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003419 | FreeCAD | Bug | public | 2018-04-01 19:08 | 2018-06-10 17:34 |
Reporter | boelle | Assigned To | wandererfan | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Fixed in Version | 0.18 | ||||
Summary | 0003419: import of openscad file fails | ||||
Description | freecad info: OS: Windows 10 Word size of OS: 64-bit Word size of FreeCAD: 64-bit Version: 0.16.6712 (Git) Build type: Release Branch: releases/FreeCAD-0-16 Hash: da2d364457257a7a8c6fb2137cea12c45becd71a Python version: 2.7.8 Qt version: 4.8.7 Coin version: 4.0.0a OCC version: 6.8.0.oce-0.17 when i open https://github.com/nophead/Mendel90/blob/master/scad/y-motor-bracket.scad there are several errors and the part does not look anything like when opened in openscad | ||||
Steps To Reproduce | download repro as zip and extract: https://github.com/nophead/Mendel90 open y-motor-bracket.scad in scad folder y idler, Y bar clamp and Z bar clamp have similar outcome | ||||
Tags | DXF, import, OpenSCAD | ||||
FreeCAD Information | |||||
|
Please test with pre-released 0.17 (see the giant yellow banner above) |
|
dont see any big banner but will give it a go with 0.17 anyways |
|
i assume this one: https://github.com/FreeCAD/FreeCAD/releases/download/0.17_pre/FreeCAD_0.17.13488_x64_dev_win.7z just need to find an online thing that can handle 7-zip, but zip would have been better as windows can handle it native |
|
Yes, that is correct. |
|
it helped but some of the holes are not complete round https://imgur.com/a/jIDkI i think its what is called tear drop shape the other side of the hole is a nuttrap and that looks like it should |
|
@boelle please post this ticket to the forum to generate discussion. Make sure to add the forum thread discussion link back in to this ticket. |
|
what section of forum is best suited and what should i write in post to make it an optimal start for discussion? |
|
Open Discussions (https://forum.freecadweb.org/viewforum.php?f=8) |
|
done... will add a picture of how the holes turn out in a bit |
|
oh well now it seems that i posted the wrong place and just made a bigger mess out of it |
|
@Kunda1 as explained in the Bug submission guidelines topic, the "Help on using FreeCAD" forum is where such topics should be posted. https://forum.freecadweb.org/viewtopic.php?f=3&t=5236 |
|
@normandc i have requested that the whole thread is to be deleted instead of moved i on the forums |
|
I don't agree, the topic just needs to be moved. |
|
well i only created the topic as kunda said to do so if he had not said so i would never have created it. |
|
|
|
The thread boelle started in the forum is https://forum.freecadweb.org/viewtopic.php?f=3&t=28119 A simplified test file is test2.csg If loaded into OpenSCAD it produces a teardrop. If imported into FreeCAD is produces an 8 sided polygon. The problem appears to that when FreeCAD importCSG.py encounters a 2D hull request. It exports the objects of the hull request as DXF files before calling OpenSCAD under the covers to perform the hull request. Problem is when it finds a circle request it creates an 8 sided polygon rather than DXF circle or a polygon of say 5o sides. The export is made by the export function in /Mod/Draft/ImportDXF.py` and looks like it maybe a bug in the dxf-library. |
|
@wandererfan care to take a look at this ? |
|
I am stuck trying to debug this problem as I cannot get winpdb to work see https://forum.freecadweb.org/viewtopic.php?f=10&t=28256&start=10 |
|
@Kunda1 - not really my thing, I work on the Dxf export in /Import, not the one in /Draft. That said, there is an Import/Export setting to treat ellipses and splines as polylines that might be involved here. Also has a setting for maximum polyline segment length. I can look at it, but it might take a while for me to get to it. |
|
If you look at test2.csg its a hull between a circle and a square. I altered the code to output the DXF files before they are passed to openscad for the hull operation. The square is not correct its just a single line from one vertex of the square to the opposite vertex see attached file. Like I said before I wanted to use winpdb to debug but cannot get winpdb to work. I don't find the code very readable hence wanting to resort to a debugger square.dxf (753 bytes)
0 SECTION 2 HEADER 9 $ACADVER 1 AC1009 9 $INSBASE 10 0.0 20 0.0 30 0.0 9 $EXTMIN 10 0.0 20 0.0 30 0.0 9 $EXTMAX 10 0.0 20 0.0 30 0.0 0 ENDSEC 0 SECTION 2 TABLES 0 TABLE 2 VPORT 70 0 0 ENDTAB 0 TABLE 2 LTYPE 70 1 0 LTYPE 2 CONTINUOUS 70 0 3 Solid line 72 65 73 0 40 0.0 0 ENDTAB 0 TABLE 2 LAYER 70 1 0 LAYER 2 0 70 64 62 7 6 continuous 0 ENDTAB 0 TABLE 2 STYLE 70 1 0 STYLE 2 STANDARD 70 0 40 0 41 1.0 50 0.0 71 0 42 1 3 ARIAL.TTF 4 0 ENDTAB 0 TABLE 2 VIEW 70 0 0 ENDTAB 0 ENDSEC 0 SECTION 2 BLOCKS 0 ENDSEC 0 SECTION 2 ENTITIES 0 LWPOLYLINE 8 0 62 0 8 0 100 AcDbPolyline 90 4 70 1 10 0.0 20 0.0 10 0.95269 20 2.3 0 ENDSEC 0 EOF |
|
@keithsloan52 - feeling a bit thick here looking at test2.csg. If I trap the 3 temp dxf files (intermediate circle and square, plus final shape), they look reasonable. What should the result of importing test2.csg look like? The whole circle + the top little bit of the square?? |
|
What should test2.csg look like? Load it into OpenSCAD should show you what to expect. I think it should look like a circle with the square bit missing. Not sure why I got a bad DXF file. What version of FreeCAD did you use? And what DXF library. Ideally the circle should convert to a n sided polygon, but when openscad is called it creates and eight sided polygon as a default. I would change the request to openscad so that it produced something like a 20 or 50 sided polygon to get the required result for the guy that raised the problem |
|
"Not sure why I got a bad DXF file. What version of FreeCAD did you use? And what DXF library." Legacy Python importer with: OS: Linux Mint 18.3 Sylvia Word size of OS: 64-bit Word size of FreeCAD: 64-bit Version: 0.18.13920 +1 (Git) Build type: debug Branch: update Hash: ed159ce311099a1efb6d6d082f43a84a99e8f4aa Python version: 2.7.12 Qt version: 4.8.7 Coin version: 4.0.0a OCC version: 7.2.0 Locale: English/Canada (en_CA) |
|
I can get a decent result by gimmicking the OpenSCAD code with "$fn=24" to control the number of sides in the polygon approximation. "Square" doesn't seem to mind the extra parameter, but I don't know about other operations. in OpenSCADUtils.py, def process2D_ObjectsViaOpenSCADShape(ObjList,Operation,doc): - dxfimports = ' '.join("import(file = \"%s\");" % \ + dxfimports = ' '.join("import(file = \"%s\",$fn=24);" % \ |
|
OpenSCAD forum discussion about polygon approximation of DXF circles @Kunda1 - this has nothing to do with FC Dxf code. It is a issue with default values in OpenSCAD. |
|
@boelle - is this what the brackets are supposed to look like: |
|
The thing is in general you do not know if the things you are dealing with is a circle or not, so I would add the $fn24 to both dxf imports. So it should work in a generic case. I think the original problem was that some holes which where created as an tear drop i.e. hull request between a circle an a square. I cannot see any tear drops in your png images. |
|
https://github.com/FreeCAD/FreeCAD/commit/9975c758885ad62d0d6002ddebbc5c3c7fa58abb |
Date Modified | Username | Field | Change |
---|---|---|---|
2018-04-01 19:08 | boelle | New Issue | |
2018-04-02 17:15 | Kunda1 | Status | new => feedback |
2018-04-02 17:15 | Kunda1 | Note Added: 0011104 | |
2018-04-02 17:20 | boelle | Note Added: 0011106 | |
2018-04-02 17:20 | boelle | Status | feedback => new |
2018-04-02 17:23 | boelle | Note Added: 0011107 | |
2018-04-02 17:25 | Kunda1 | Note Added: 0011108 | |
2018-04-02 18:10 | boelle | Note Added: 0011110 | |
2018-04-15 17:22 | Kunda1 | Tag Attached: OpenSCAD | |
2018-04-15 17:22 | Kunda1 | Tag Attached: import | |
2018-04-15 17:27 | Kunda1 | Status | new => feedback |
2018-04-15 17:27 | Kunda1 | Note Added: 0011149 | |
2018-04-15 17:34 | boelle | Note Added: 0011150 | |
2018-04-15 17:34 | boelle | Status | feedback => new |
2018-04-15 17:35 | Kunda1 | Note Added: 0011151 | |
2018-04-15 17:53 | boelle | Note Added: 0011152 | |
2018-04-15 18:40 | boelle | Note Added: 0011153 | |
2018-04-15 18:42 | normandc | Note Added: 0011154 | |
2018-04-15 18:44 | boelle | Note Added: 0011155 | |
2018-04-15 18:47 | normandc | Note Added: 0011156 | |
2018-04-15 18:49 | boelle | Note Added: 0011157 | |
2018-04-15 20:17 | boelle | Note Added: 0011159 | |
2018-04-16 08:51 | keithsloan52 | File Added: test2.csg | |
2018-04-16 08:51 | keithsloan52 | Note Added: 0011162 | |
2018-04-16 08:52 | keithsloan52 | Note Edited: 0011162 | |
2018-04-16 08:58 | keithsloan52 | Note Edited: 0011162 | |
2018-05-31 17:29 | Kunda1 | Note Added: 0011336 | |
2018-05-31 17:30 | Kunda1 | Tag Attached: DXF | |
2018-05-31 20:16 | keithsloan52 | Note Added: 0011339 | |
2018-06-01 13:15 | wandererfan | Note Added: 0011340 | |
2018-06-01 14:38 | keithsloan52 | File Added: square.dxf | |
2018-06-01 14:38 | keithsloan52 | Note Added: 0011341 | |
2018-06-01 14:38 | keithsloan52 | Note Edited: 0011341 | |
2018-06-08 16:21 | wandererfan | File Added: Combined_FC.png | |
2018-06-08 16:21 | wandererfan | File Added: Combined_LC.png | |
2018-06-08 16:21 | wandererfan | Note Added: 0011367 | |
2018-06-08 16:49 | keithsloan52 | Note Added: 0011368 | |
2018-06-08 16:53 | keithsloan52 | Note Edited: 0011368 | |
2018-06-09 13:18 | wandererfan | Note Added: 0011384 | |
2018-06-09 13:26 | wandererfan | File Added: os_fnParmForCircle.png | |
2018-06-09 13:26 | wandererfan | Note Added: 0011385 | |
2018-06-09 13:34 | wandererfan | Note Added: 0011386 | |
2018-06-09 13:35 | wandererfan | Note Edited: 0011386 | |
2018-06-09 13:42 | wandererfan | File Added: y-motor-bracket.png | |
2018-06-09 13:42 | wandererfan | File Added: y-idler-bracket.png | |
2018-06-09 13:42 | wandererfan | Note Added: 0011387 | |
2018-06-09 14:08 | Kunda1 | Status | new => confirmed |
2018-06-09 15:36 | keithsloan52 | Note Added: 0011388 | |
2018-06-10 17:34 | wmayer | Assigned To | => wandererfan |
2018-06-10 17:34 | wmayer | Status | confirmed => closed |
2018-06-10 17:34 | wmayer | Resolution | open => fixed |
2018-06-10 17:34 | wmayer | Fixed in Version | => 0.18 |
2018-06-10 17:34 | wmayer | Note Added: 0011396 |