Author Topic: PseudoGrid new plugin to make a custom size grid  (Read 28744 times)

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5319
  • Made in England
    • View Profile
PseudoGrid new plugin to make a custom size grid
« on: October 28, 2021, 19:02:31 pm »
Following on from this thread; https://cambamcnc.com/forum/index.php?topic=9339.msg72908#msg72908

Please find attached version 1.0 of the PseudoGrid plugin for CamBam v1.0


1. Once installed the plugin will appear in CamBam's "Tools" menu as "PseudoGrid"
2. clicking on this will open a form allowing these options;

Bottom left corner X of grid
Bottom left corner Y of grid
Width of grid
Height of grid
X spacing
Y spacing
Add a Pointlist to the intersections
Choose colour of the grid

3. On the first run some default values are used, change these to suit before clicking the "Ok" button.
The new values will be saved in Windows Registry and will be used on the next use.

4. The option to add a pointlist is to ensure a snap point exists at each intersection, without it there would be no snap point
The "Snappy" plugin could be used to allow snapping to the intersections without a pointlist but does not work if the layer is "locked"

5. The grid layer is "locked" to prevent the user selecting any part of it.

6. You should hide the real grid for clarity and enable 'snap to object', I will put these two actions into the next version of the plugin.

7. Following a click of the "Ok" button the grid will be produced, you should now drag the new Layer called"Grid" to the top of the Layer list, this will ensure it is at the 'back' so that all other layers will draw on top of it.

******   If anyone knows how to achieve moving the layer to the top of the Treeview via the plugin, please let me know.

Edit: version 2.0 attached

« Last Edit: October 29, 2021, 12:11:17 pm by EddyCurrent »
Filmed in Supermarionation

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5319
  • Made in England
    • View Profile
Re: PseudoGrid new plugin to make a custom size grid
« Reply #1 on: October 29, 2021, 12:10:39 pm »
Version 2.0 attached to first post in this thread.

1. plugin sets grid to CamBam's hidden
2. plugin sets snap options to "snap to object"

You might also find this plugin handy, it allows objects such as Circles, Rectangles and Polylines to have their dimensions set at the time of drawing.
http://www.atelier-des-fougeres.fr/Cambam/Aide/Plugins/DimObjects.html

Be sure to read the instructions first on how it is used.
Filmed in Supermarionation

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 9074
    • View Profile
Re: PseudoGrid new plugin to make a custom size grid
« Reply #2 on: October 29, 2021, 12:50:44 pm »
Y'know, I've always used an 'arbitrary' array of points to align those jobs where there might be 256 repeats of the same pattern on one worksheet.  But this new tool appears to be a better solution!

Thanks, Eddy, for your hard and knowledgeable work on plugins for us.

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

Offline EL34

  • CNC Jedi
  • *****
  • Posts: 783
    • View Profile
    • EL34's CNC Stuff
Re: PseudoGrid new plugin to make a custom size grid
« Reply #3 on: October 29, 2021, 14:38:37 pm »
Very cool Eddy and thanks for doing this

Couple questions:

The Pseudo grid tool uses inches or mm based on what you have the file set to
So there is no need to specify inches or mm for the grid?

When I click on the pseudo grid layer and edit the height or width, it creates another grid layer
So it does not edit the original grid, it creates another grid layer?

In my screen shot below, I edited the height of Pseudo grid
It then created another grid
Mach 3, Cambam, Autodesk Quickcad 8, machine info -> http://www.el34world.com/Misc/Cnc/CNC0.htm

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5319
  • Made in England
    • View Profile
Re: PseudoGrid new plugin to make a custom size grid
« Reply #4 on: October 29, 2021, 14:43:31 pm »
Thank you both for those kind words, Lloyd, I have to keep myself entertained somehow  :D

The plugin just uses numbers, it does not know or care if they are mm or inches.

I did not consider editing the grid after it was drawn so you are correct in saying that it creates a new grid.
Just delete the old grid layer if it's not required again.

