Author Topic: "Snappy", more snap points for CamBam plugin  (Read 36810 times)

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4739
    • View Profile
Re: "Snappy", more snap points for CamBam plugin
« Reply #120 on: May 22, 2018, 20:30:17 pm »
I have a fix for that but it might have to wait a day or so for an update.
The fix is to find the Centroid of each entity, if the X value = NaN then the entity is invalid and
should not be included in the entity list to further process.

Edit: new version 8.7 attached to first post.
« Last Edit: May 22, 2018, 21:11:00 pm by EddyCurrent »
Made in England

Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2445
    • View Profile
Re: "Snappy", more snap points for CamBam plugin
« Reply #121 on: May 23, 2018, 07:31:08 am »
Thanks, Eddy!
But this got me thinking wouldn't it be better that a check for invalid objects is built into CamBam when opening a file ... or an option in the 'Edit' menu for example.

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8449
    • View Profile
Re: "Snappy", more snap points for CamBam plugin
« Reply #122 on: May 23, 2018, 19:26:26 pm »
Well... in a sense there is a detection system.  It reports the error! <grin>

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2445
    • View Profile
Re: "Snappy", more snap points for CamBam plugin
« Reply #123 on: July 28, 2018, 08:00:22 am »
It seems 'Snappy' does not account for hidden layers. In a project I have two hidden layers with a lot of 2D objects and two other with a 3D object in each. And the drawing of a new object on another visible layer slows down CamBam work to almost unusable speed. Several second of waiting until cursor reacts to mouse movement.
Seems to me logical that hidden layers should be ignored.

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4739
    • View Profile
Re: "Snappy", more snap points for CamBam plugin
« Reply #124 on: July 28, 2018, 10:04:06 am »
Agreed, new version 8.8 attached to first post, ignore hidden layers.
Made in England

Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2445
    • View Profile
Re: "Snappy", more snap points for CamBam plugin
« Reply #125 on: July 28, 2018, 10:32:26 am »
That was fast  ;D
Cheers!

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6489
    • View Profile
    • Cambam V1.0 French Doc
Re: "Snappy", more snap points for CamBam plugin
« Reply #126 on: July 28, 2018, 21:05:18 pm »
Hello

Strange, I do not have this behavior with the V8.7 ; no snap to object on hidden layers(*), and also no snap to locked layers  ??? (maybe locked layer can't be handled because snappy is 0.98 compatible)

(*) maybe I don't understand well ; it snap on hidden objects or it's only slowed down ? (I always disable 'intersection' in the snappy window if I don't need it because it seems that it's what slow down the things on large drawings)

++
David

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4739
    • View Profile
Re: "Snappy", more snap points for CamBam plugin
« Reply #127 on: July 28, 2018, 21:21:01 pm »
In 8.8 it's like this;

Code: [Select]
foreach (Layer layer in myfile.Layers)
                        {
                            // use visible layers only
                            if (layer.Visible)
                            {
                                foreach (Entity ent1 in layer.Entities)
                                {


and thanks David for keeping the plugin web page up to date.
« Last Edit: July 28, 2018, 21:24:46 pm by EddyCurrent »
Made in England

Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2445
    • View Profile
Re: "Snappy", more snap points for CamBam plugin
« Reply #128 on: July 29, 2018, 07:02:41 am »
I should have mentioned that snapping does not occur but iterating through all objects slows down CB very significantly. When there are many - in my case an imported .dxf produced by a 3D CAD program where every single line and arc is a separate entity.

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4739
    • View Profile
Re: "Snappy", more snap points for CamBam plugin
« Reply #129 on: July 29, 2018, 10:08:54 am »
That is correct and I would very much like it if Andy would add more snaps in the 'correct' manner to prevent slow down.
Made in England

Offline GeoffreyGRoy

  • Storm Trooper
  • ***
  • Posts: 234
    • View Profile
Re: "Snappy", more snap points for CamBam plugin
« Reply #130 on: June 20, 2021, 02:06:21 am »
Dear Eddy

I have come across a problem with Snappy when loading a large surface model - 50 Mb plus (with CB1.0). I have attached the Unhandled Exception report. The error occurs at loading the CB file, if I remove the Snappy plugin - no error.  The CB file is too big to also attach.

Any thoughts?

Geoff

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4739
    • View Profile
Re: "Snappy", more snap points for CamBam plugin
« Reply #131 on: June 20, 2021, 08:26:57 am »
Geoff,

Is there any particular checkbox that causes the problem ?
Made in England

Offline GeoffreyGRoy

  • Storm Trooper
  • ***
  • Posts: 234
    • View Profile
Re: "Snappy", more snap points for CamBam plugin
« Reply #132 on: June 20, 2021, 08:44:34 am »
Dear Eddy
Good question, I have discovered the following:

(1) The problem  relates to "Snap to Object", if I disable this option the problem does not appear.  The other options seem to have no effect.
(2) The problem only appears if I load the CB model by <double clicking> it, If I start CB, then load the model the problem does not seem to appear!

Geoff

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4739
    • View Profile
Re: "Snappy", more snap points for CamBam plugin
« Reply #133 on: June 20, 2021, 10:51:54 am »
Geoff,

Snap to object goes like this, it just calls CamBam's internal method for setting snap to object.

Code: [Select]
// snap to object
        private void checkBox5_Click(object sender, EventArgs e)
        {
            CamBamConfig.Defaults.SnapToPoints = !CamBamConfig.Defaults.SnapToPoints;
            checkBox5.Checked = CamBamConfig.Defaults.SnapToPoints;
            CamBamUI.MainUI.ViewContextMenus.RefreshCheckedMenus();

            // if snap toolbar button plugin installed, update button
            if (Params.object_button != null)
                Params.object_button.Checked = CamBamConfig.Defaults.SnapToPoints;
        }

Made in England