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

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
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!
keithsloan52
Posts: 2089
Joined: Mon Feb 27, 2012 5:31 pm

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

Post 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.
GeneFC
Posts: 2823
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

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

Post by GeneFC »

Pinned, but should be reviewed and pin removed when no longer needed.
astrojhgu
Posts: 5
Joined: Tue May 19, 2020 8:54 am

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

Post 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.
keithsloan52
Posts: 2089
Joined: Mon Feb 27, 2012 5:31 pm

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

Post 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?
astrojhgu
Posts: 5
Joined: Tue May 19, 2020 8:54 am

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

Post 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?
kwahoo
Posts: 473
Joined: Fri Nov 29, 2013 3:09 pm
Contact:

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

Post 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 31 times
platetest-Kostka.scad
(8.34 KiB) Downloaded 25 times
keithsloan52
Posts: 2089
Joined: Mon Feb 27, 2012 5:31 pm

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

Post 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)
kwahoo
Posts: 473
Joined: Fri Nov 29, 2013 3:09 pm
Contact:

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

Post 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.
keithsloan52
Posts: 2089
Joined: Mon Feb 27, 2012 5:31 pm

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

Post 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 1948 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 1948 times
kwahoo
Posts: 473
Joined: Fri Nov 29, 2013 3:09 pm
Contact:

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

Post 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.
Post Reply