View Issue Details

IDProjectCategoryView StatusLast Update
0003419FreeCADBugpublic2018-06-10 17:34
ReporterboelleAssigned Towandererfan 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target VersionFixed in Version0.18 
Summary0003419: import of openscad file fails
Descriptionfreecad 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 Reproducedownload 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
TagsDXF, import, OpenSCAD

Activities

Kunda1

2018-04-02 17:15

administrator   ~0011104

Please test with pre-released 0.17 (see the giant yellow banner above)

boelle

2018-04-02 17:20

reporter   ~0011106

dont see any big banner but will give it a go with 0.17 anyways

boelle

2018-04-02 17:23

reporter   ~0011107

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

Kunda1

2018-04-02 17:25

administrator   ~0011108

Yes, that is correct.

boelle

2018-04-02 18:10

reporter   ~0011110

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

Kunda1

2018-04-15 17:27

administrator   ~0011149

@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.

boelle

2018-04-15 17:34

reporter   ~0011150

what section of forum is best suited and what should i write in post to make it an optimal start for discussion?

Kunda1

2018-04-15 17:35

administrator   ~0011151

Open Discussions (https://forum.freecadweb.org/viewforum.php?f=8)

boelle

2018-04-15 17:53

reporter   ~0011152

done... will add a picture of how the holes turn out in a bit

boelle

2018-04-15 18:40

reporter   ~0011153

oh well now it seems that i posted the wrong place and just made a bigger mess out of it

normandc

2018-04-15 18:42

manager   ~0011154

@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

boelle

2018-04-15 18:44

reporter   ~0011155

@normandc i have requested that the whole thread is to be deleted instead of moved

i on the forums

normandc

2018-04-15 18:47

manager   ~0011156

I don't agree, the topic just needs to be moved.

boelle

2018-04-15 18:49

reporter   ~0011157

well i only created the topic as kunda said to do so

if he had not said so i would never have created it.

boelle

2018-04-15 20:17

reporter   ~0011159

Cannot find icon: python
Cannot find icon: python
ECHO: "DiBond:"
ECHO: "base screw length", 16
ECHO: "frame screw length", 16

WARNING: Token 'DOT' defined, but not used
WARNING: Token 'WORD' defined, but not used
WARNING: There are 2 unused tokens
End processing CSG file
processing square007
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286419-000002.dxf
processing square008
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286496-000003.dxf
processing intersection001
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286499-000004.dxf
opening c:\users\boher\appdata\local\temp\fc-00576-286503-000005.dxf...
drawing 5 lines...
skipping texts...
skipping dimensions...
skipping points...
skipping leaders...
skipping hatches...
skipping *blocks...
done processing
successfully imported c:\users\boher\appdata\local\temp\fc-00576-286503-000005.dxf
processing square004
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286637-000006.dxf
processing square005
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286638-000007.dxf
processing intersection
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286639-000008.dxf
opening c:\users\boher\appdata\local\temp\fc-00576-286641-000009.dxf...
drawing 5 lines...
skipping texts...
skipping dimensions...
skipping points...
skipping leaders...
skipping hatches...
skipping *blocks...
done processing
successfully imported c:\users\boher\appdata\local\temp\fc-00576-286641-000009.dxf
processing square010
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286716-000010.dxf
processing square011
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286717-000011.dxf
processing intersection002
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286717-000012.dxf
opening c:\users\boher\appdata\local\temp\fc-00576-286719-000013.dxf...
drawing 5 lines...
skipping texts...
skipping dimensions...
skipping points...
skipping leaders...
skipping hatches...
skipping *blocks...
done processing
successfully imported c:\users\boher\appdata\local\temp\fc-00576-286719-000013.dxf
processing square013
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286797-000014.dxf
processing square014
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286799-000015.dxf
processing intersection003
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286799-000016.dxf
opening c:\users\boher\appdata\local\temp\fc-00576-286800-000017.dxf...
drawing 5 lines...
skipping texts...
skipping dimensions...
skipping points...
skipping leaders...
skipping hatches...
skipping *blocks...
done processing
successfully imported c:\users\boher\appdata\local\temp\fc-00576-286800-000017.dxf
processing square025
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286843-000018.dxf
processing square026
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286844-000019.dxf
processing intersection009
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286846-000020.dxf
opening c:\users\boher\appdata\local\temp\fc-00576-286852-000021.dxf...
drawing 5 lines...
skipping texts...
skipping dimensions...
skipping points...
skipping leaders...
skipping hatches...
skipping *blocks...
done processing
successfully imported c:\users\boher\appdata\local\temp\fc-00576-286852-000021.dxf
processing square022
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286886-000022.dxf
processing square023
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286886-000023.dxf
processing intersection008
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286887-000024.dxf
opening c:\users\boher\appdata\local\temp\fc-00576-286889-000025.dxf...
drawing 5 lines...
skipping texts...
skipping dimensions...
skipping points...
skipping leaders...
skipping hatches...
skipping *blocks...
done processing
successfully imported c:\users\boher\appdata\local\temp\fc-00576-286889-000025.dxf
processing square016
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286921-000026.dxf
processing square017
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286921-000027.dxf
processing intersection006
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286923-000028.dxf
opening c:\users\boher\appdata\local\temp\fc-00576-286923-000029.dxf...
drawing 5 lines...
skipping texts...
skipping dimensions...
skipping points...
skipping leaders...
skipping hatches...
skipping *blocks...
done processing
successfully imported c:\users\boher\appdata\local\temp\fc-00576-286923-000029.dxf
processing square019
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286964-000030.dxf
processing square020
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286966-000031.dxf
processing intersection007
successfully exported c:\users\boher\appdata\local\temp\fc-00576-286967-000032.dxf
opening c:\users\boher\appdata\local\temp\fc-00576-286969-000033.dxf...
drawing 5 lines...
skipping texts...
skipping dimensions...
skipping points...
skipping leaders...
skipping hatches...
skipping *blocks...
done processing
successfully imported c:\users\boher\appdata\local\temp\fc-00576-286969-000033.dxf
processing circle003
successfully exported c:\users\boher\appdata\local\temp\fc-00576-288292-000034.dxf
processing square003
successfully exported c:\users\boher\appdata\local\temp\fc-00576-288294-000035.dxf
opening c:\users\boher\appdata\local\temp\fc-00576-288296-000036.dxf...
drawing 9 lines...
skipping texts...
skipping dimensions...
skipping points...
skipping leaders...
skipping hatches...
skipping *blocks...
done processing
successfully imported c:\users\boher\appdata\local\temp\fc-00576-288296-000036.dxf
processing circle
successfully exported c:\users\boher\appdata\local\temp\fc-00576-288345-000037.dxf
processing square
successfully exported c:\users\boher\appdata\local\temp\fc-00576-288347-000038.dxf
opening c:\users\boher\appdata\local\temp\fc-00576-288347-000039.dxf...
drawing 9 lines...
skipping texts...
skipping dimensions...
skipping points...
skipping leaders...
skipping hatches...
skipping *blocks...
done processing
successfully imported c:\users\boher\appdata\local\temp\fc-00576-288347-000039.dxf
processing circle002
successfully exported c:\users\boher\appdata\local\temp\fc-00576-288406-000040.dxf
processing square002
successfully exported c:\users\boher\appdata\local\temp\fc-00576-288407-000041.dxf
opening c:\users\boher\appdata\local\temp\fc-00576-288409-000042.dxf...
drawing 9 lines...
skipping texts...
skipping dimensions...
skipping points...
skipping leaders...
skipping hatches...
skipping *blocks...
done processing
successfully imported c:\users\boher\appdata\local\temp\fc-00576-288409-000042.dxf
processing circle001
successfully exported c:\users\boher\appdata\local\temp\fc-00576-288485-000043.dxf
processing square001
successfully exported c:\users\boher\appdata\local\temp\fc-00576-288486-000044.dxf
opening c:\users\boher\appdata\local\temp\fc-00576-288487-000045.dxf...
drawing 9 lines...
skipping texts...
skipping dimensions...
skipping points...
skipping leaders...
skipping hatches...
skipping *blocks...
done processing
successfully imported c:\users\boher\appdata\local\temp\fc-00576-288487-000045.dxf
not a freecad file: .SCAD
ECHO: "DiBond:"
ECHO: "base screw length", 16
ECHO: "frame screw length", 16

End processing CSG file
processing circle001
successfully exported c:\users\boher\appdata\local\temp\fc-00576-321201-000047.dxf
processing square001
successfully exported c:\users\boher\appdata\local\temp\fc-00576-321202-000048.dxf
opening c:\users\boher\appdata\local\temp\fc-00576-321205-000049.dxf...
drawing 9 lines...
skipping texts...
skipping dimensions...
skipping points...
skipping leaders...
skipping hatches...
skipping *blocks...
done processing
successfully imported c:\users\boher\appdata\local\temp\fc-00576-321205-000049.dxf
processing circle002
successfully exported c:\users\boher\appdata\local\temp\fc-00576-321260-000050.dxf
processing square002
successfully exported c:\users\boher\appdata\local\temp\fc-00576-321261-000051.dxf
opening c:\users\boher\appdata\local\temp\fc-00576-321261-000052.dxf...
drawing 9 lines...
skipping texts...
skipping dimensions...
skipping points...
skipping leaders...
skipping hatches...
skipping *blocks...
done processing
successfully imported c:\users\boher\appdata\local\temp\fc-00576-321261-000052.dxf
processing circle003
successfully exported c:\users\boher\appdata\local\temp\fc-00576-321300-000053.dxf
processing square003
successfully exported c:\users\boher\appdata\local\temp\fc-00576-321300-000054.dxf
opening c:\users\boher\appdata\local\temp\fc-00576-321302-000055.dxf...
drawing 9 lines...
skipping texts...
skipping dimensions...
skipping points...
skipping leaders...
skipping hatches...
skipping *blocks...
done processing
successfully imported c:\users\boher\appdata\local\temp\fc-00576-321302-000055.dxf
processing circle
successfully exported c:\users\boher\appdata\local\temp\fc-00576-321355-000056.dxf
processing square
successfully exported c:\users\boher\appdata\local\temp\fc-00576-321356-000057.dxf
opening c:\users\boher\appdata\local\temp\fc-00576-321356-000058.dxf...
drawing 9 lines...
skipping texts...
skipping dimensions...
skipping points...
skipping leaders...
skipping hatches...
skipping *blocks...
done processing
successfully imported c:\users\boher\appdata\local\temp\fc-00576-321356-000058.dxf
not a freecad file: .SCAD
not a freecad file: .SCAD
not a freecad file: .SCAD
not a freecad file: .SCAD
ECHO: "DiBond:"
ECHO: "base screw length", 16
ECHO: "frame screw length", 16

End processing CSG file
processing circle003
successfully exported c:\users\boher\appdata\local\temp\fc-00576-331217-000060.dxf
processing square003
successfully exported c:\users\boher\appdata\local\temp\fc-00576-331219-000061.dxf
opening c:\users\boher\appdata\local\temp\fc-00576-331220-000062.dxf...
drawing 9 lines...
skipping texts...
skipping dimensions...
skipping points...
skipping leaders...
skipping hatches...
skipping *blocks...
done processing
successfully imported c:\users\boher\appdata\local\temp\fc-00576-331220-000062.dxf
processing circle001
successfully exported c:\users\boher\appdata\local\temp\fc-00576-331261-000063.dxf
processing square001
successfully exported c:\users\boher\appdata\local\temp\fc-00576-331261-000064.dxf
opening c:\users\boher\appdata\local\temp\fc-00576-331263-000065.dxf...
drawing 9 lines...
skipping texts...
skipping dimensions...
skipping points...
skipping leaders...
skipping hatches...
skipping *blocks...
done processing
successfully imported c:\users\boher\appdata\local\temp\fc-00576-331263-000065.dxf
processing circle002
successfully exported c:\users\boher\appdata\local\temp\fc-00576-331310-000066.dxf
processing square002
successfully exported c:\users\boher\appdata\local\temp\fc-00576-331310-000067.dxf
opening c:\users\boher\appdata\local\temp\fc-00576-331311-000068.dxf...
drawing 9 lines...
skipping texts...
skipping dimensions...
skipping points...
skipping leaders...
skipping hatches...
skipping *blocks...
done processing
successfully imported c:\users\boher\appdata\local\temp\fc-00576-331311-000068.dxf
processing circle
successfully exported c:\users\boher\appdata\local\temp\fc-00576-331345-000069.dxf
processing square
successfully exported c:\users\boher\appdata\local\temp\fc-00576-331346-000070.dxf
opening c:\users\boher\appdata\local\temp\fc-00576-331346-000071.dxf...
drawing 9 lines...
skipping texts...
skipping dimensions...
skipping points...
skipping leaders...
skipping hatches...
skipping *blocks...
done processing
successfully imported c:\users\boher\appdata\local\temp\fc-00576-331346-000071.dxf
not a freecad file: .SCAD

keithsloan52

2018-04-16 08:51

developer   ~0011162

Last edited: 2018-04-16 08:58

View 3 revisions

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.



test2.csg (1,298 bytes)

Kunda1

2018-05-31 17:29

administrator   ~0011336

@wandererfan care to take a look at this ?

keithsloan52

2018-05-31 20:16

developer   ~0011339

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

wandererfan

2018-06-01 13:15

developer   ~0011340

@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.

keithsloan52

2018-06-01 14:38

developer   ~0011341

Last edited: 2018-06-01 14:38

View 2 revisions

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)

