Page 1 of 13

Problem OpenSCAD scad & csg files - PLEASE Add them to this thread - Thanks

Posted: Mon Aug 30, 2021 7:33 pm
by keithsloan52
Chris Hennes @chennes is building up a number of test cases for the OpenSCAD workbench.
We also need a central point where people can post problem files.

So if you have any problem scad or csg files that correctly load in OpenSCAD but fail to import correctly, please post and add the files to this thread, Thanks

P.S. If an admin would pin this post that would also be great.

Re: Problem OpenSCAD scad & csg files - PLEASE Add them to this thread - Thanks

Posted: Mon Aug 30, 2021 9:23 pm
by GeneFC
Pinned, but should be reviewed and pin removed when no longer needed.

Re: Problem OpenSCAD scad & csg files - PLEASE Add them to this thread - Thanks

Posted: Mon Sep 06, 2021 3:29 am
by astrojhgu
https://forum.freecadweb.org/viewtopic.php?f=3&t=61831

I have met a potential bug. It seems that linear_extrude is not working correctly in FreeCAD.

A desired model is correctly created but not correctly rendered. A subtracted part is set to be visible.

Re: Problem OpenSCAD scad & csg files - PLEASE Add them to this thread - Thanks

Posted: Mon Sep 06, 2021 6:58 am
by keithsloan52
astrojhgu wrote: Mon Sep 06, 2021 3:29 am https://forum.freecadweb.org/viewtopic.php?f=3&t=61831

I have met a potential bug. It seems that linear_extrude is not working correctly in FreeCAD.

A desired model is correctly created but not correctly rendered. A subtracted part is set to be visible.
As per the linked thread, it is fixed in FreeCAD 0.20 or if using the alternate importer https://github.com/KeithSloan/OpenSCAD_Alt_Import

Or are you still having problems?

Re: Problem OpenSCAD scad & csg files - PLEASE Add them to this thread - Thanks

Posted: Mon Sep 06, 2021 7:08 am
by astrojhgu
Thanks.
I have not yet tested the new version for my nixos repository has not been upgraded.
keithsloan52 wrote: Mon Sep 06, 2021 6:58 am
astrojhgu wrote: Mon Sep 06, 2021 3:29 am https://forum.freecadweb.org/viewtopic.php?f=3&t=61831

I have met a potential bug. It seems that linear_extrude is not working correctly in FreeCAD.

A desired model is correctly created but not correctly rendered. A subtracted part is set to be visible.
As per the linked thread, it is fixed in FreeCAD 0.20 or if using the alternate importer https://github.com/KeithSloan/OpenSCAD_Alt_Import

Or are you still having problems?

Re: Problem OpenSCAD scad & csg files - PLEASE Add them to this thread - Thanks

Posted: Tue Sep 14, 2021 1:23 pm
by kwahoo
Hi,

It seems that an object rotation is not preserved if the object is exported as a polyhedron.
Take look at this example, Body is rotated by 90 deg around X axis:
Image

This happens for placement applied on the shape directly (eg. by Python scripting). Translation is preserved. Edit: tested with another file and translation seems to be applied twice (first time in multmatrix and then directly in polyhedron points coordinates)?

Code: Select all

OS: Ubuntu Impish Indri (development branch) (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.20.
Build type: Release
Branch: unknown
Hash: 12d0974525afe812e81ad623f7d915cb1784118e
Python version: 3.9.6
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.2
Locale: Polish/Poland (pl_PL)
platetest.FCStd
(9.49 KiB) Downloaded 107 times
platetest-Kostka.scad
(8.34 KiB) Downloaded 101 times

Re: Problem OpenSCAD scad & csg files - PLEASE Add them to this thread - Thanks

Posted: Sun Sep 19, 2021 9:15 pm
by keithsloan52
kwahoo wrote: Tue Sep 14, 2021 1:23 pm Hi,

It seems that an object rotation is not preserved if the object is exported as a polyhedron.
Take look at this example, Body is rotated by 90 deg around X axis:
Image
Sorry I am confused.

If I load the scad file into OpenSCAD the long side is on the X axis, same if I import into FreeCAD, what am I missing?
OS: macOS 10.15
Word size of FreeCAD: 64-bit
Version: 0.20.25566 (Git)
Build type: Release
Branch: master
Hash: 8c361dd3fc83840a911da950a845eb9f9342a0b6
Python version: 3.9.6
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.2
Locale: C/Default (C)

Re: Problem OpenSCAD scad & csg files - PLEASE Add them to this thread - Thanks

Posted: Tue Sep 21, 2021 6:59 pm
by kwahoo
keithsloan52 wrote: Sun Sep 19, 2021 9:15 pm
Sorry I am confused.
If I load the scad file into OpenSCAD the long side is on the X axis, same if I import into FreeCAD, what am I missing?
It is rotated around X on my screenshot. It "lays flat" on the XZ plane in FreeCAD and XY plane in OpenSCAD.

Re: Problem OpenSCAD scad & csg files - PLEASE Add them to this thread - Thanks

Posted: Tue Sep 21, 2021 7:54 pm
by keithsloan52
kwahoo wrote: Tue Sep 21, 2021 6:59 pm
keithsloan52 wrote: Sun Sep 19, 2021 9:15 pm
Sorry I am confused.
If I load the scad file into OpenSCAD the long side is on the X axis, same if I import into FreeCAD, what am I missing?
It is rotated around X on my screenshot. It "lays flat" on the XZ plane in FreeCAD and XY plane in OpenSCAD.
Still not getting it.

For me in OpenSCAD the largest surface is in the X-Y plane and has a negative thickness in the Z direction
D51A11DA-45A1-40AD-8E55-750982C397DA.jpeg
D51A11DA-45A1-40AD-8E55-750982C397DA.jpeg (35.9 KiB) Viewed 20246 times
OpenSCAD is version 2021.01

This is what it looks like in FreeCAD with a default cube added.
i.e. Again largest surface in the X-Y plane and negative in the Z direction
B033B612-6868-4400-BFB8-A1B2EC232586.jpeg
B033B612-6868-4400-BFB8-A1B2EC232586.jpeg (33.86 KiB) Viewed 20246 times

Re: Problem OpenSCAD scad & csg files - PLEASE Add them to this thread - Thanks

Posted: Tue Sep 21, 2021 9:04 pm
by kwahoo
keithsloan52 wrote: Tue Sep 21, 2021 7:54 pm
i.e. Again largest surface in the X-Y plane and negative in the Z direction
Ok, It is indeed in the X-Y local plane of Body, but also in the X-Z global plane according the gizmo in the corner. (planes differ, because the Body is rotated)
This is screenshot with the default cube moved by 50 mm in the Z direction:

Image

So, does the exporter use local (inside the Body) coordinates only? Preserving global coordinates would be very useful for assemblies.