Author Topic: [V1-17] R16 for Linux - can't open file from Windows version (solved in V1 RC1)  (Read 7612 times)

Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2610
    • View Profile
Apart from the ugly menus which use huge font sizes after the latest Mono updates today I discovered that CB for Linux won't open a quite simple file, issuing XML error.
Don't know the reason - Mono or CB itself.
To those who use the Linux version, please, try to open the attached file. It contains a simple 3D surface generated by CamBam and one polyline. The file was created with the Windows version of CB 1 R16 and opens OK there.
« Last Edit: November 01, 2019, 21:53:07 pm by dh42 »

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7256
    • View Profile
    • Cambam V1.0 French Doc
Re: CamBam 1 R16 for Linux - can't open file from Windows version
« Reply #1 on: August 15, 2018, 19:40:02 pm »
Hello

Yes, I get an error on Linux ( error in XML document 166-36)

I do not see strange things in the line 166 of the XML

I get exactly the same error on CB 0.98 P for linux.

I also just see that the Draw/surface/extrude solids and fill functions in the V1.0 are not working on linux (CB terminate)

(Ubuntu 14.04 LTS 32 bits)

++
David

Offline newlinuxuser

  • Droid
  • **
  • Posts: 92
    • View Profile
Re: CamBam 1 R16 for Linux - can't open file from Windows version
« Reply #2 on: August 15, 2018, 23:09:43 pm »
I think there is a problem in the line 166, I tried to add another 0, and the file opens fine.
Here the file with the little corrections, it seems good to me.


Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7256
    • View Profile
    • Cambam V1.0 French Doc
Re: CamBam 1 R16 for Linux - can't open file from Windows version
« Reply #3 on: August 15, 2018, 23:17:18 pm »
Yes, but the strange thing is that there is other lines that have no coordinate for the Z (I assume it is not written when Z=0) .. and they do not cause a problem ...

I'll move this post to the bug section

++
David

Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2610
    • View Profile
Re: CamBam 1 R16 for Linux - can't open file from Windows version
« Reply #4 on: August 16, 2018, 18:12:01 pm »
The file was created with CB 1R16 for Windows. The 3D object actually was created using the 'extrude solid' function an then rotated about Y and aligned at 0,0,0. The file is read back without any complaint under Windows.

Offline manymachines

  • Ewok
  • *
  • Posts: 20
    • View Profile
Re: CamBam 1 R16 for Linux - can't open file from Windows version
« Reply #5 on: August 19, 2018, 20:20:04 pm »
I can also reproduce the error when opening the file with CB 1R16 and confirm that it opens without error after manually editing line 166.

Offline onekk

  • CNC Jedi
  • *****
  • Posts: 525
    • View Profile
Re: CamBam 1 R16 for Linux - can't open file from Windows version
« Reply #6 on: August 20, 2018, 10:45:24 am »
A little reading on the file reveals that some vertices are missing the Z coordinates, maybe a little script that read the <v> </v> and correct the missing Z value inserting a ,0 will be helpful.

I'm working on a parser in python to do some common adjustement to the file like rounding the pointlist to a given precision and so on, so maybe if I find a way to do this I could implement a way to make these corrections, but sadly I douobt it is feasible with the CamBam Python interpreter, as a decent XML parser is needed and I doubt that IronPython.dll contains an XML parser.

Rergards

Carlo D.
Carlo D. (onekk)

eShapeoko #343 750x1000 mm + GRBL + bCNC + CamBam

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1774
    • View Profile
Re: CamBam 1 R16 for Linux - can't open file from Windows version
« Reply #7 on: August 20, 2018, 11:42:16 am »
Hi carlo
The tool and style files are xml and I've accessed them in  C# so you should be able to do this maybe with a little digging around.

Dave

Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2610
    • View Profile
Re: CamBam 1 R16 for Linux - can't open file from Windows version
« Reply #8 on: August 20, 2018, 17:47:54 pm »
It seems this affects the internally created by CamBam 'solid extrude' objects. I created the same shape in FreeCAD and exported to .stl .  Replaced the other shape with the new one and now the file opens OK in both OS versions.

So it may be not a bug in the Linux version but rather a bug in the Windows one when writing the data for internally generated 3D object.  It may also be a bug that the Windows version reads the file back even if there is incomplete data.

Offline onekk

  • CNC Jedi
  • *****
  • Posts: 525
    • View Profile
Re: CamBam 1 R16 for Linux - can't open file from Windows version
« Reply #9 on: August 21, 2018, 08:53:20 am »
Yes i know that most of the files are in xml, but the problem here is to "externally" correct the problematic files that didn't open on CamBam when used both in Linux and Windows.

Some file created by Linux are not correctly readable by windows, due to some differences in the implementations, I'm using my memory but some file didn't open because in some construct (MOP or some other objects) some paramters are written True and False in Linux but windows refuse to read True or False becuase it expect "true" or "false".

Same thing with this "error" in the vertex creation where the <v>x,y,z</v> sometimes lack of the ",z".

For this some "validation program" will be a good improvmentm, at least for the time the error is present.

I have found that for some tedious modifications, sometimes when you modify a ìn object the MOP's that reference to this object are not updated and you to have to modify by hand all the occurencies, simply note down the old ID and then when done using a text editor and doing a search ID="10" and replace with ID="101" will do the job in a fast and clean manner, obviously checking by hand every occurences and not doing a "replace all".

But as usual is a matter of taste.

Regards
Carlo D.
Carlo D. (onekk)

eShapeoko #343 750x1000 mm + GRBL + bCNC + CamBam

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1774
    • View Profile
Re: CamBam 1 R16 for Linux - can't open file from Windows version
« Reply #10 on: August 21, 2018, 12:54:38 pm »
Hi Carlo

Can you parse XML with IronPython?  Yes, see link.
http://ironpython.net/documentation/dotnet/dotnet.html

And here is an example of how to do it.
https://eli.thegreenplace.net/2012/03/15/processing-xml-in-python-with-elementtree/

You're a better man than me Carlo, I'd rather stab myself in the eye with a sharp stick than program with Python. ;D

Eddy pointed me to grepwin (for windows)  or if you use linux, grep which would be better than an text editor as you can "conditionally" change items in your file.

Good Luck.

Dave