Author Topic: [V1-12] Buggy File (solved in V1 RC1)  (Read 2710 times)

Offline Bob La Londe

  • CNC Jedi
  • *****
  • Posts: 3975
  • ^ 8.5 pounds on my own hand poured bait.
    • View Profile
    • CNC Molds N Stuff
[V1-12] Buggy File (solved in V1 RC1)
« on: July 17, 2018, 02:14:22 am »
I don't know how to quantify this bug.  I start to do anything with this fairly simple file and I get a fatal error.  

Using latest release of 1.0.  


I was setting this up as a templeate file for engraving standard sizes of brass plates and when I went back to do anything with it I get the error quit or continue screen.  Continue clears it and the instant I do anything it comes back.  Quit of course quits.  Never experienced anything like it before.  



« Last Edit: November 01, 2019, 21:50:30 pm by dh42 »
Getting started on CNC?  In or passing through my area?
If I have the time I'll be glad to show you a little in my shop. 

Some Stuff I Make with CamBam
http://www.CNCMOLDS.com

Offline Bob La Londe

  • CNC Jedi
  • *****
  • Posts: 3975
  • ^ 8.5 pounds on my own hand poured bait.
    • View Profile
    • CNC Molds N Stuff
Re: Buggy File
« Reply #1 on: July 17, 2018, 02:19:20 am »
Draw a straight line or measure are pretty consistent.  Tried select all convert to polyline and it locked up.  Had to use Task Manager to shut it down. 
Getting started on CNC?  In or passing through my area?
If I have the time I'll be glad to show you a little in my shop. 

Some Stuff I Make with CamBam
http://www.CNCMOLDS.com

Offline Bob La Londe

  • CNC Jedi
  • *****
  • Posts: 3975
  • ^ 8.5 pounds on my own hand poured bait.
    • View Profile
    • CNC Molds N Stuff
Re: Buggy File
« Reply #2 on: July 17, 2018, 02:25:15 am »
If it helps:  I was able to delete the text entries, and then the problem went away.

Getting started on CNC?  In or passing through my area?
If I have the time I'll be glad to show you a little in my shop. 

Some Stuff I Make with CamBam
http://www.CNCMOLDS.com

Offline Bob La Londe

  • CNC Jedi
  • *****
  • Posts: 3975
  • ^ 8.5 pounds on my own hand poured bait.
    • View Profile
    • CNC Molds N Stuff
Re: Buggy File
« Reply #3 on: July 17, 2018, 02:28:45 am »
Then I used CTRL Z to restore the text.  When all but one text field was restored CamBAm got slow and erratic.  When the last one was restored the error came back. 
Getting started on CNC?  In or passing through my area?
If I have the time I'll be glad to show you a little in my shop. 

Some Stuff I Make with CamBam
http://www.CNCMOLDS.com

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6133
    • View Profile
    • Cambam V1.0 French Doc
Re: Buggy File
« Reply #4 on: July 17, 2018, 02:36:59 am »
Hello Bob

Problem with Text (14) ; the Text property is empty and cause an error when trying to convert to polyline (Object reference not set to an instance of an object.)

... I saw the same error with empty text a few time ago .. but I don't remember where ...

edit: here
http://www.cambam.co.uk/forum/index.php?topic=6790.msg59478#msg59478

++
David
« Last Edit: July 17, 2018, 02:43:09 am by dh42 »

Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2370
    • View Profile
Re: Buggy File
« Reply #5 on: July 17, 2018, 08:20:32 am »
Quote
... I saw the same error with empty text a few time ago .. but I don't remember where ...
It was in one of my files where you found the problem faster than me, as usual :)

It was connected to the 'Snappy' plugin when the mouse pointer hovered over the empty object and Eddy added a check to the plugin.
IIRC I then suggested that such check might be useful to add into CamBam itself when reading a file. And discard invalid objects.

Offline 10bulls

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 2164
  • Coding Jedi
    • View Profile
    • www.cambam.info
Re: Buggy File
« Reply #6 on: July 17, 2018, 11:24:42 am »
I have changed the MText.ToRegions() method to return an empty array, rather than a null value.

This prevents the error and should also be kinder on scripting and plugins.
This will be in the next update.

Thank you for pointing this out.

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4463
    • View Profile
Re: Buggy File
« Reply #7 on: July 17, 2018, 12:05:26 pm »
In the Snappy plugin I used this method to detect an invalid entity;

 // detect invalid entities
     Point3F cnt = ent1.GetCentroid();
     if (cnt.X.ToString() == "NaN") continue;

It uses 'continue' due to the code being in a loop

Made in England

Offline 10bulls

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 2164
  • Coding Jedi
    • View Profile
    • www.cambam.info
Re: Buggy File
« Reply #8 on: July 17, 2018, 12:38:29 pm »
Points and vectors in CamBam provide a property 'IsUndefined'.
This returns true if any X,Y or Z properties are NaN.
You can use it like this...

Code: [Select]
Point3F cnt = ent1.GetCentroid();
     if (cnt.IsUndefined) continue;

There is also a .NET function double.IsNaN(...) which is useful to check numbers for NaNs without needing string compares.

If you want to set a point as undefined you can use the point and vector .Undefined static property, like this...

Code: [Select]
Point3F p = Point3F.Undefined;


Offline Bob La Londe

  • CNC Jedi
  • *****
  • Posts: 3975
  • ^ 8.5 pounds on my own hand poured bait.
    • View Profile
    • CNC Molds N Stuff
Re: Buggy File
« Reply #9 on: July 17, 2018, 22:43:33 pm »
Getting started on CNC?  In or passing through my area?
If I have the time I'll be glad to show you a little in my shop. 

Some Stuff I Make with CamBam
http://www.CNCMOLDS.com