Opening an .scad file its parts are put to the wrong coordinates on screen

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
infocean
Posts: 17
Joined: Tue Nov 13, 2018 4:41 am

Opening an .scad file its parts are put to the wrong coordinates on screen

Post by infocean »

Hi,

I wanted to use TechDraw to create some 2D black and white images, so I opened the the file in FreeCAD. It is an axial flux type of gear and rotor from the gear is placed at the wrong place. I could render the file in OpenSCAD without any warning using F6 and it reported as Simple:Yes.
However TechDraw put everything at the right place. See attached files.

The first few lines in the Report View:
23:44:05 ImportCSG Version 0.6a
23:44:05 Start Lex
23:44:05 End Lex
23:44:05 Load Parser
23:44:05 WARNING: Token 'DOT' defined, but not used
23:44:05 WARNING: Token 'WORD' defined, but not used
23:44:05 WARNING: There are 2 unused tokens
23:44:05 Parser Loaded
23:44:05 Start Parser
23:44:05 Vector

I use the latest supported release of both programs. I use a "trashcan" type MacPro 2013 with 48GB memory with Catalina /MacOS 10.15.7/ on it. Any good hint what is going on with the Import and how to fix the wrong presentation?

Thanks ahead,
Infocean
Attachments
As it is in OpenSCAD
As it is in OpenSCAD
Screen Shot 2021-04-03 at 9.21.46 PM.png (110.63 KiB) Viewed 1578 times
As TechDraw see it.
As TechDraw see it.
Screen Shot 2021-04-03 at 9.18.10 PM.png (113.61 KiB) Viewed 1578 times
As FreeCAD sees it.
As FreeCAD sees it.
Screen Shot 2021-04-03 at 9.17.53 PM.png (137.09 KiB) Viewed 1578 times
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Opening an .scad file its parts are put to the wrong coordinates on screen

Post by openBrain »

Without any file and knowing your version of FreeCAD, anything would be blind guess.
infocean
Posts: 17
Joined: Tue Nov 13, 2018 4:41 am

Re: Opening an .scad file its parts are put to the wrong coordinates on screen

Post by infocean »

Hi OpenBrain,

OpenSCAD ver 2021 01. FreeCAD 0.19.

I attach the file, so you can see.

Thanks ahead,
Infocean
infocean
Posts: 17
Joined: Tue Nov 13, 2018 4:41 am

Re: Opening an .scad file its parts are put to the wrong coordinates on screen

Post by infocean »

Well, I did not attach it, looks like. ;-)
Attachments
Turbine first gen only.scad
(9.07 KiB) Downloaded 22 times
keithsloan52
Veteran
Posts: 2764
Joined: Mon Feb 27, 2012 5:31 pm

Re: Opening an .scad file its parts are put to the wrong coordinates on screen

Post by keithsloan52 »

Chris Hennes @chennes Has been doing some work on OpenSCAD tidying things up, but I fear he may have introduced a bug or two.

If I load the file up with my Alternate Importer https://github.com/KeithSloan/OpenSCAD_Alt_Import
I get
03E7ABED-9CBB-4486-AD2F-BFDBF9FB247D.jpeg
03E7ABED-9CBB-4486-AD2F-BFDBF9FB247D.jpeg (39.53 KiB) Viewed 1367 times
Which is a lot closer although one flange seems to be missing for some reason from your attempts.

If I load the same file into OpenSCAD I get
7CD4330F-E882-43DD-AD63-B418E6BDD15B_4_5005_c.jpeg
7CD4330F-E882-43DD-AD63-B418E6BDD15B_4_5005_c.jpeg (40.9 KiB) Viewed 1367 times
which to me looks the same as the version using the Alternate Importer.

Apart for the handling of hull & minkowski requests my Alternate Importer uses the old importer code, so another option might be to try an old FreeCAD release at least for the import.

I am sure if we alert Chris he should be able to resolve fairly quickly.
keithsloan52
Veteran
Posts: 2764
Joined: Mon Feb 27, 2012 5:31 pm

Re: Opening an .scad file its parts are put to the wrong coordinates on screen

Post by keithsloan52 »

Just noticed that you are using OpenSCAD 2021.01

So updated my version and your file still looks like
33E7E1A3-F7AF-4FD1-BCD8-2A43298FAF39.jpeg
33E7E1A3-F7AF-4FD1-BCD8-2A43298FAF39.jpeg (29.47 KiB) Viewed 1360 times
i.e. the same as Alternative Importer and different from your original post.
User avatar
chennes
Veteran
Posts: 3910
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Opening an .scad file its parts are put to the wrong coordinates on screen

Post by chennes »

Thanks, Keith, I should be able to look at this later today.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
chennes
Veteran
Posts: 3910
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Opening an .scad file its parts are put to the wrong coordinates on screen

Post by chennes »

Here's what I'm seeing on my machine, which I believe is correct:
GearThing.png
GearThing.png (29.88 KiB) Viewed 1331 times
I'm on:

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.24694 +1 (Git)
Build type: Debug
Branch: pr/4730
Hash: 31ff2ff137bb2d35245fe8db5c0564284527d812
Python version: 3.8.6+
Qt version: 5.15.1
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United States (en_US)

@infocean, can you please post your version info?
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
chennes
Veteran
Posts: 3910
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Opening an .scad file its parts are put to the wrong coordinates on screen

Post by chennes »

I should also add that, although the work I have been doing is destined for 0.20, since it's Python, users of 0.19 can download the two files involved and just replace their versions.

https://raw.githubusercontent.com/FreeC ... portCSG.py
https://raw.githubusercontent.com/FreeC ... eatures.py
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
keithsloan52
Veteran
Posts: 2764
Joined: Mon Feb 27, 2012 5:31 pm

Re: Opening an .scad file its parts are put to the wrong coordinates on screen

Post by keithsloan52 »

By the way @infocean Nice use of the OpenSCAD workbench making Tech drawings of OpenSCAD models :) :)
Post Reply