Ticket #4121 - Text in AMF files comes out in reverse while STL is correct

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!
bowcoastie
Posts: 5
Joined: Tue Sep 10, 2019 2:04 am

Ticket #4121 - Text in AMF files comes out in reverse while STL is correct

Postby bowcoastie » Fri Sep 13, 2019 2:38 am

Hello All,
While working on some signs to print on a 3D printer, I found that the text was coming out in reverse when I exported an AMF file for processing in CURA. After much frustration I exported the same file in STL format and it worked correctly. I have searched the forum and bug tracker and found no reference to this issue. Unfortunately I went ahead and made a bug tracker entry for what I perceive to be a bug but I guess I should have posted the issue in the forum first; my apologies.

Does anyone else have a problem with text coming out in reverse when exporting an AMF file vs an STL?

Thank you for your great project and any help. :)

The bug tracker entry where I gave example files here: issue #4121

My system information:
OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16131 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 3129ae4296e40ed20e7b3d460b86e6969acbe1c3
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
openBrain
Posts: 2138
Joined: Fri Nov 09, 2018 5:38 pm

Re: Text in AMF files comes out in reverse while STL is correct

Postby openBrain » Fri Sep 13, 2019 6:16 am

Hi bowcoastie, welcome.

Indeed the bug reporting process requires to post here first. This can look weird, but actually it allows community to confirm and identify bugs, and eventually narrow down the cause. ;)
Could you please provide your FreeCAD file so we can try to reproduce?
bowcoastie
Posts: 5
Joined: Tue Sep 10, 2019 2:04 am

Re: Text in AMF files comes out in reverse while STL is correct

Postby bowcoastie » Sat Sep 14, 2019 3:39 am

Hello openBrain,
I posted the files over at bug tracking but will do so here as well.
The Jpeg showed what I see in the Cura slicer. The bottom example in the jpeg is the STL export file as where the upper example is the AMF export. Both came from the same FCSTD file.

Thank you for taking the time to look at this as it caused me a great deal of frustration.

Cheers,


Bruce
Attachments
AMF problem.jpg
AMF problem.jpg (9.55 KiB) Viewed 208 times
example AMF bug.FCStd
(81.33 KiB) Downloaded 8 times
openBrain
Posts: 2138
Joined: Fri Nov 09, 2018 5:38 pm

Re: Ticket #4121 - Text in AMF files comes out in reverse while STL is correct

Postby openBrain » Sat Sep 14, 2019 7:51 am

Hi Bruce,

Actually there is a mapping problem in your file. You can see that with the Std DependencyGraph.
Your ShapeString is mapped to a Pad face, which is not allowed as Pad is an internal Body feature and ShapeString is out of this Body.
You can fix that in 3 different ways :
  1. Use Part WB functions only => No special problem
  2. Use PartDesignWB functions only => In this case, ShapeString will be created out of the Body. You have to manually drag it into the Body, then map it correctly and finally use Pad function
  3. Part/PartDesign mix => This is what you did. To fix, before mapping the ShapeString, you have to change the Display Mode of the Body to 'Tip' (instead of 'Through'). This will expose Body as a Part object, where you can then correctly map your external ShapeString
Note that for stability consideration, this is never advised to map anything to faces and you should prefer mapping to base planes. ;)

I attach the file fixed with method 3 (which isn't the best but the quickest). I don't know why you extruded twice the ShapeString but I let them both. :)

Could you try to export and tell if it fixes the problem ?
Attachments
AMF_OB.FCStd
(64.5 KiB) Downloaded 3 times
bowcoastie
Posts: 5
Joined: Tue Sep 10, 2019 2:04 am

Re: Ticket #4121 - Text in AMF files comes out in reverse while STL is correct

Postby bowcoastie » Sat Sep 14, 2019 2:18 pm

Hello openBrain,
Thank you ever-so-much for helping me with this problem. :D I exported the file you sent as both an AMF and an STL and both of them show the text in reverse (screen-shot attached).

As per your suggestion I tried the same exercise using just the PartWB functions, solution 1 (file attached) and get the AMF files with the text backward and the STL file with the text correctly displayed.

I then tried suggestion 2 using only PartDesignWB functions only and received the error message "Unsupported sub-shape type" when I tried to pad the text. I tried this but could only pad the shape-string by selecting the 3rd choice, create a cross-reference. Both of the exported files (AMF and STL) had the text backward. I have included this file as well.

I could not try the third suggestion as I couldn't figure out where to change the display mode of the body to tip. I tried doing a search for on how to do it but came up with many unrelated items. Would you explain how to make that change?