You must add a pointlist if the Grid layer is to be locked and don't forget to drag the "Grid" layer to the top of the Layer list.
« Last Edit: October 29, 2021, 14:47:12 pm by EddyCurrent »
Filmed in Supermarionation

Offline EL34

  • CNC Jedi
  • *****
  • Posts: 783
    • View Profile
    • EL34's CNC Stuff
Re: PseudoGrid new plugin to make a custom size grid
« Reply #5 on: October 29, 2021, 14:59:19 pm »
Thanks
Another question

I moved the grid to the top of the tree

I copied a circle, then pasted it
It pasted on top of the original circle

Then I SHIFT - Right arrow to move it off the original circle

It does not snap onto the grid center point
In Cambam, I have snap-to grid off and snap to objects off

Where is it snapping to?

In my screen shot you can see the circle is not snapping to the grid
« Last Edit: October 29, 2021, 15:01:09 pm by EL34 »
Mach 3, Cambam, Autodesk Quickcad 8, machine info -> http://www.el34world.com/Misc/Cnc/CNC0.htm

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5319
  • Made in England
    • View Profile
Re: PseudoGrid new plugin to make a custom size grid
« Reply #6 on: October 29, 2021, 15:16:14 pm »
There are two scenarios, you should be using only one of them.

1. using the Snappy plugin
2. not using the Snappy plugin, I wrote the plugin with the idea of not using the Snappy plugin so that the layer could be locked.

Using Snappy
 
1. snappy will snap to intersections, however if the Grid layer is locked it will not snap to them

Not using Snappy

1. CamBam does not natively snap to intersections so a Pointlist has to used at each intersection
2 "Snap to object"  must be selected
3. this method works even when the Grid layer is locked

You don't want to be using copy past and the shift keys, use the Dimensioned Objects plugin I mentioned earlier and create a new circle each time with the centre snapped to an intersection.



« Last Edit: October 29, 2021, 15:34:01 pm by EddyCurrent »
Filmed in Supermarionation

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5319
  • Made in England
    • View Profile
Re: PseudoGrid new plugin to make a custom size grid
« Reply #7 on: October 29, 2021, 15:32:14 pm »
Thanks
Another question

Then I SHIFT - Right arrow to move it off the original circle

It does not snap onto the grid center point
In Cambam, I have snap-to grid off and snap to objects off

Where is it snapping to?

In my screen shot you can see the circle is not snapping to the grid

Nothing in CamBam will snap to the grid in the manner you describe, be it the original built in grid or this plugin grid.
You need to either create a new object so that the cursor snaps to the grid or use the, Shift+mouse drag, to move an existing object, eg using the centre of a circle.
CamBam snaps only work when the object is very close to the snap point.
« Last Edit: October 29, 2021, 15:33:46 pm by EddyCurrent »
Filmed in Supermarionation

Offline EL34

  • CNC Jedi
  • *****
  • Posts: 783
    • View Profile
    • EL34's CNC Stuff
Re: PseudoGrid new plugin to make a custom size grid
« Reply #8 on: October 29, 2021, 15:37:31 pm »
Copying and pasting circles and having them snap to a grid intersection is exactly how I create drilling layouts in Cambam

It works just fine in Cambam when not using either of the new tools
CNTRL-C, CNTRL-V then Shift arrow snaps the copied circle to the next grid point

I don't have any points list and it works great in Cambam
The only issues is I can't set up rectangular grids like in your tools

Look at this screen shot
Copied - Pasted - Moved with shift arrow snaps exactly onto the .25 inch grid

So the new plug-in and the new tool is still snapping to whatever was set in Cambam options
Even though snap-to is off, the tools are still using Cambam's grid settings for snapping

« Last Edit: October 29, 2021, 15:42:01 pm by EL34 »
Mach 3, Cambam, Autodesk Quickcad 8, machine info -> http://www.el34world.com/Misc/Cnc/CNC0.htm

Offline EL34

  • CNC Jedi
  • *****
  • Posts: 783
    • View Profile
    • EL34's CNC Stuff
