Go Back   AC3D Forums > General > AC3D General
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 10th December 2023, 12:22 PM   #1
iarUka
Junior Member
Junior member
 
Join Date: Dec 2023
Posts: 2
Exclamation STL file export, shift coordinates and flip y and z. Intended?

Using AC3D 9.1.0 on linux.
I noticed that an export to STL format flips the Y and Z axis and offsets the coordinates for the vertices to be all positive. Is that intended? If so, why?

How to reproduce:
  • create a new scene
  • generate any triangle object in a space close to the origin, make sure at least one coordinate is negative. I used a square and triangulated it.
  • export to STL, I used ASCII (but that should not matter)
  • re-import from the same file in the same scene.

The result of this is that the element exported shows up somewhat rotated and translated.

Now I read that STL requires to have only positive coordinates. I also read that this is historic and not required. I do not read anything about the axis flip, but I might not have read the correct sources.

If I modify the STL files to contain negative vertex coordinates, AC3D imports that without problems.

Could we add settings to control that behavior, similar to OBJ files?
iarUka is offline   Reply With Quote
Old 11th December 2023, 10:01 AM   #2
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,563
Default Re: STL file export, shift coordinates and flip y and z. Intended?

The coordinate system change is deliberate (since most stl files use a CAD coordinate system and AC3D doesn't).


The loader will always swap YZ.



There used to be a setting in preferences that switched on/off the swap but since the STL importer is now an ASSIMP one, that doesn't work any more and was removed.


However, the setting for the exporter should still work.


If you edit ac3dprefs.txt (from you home directory) and change the setting for "stl_swap_yz", that should fix the export. But, it will always flip on import.
Andy is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 02:22 PM.


AC3D Forum
(C) Inivis Limited 2020