CamBam
News:
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 15, 2019, 05:03:59 am


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: [V1-17] R16 for Linux - can't open file from Windows version  (Read 1532 times)
Dragonfly
CNC Jedi
*****
Offline Offline

Posts: 2180



View Profile
« on: August 15, 2018, 19:31:56 pm »

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.

* Dash-Front-Contours-Work.cb (17.01 KB - downloaded 66 times.)
« Last Edit: September 27, 2018, 18:40:27 pm by dh42 » Logged
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 5591



View Profile WWW
« Reply #1 on: August 15, 2018, 20: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
Logged
newlinuxuser
Droid
**
Offline Offline

Posts: 78


View Profile
« Reply #2 on: August 16, 2018, 00:09:43 am »

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.


* Dash-Front-Contours-Work.cb (17.02 KB - downloaded 54 times.)
Logged
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 5591



View Profile WWW
« Reply #3 on: August 16, 2018, 00:17:18 am »

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
Logged
Dragonfly
CNC Jedi
*****
Offline Offline

Posts: 2180



View Profile
« Reply #4 on: August 16, 2018, 19: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.
Logged
manymachines
CNC Ewok
*
Offline Offline

Posts: 20


View Profile
« Reply #5 on: August 19, 2018, 21: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.
Logged
onekk
Wookie
****
Offline Offline

Posts: 473


View Profile
« Reply #6 on: August 20, 2018, 11: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.
Logged

Carlo D. (onekk)

eShapeoko #343 750x1000 mm + GRBL + bCNC + CamBam
dave benson
CNC Jedi
*****
Offline Offline

Posts: 1131


View Profile
« Reply #7 on: August 20, 2018, 12:42:16 pm »

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


* xml files fir Cb.PNG (35.51 KB, 697x370 - viewed 96 times.)
Logged
Dragonfly
CNC Jedi
*****
Offline Offline

Posts: 2180



View Profile
« Reply #8 on: August 20, 2018, 18: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.
Logged
onekk
Wookie
****
Offline Offline

Posts: 473


View Profile
« Reply #9 on: August 21, 2018, 09: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.
Logged

Carlo D. (onekk)

eShapeoko #343 750x1000 mm + GRBL + bCNC + CamBam
dave benson
CNC Jedi
*****
Offline Offline

Posts: 1131


View Profile
« Reply #10 on: August 21, 2018, 13: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. Grin

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
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.118 seconds with 18 queries.

Copyright © 2018 HexRay Ltd. | Sitemap