wandererfan

2018-06-08 16:21

developer   ~0011367

@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??

Combined_FC.png (7,974 bytes)
Combined_FC.png (7,974 bytes)
Combined_LC.png (7,759 bytes)
Combined_LC.png (7,759 bytes)

keithsloan52

2018-06-08 16:49

developer   ~0011368

Last edited: 2018-06-08 16:53

View 2 revisions

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

wandererfan

2018-06-09 13:18

developer   ~0011384

"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)

wandererfan

2018-06-09 13:26

developer   ~0011385

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);" % \

os_fnParmForCircle.png (93,668 bytes)
os_fnParmForCircle.png (93,668 bytes)

wandererfan

2018-06-09 13:34

developer   ~0011386

Last edited: 2018-06-09 13:35

View 2 revisions

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.

wandererfan

2018-06-09 13:42

developer   ~0011387

@boelle - is this what the brackets are supposed to look like:

y-motor-bracket.png (10,278 bytes)
y-motor-bracket.png (10,278 bytes)
y-idler-bracket.png (10,110 bytes)
y-idler-bracket.png (10,110 bytes)

keithsloan52

2018-06-09 15:36

developer   ~0011388

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.

wmayer

2018-06-10 17:34

administrator   ~0011396

https://github.com/FreeCAD/FreeCAD/commit/9975c758885ad62d0d6002ddebbc5c3c7fa58abb

Issue History

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 View Revisions
2018-04-16 08:58 keithsloan52 Note Edited: 0011162 View Revisions
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 View Revisions
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 View Revisions
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 View Revisions
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