Thank you again for taking the time to look at this with me. :)
Attachments
PartWB_only.FCStd
As per suggestion 1, use part WB only. In this case, AMF text is backward, STL text is correct.
(45.56 KiB) Downloaded 3 times
PartDesignWB_only.FCStd
As per suggestion 2, only the "Creat cross-reference" allowed the pad. Both AMF and STL files have text backward
(107.25 KiB) Downloaded 4 times
PartWB_only.png
STL output is on top (correctly displayed). AMF on bottom; text is reversed.
PartWB_only.png (76.63 KiB) Viewed 171 times
Part_Design Only.png
STL output is on top; text is reversed. AMF on bottom; text is reversed.
Part_Design Only.png (58.44 KiB) Viewed 171 times
AMF_OB test.png
The AMF and STL outputs for the file openBrain sent in reply. Both are backward.
AMF_OB test.png (10.49 KiB) Viewed 171 times
chrisb
Posts: 18791
Joined: Tue Mar 17, 2015 9:14 am

Re: Ticket #4121 - Text in AMF files comes out in reverse while STL is correct

Postby chrisb » Sat Sep 14, 2019 3:26 pm

bowcoastie wrote:
Sat Sep 14, 2019 2:18 pm
I couldn't figure out where to change the display mode of the body to tip.
At the lower left switch from Data tab to View tab.
chrisb
Posts: 18791
Joined: Tue Mar 17, 2015 9:14 am

Re: Ticket #4121 - Text in AMF files comes out in reverse while STL is correct

Postby chrisb » Sat Sep 14, 2019 4:13 pm

I had a look at the PartDesign example. It seems you didn't follow the advice given. You should drag and drop the shapestring into the body before padding it.
Bildschirmfoto 2019-09-14 um 23.49.46.png
Bildschirmfoto 2019-09-14 um 23.49.46.png (30.48 KiB) Viewed 146 times
But that's not the point here: The stl is exported correctly in both cases. The amf file is in both cases shown reversed in Cura. I wonder if someone has an alternative amf viewer to exclude Cura as the culprit.
chrisb
Posts: 18791
Joined: Tue Mar 17, 2015 9:14 am

Re: Ticket #4121 - Text in AMF files comes out in reverse while STL is correct

Postby chrisb » Sat Sep 14, 2019 4:27 pm

The mirroring effect can be seen without ShapeStrings as well and is easier to reproduce, because there is no need of font files. The lower image show the iamf file in Cura.
Bildschirmfoto 2019-09-15 um 00.22.33.png
Bildschirmfoto 2019-09-15 um 00.22.33.png (25.45 KiB) Viewed 141 times
Bildschirmfoto 2019-09-15 um 00.22.12.png
Bildschirmfoto 2019-09-15 um 00.22.12.png (47.67 KiB) Viewed 141 times
bowcoastie
Posts: 5
Joined: Tue Sep 10, 2019 2:04 am

Re: Ticket #4121 - Text in AMF files comes out in reverse while STL is correct

Postby bowcoastie » Sat Sep 14, 2019 10:38 pm

chrisb wrote:
Sat Sep 14, 2019 4:13 pm
I had a look at the PartDesign example. It seems you didn't follow the advice given. You should drag and drop the shapestring into the body before padding it.
Bildschirmfoto 2019-09-14 um 23.49.46.png

But that's not the point here: The stl is exported correctly in both cases. The amf file is in both cases shown reversed in Cura. I wonder if someone has an alternative amf viewer to exclude Cura as the culprit.
Hi Chrisb,
Thank you for looking at this. When I look at the model tree, the shape string is in there under the body at least as far as I can tell. How else does one know whether an item is part of the body other than in the model tree?

I'll retry the method suggested with the changing the body to tip.

Thank you again for looking at this.
Attachments
model tree.png
model tree with shape-string in body?
model tree.png (90.1 KiB) Viewed 118 times
bowcoastie
Posts: 5
Joined: Tue Sep 10, 2019 2:04 am

Re: Ticket #4121 - Text in AMF files comes out in reverse while STL is correct

Postby bowcoastie » Sat Sep 14, 2019 10:39 pm

chrisb wrote:
Sat Sep 14, 2019 4:27 pm
The mirroring effect can be seen without ShapeStrings as well and is easier to reproduce, because there is no need of font files. The lower image show the iamf file in Cura.
Bildschirmfoto 2019-09-15 um 00.22.33.png
Bildschirmfoto 2019-09-15 um 00.22.12.png
Hi Chrisb,

I'll download another slicer to see if this is a problem with Cura.

Thanks