Re: PseudoGrid new plugin to make a custom size grid
« Reply #9 on: October 29, 2021, 15:39:11 pm »
Take this .cb file and copy - paste - move a circle with shift arrow keys
It will snap to the cambam grid points
Mach 3, Cambam, Autodesk Quickcad 8, machine info -> http://www.el34world.com/Misc/Cnc/CNC0.htm

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5319
  • Made in England
    • View Profile
Re: PseudoGrid new plugin to make a custom size grid
« Reply #10 on: October 29, 2021, 17:12:31 pm »
From the manual;

"Using the keyboard only, selected objects can be moved holding the SHIFT key and using the arrow keys. This will
move the object one minor grid unit in the arrow key direction (If using millimeters, this will be 1mm, if using inches
then this will be 1/16"). If CTRL+SHIFT keys are held down, objects will be moved one major grid unit (If using
millimeters, this will be 10mm, if using inches then this will be 1")"

But this is using CamBam's own grid and it's not really a snap because the objects are being moved the exact dimensions of the grid.

If you want the use the PseudoGrid then CamBam's "snap to grid" MUST be disabled and "snap to objects" MUST be enabled.

Filmed in Supermarionation

Offline EL34

  • CNC Jedi
  • *****
  • Posts: 783
    • View Profile
    • EL34's CNC Stuff
Re: PseudoGrid new plugin to make a custom size grid
« Reply #11 on: October 29, 2021, 18:47:34 pm »
If you want the use the PseudoGrid then CamBam's "snap to grid" MUST be disabled and "snap to objects" MUST be enabled.

yes, I know all that and I had all the grid stuff turned off for snappy and pseudo grids

What I am saying is that doing the same exact copy-paste-move with both grid tools does not snap to the grids those tools create

It still snaps to whatever Cambam's grid settings are
Even though all snap to settings are turned off in Cambam

In Snappy, I tried several of the selections in the snap control box and none of them snap to the grid it created
Intersection would seem to be the most logical choice?

I can't see a way for the new grid tools to snap to the grid they create?
I would have to create a points list first and then draw each circle again?

I am not up for doing that
It's just easier for me to import a DXF layer from my old 2D cad program as a new layer in Cambam
It can do all of the grid snapping things perfectly, but it's a pain to have to work with two programs
Mach 3, Cambam, Autodesk Quickcad 8, machine info -> http://www.el34world.com/Misc/Cnc/CNC0.htm

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5319
  • Made in England
    • View Profile
Re: PseudoGrid new plugin to make a custom size grid
« Reply #12 on: October 29, 2021, 18:56:23 pm »
At this point I'm totally confused so I'll have to leave it at that.
Filmed in Supermarionation

Offline EL34

  • CNC Jedi
  • *****
  • Posts: 783
    • View Profile
    • EL34's CNC Stuff
Re: PseudoGrid new plugin to make a custom size grid
« Reply #13 on: October 30, 2021, 12:30:48 pm »
Boiled down version

I would like the circles to always snap to the center of the grid intersections
Just like the Cambam grid does.

It's nice to be able to have non square grids like the new tools can do
But I need the circles to snap to these grids easily and fast

Thanks for all your hard work.

Mach 3, Cambam, Autodesk Quickcad 8, machine info -> http://www.el34world.com/Misc/Cnc/CNC0.htm

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5319
  • Made in England
    • View Profile
Re: PseudoGrid new plugin to make a custom size grid
« Reply #14 on: October 30, 2021, 12:44:58 pm »
If you want to use the copy/paste method;

1. there must be a point at each grid intersection if the layer is locked
2. "snap to object" must be enabled
3. "snap to grid" must be disabled
4. you must use this method for moving them;


From the manual
"Objects can be moved by selecting them, then holding down the SHIFT key whilst dragging the objects with the
mouse."

When selecting the circle click on it's centre point before moving and it will snap to the point on each intersection.

It may be possible to either change the SHIFT + arrow key movement distances to match the pseudogrid spacing or perhaps define a new set of hot keys to do the same thing, but it might take me a while to look at it.
« Last Edit: October 30, 2021, 15:00:46 pm by EddyCurrent »
Filmed in Supermarionation