Author Topic: Dimensioned Objects (polyline, circle, rectangle) plugin  (Read 8629 times)

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5065
  • Made in England
    • View Profile
Dimensioned Objects (polyline, circle, rectangle) plugin
« on: September 21, 2017, 10:09:03 am »
Inspired by Rhino 3D

No more messing about or guessing, specify the dimensions of Polylines, Circles, Polyrectangles as you draw them.

Two versions because of differences in CamBam's CAD.dll

After installation it appears in the 'Draw' menu and also as icons above the main drawing window.

I have produced a PDF guide and you should read it first.

Edit: (27th Dec 2018)

Version 4 attached.

Works for Polylines, Circles, Polyrectangles

Edit: 19th Jan 2019

Version 4.5 attached

is the Translation code fixed ?

« Last Edit: January 19, 2019, 15:18:36 pm by EddyCurrent »
Filmed in Supermarionation

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1601
    • View Profile
Re: Dimensioned Objects (polyline, circle, rectangle) plugin
« Reply #1 on: September 21, 2017, 11:20:43 am »
HI Eddy
one worked fine the other became a point and was not selectable from the screen, only from the tree.

Dave

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5065
  • Made in England
    • View Profile
Re: Dimensioned Objects (polyline, circle, rectangle) plugin
« Reply #2 on: September 21, 2017, 11:53:26 am »
Did you press Enter before clicking a second point ?

DO NOT press Enter after entering a value unless you want to end the line drawing process

Edit: Yes, I've just tried it and if Enter is pressed before the second point is selected that's what happens.

Another Edit:  :D  Fixed, thanks for the bug report Dave.

This is the work flow for this plugin;

1. click the start point
2. drag the next point around with the cursor ("rubber band" phase)
3. if desired, enter a value (just type some numbers DO NOT PRESS ENTER.)
4. if "rubber band" is dragged out long enough then a superimposed line will show, if not long enough then it won't show.
5. click left mouse button to fix next point
6. repeat steps 2 to 5 unitl finished then press 'Enter'
« Last Edit: September 21, 2017, 12:19:48 pm by EddyCurrent »
Filmed in Supermarionation

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5065
  • Made in England
    • View Profile
Re: Dimensioned Objects (polyline, circle, rectangle) plugin
« Reply #3 on: September 21, 2017, 15:15:49 pm »
Version 2 added to first post, it's for CamBam v1 only (until the code gets sorted better, rectangle is tougher than I thought because you can't get the first point clicked from the editmode and so it's not known from which corner to start the resize.)

Added circle.

If no value is entered it works just like the normal circle function.
If a value is entered then Enter or Left Click to complete.
« Last Edit: September 21, 2017, 18:05:56 pm by EddyCurrent »
Filmed in Supermarionation

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5065
  • Made in England
    • View Profile
Re: Dimensioned Objects (polyline, circle, rectangle) plugin
« Reply #4 on: September 21, 2017, 19:03:55 pm »
Version 3 attached to first post.

1. moved to 'Draw' menu
2. icons added to Entity toolbar
3. translation code added

Filmed in Supermarionation

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5065
  • Made in England
    • View Profile
Re: Dimensioned Objects (polyline, circle, rectangle) plugin
« Reply #5 on: September 21, 2017, 19:26:07 pm »
Version 3 for CamBam v098 attached to first post
Filmed in Supermarionation

Online dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6889
    • View Profile
    • Cambam V1.0 French Doc
Re: Dimensioned Objects (polyline, circle, rectangle) plugin
« Reply #6 on: September 30, 2017, 15:52:31 pm »
Hello

Interesting plugin  ;)

If you need to draw a sized line + a given angle you can also use this one.

http://www.atelier-des-fougeres.fr/Cambam/Aide/Plugins/sizedlines.html

++
David

« Last Edit: December 27, 2018, 22:14:12 pm by dh42 »

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5065
  • Made in England
    • View Profile
Re: Dimensioned Objects (polyline, circle, rectangle) plugin
« Reply #7 on: October 01, 2017, 17:39:23 pm »
I'd like to know how others go about drawing connected lines of particular lengths, is there some method in CamBam I'm not aware of ?

And I'm talking about sizes that do not fit the grid exactly, or if not snapping to the grid.
Filmed in Supermarionation

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 3238
    • View Profile
Re: Dimensioned Objects (polyline, circle, rectangle) plugin
« Reply #8 on: October 01, 2017, 17:44:44 pm »
I'd like to know how others go about drawing connected lines of particular lengths, is there some method in CamBam I'm not aware of ?

And I'm talking about sizes that do not fit the grid exactly, or if not snapping to the grid.


Eddy, I usually use one side of rectangle (as it can be easily dimentioned and positioned) drew polyline on one side then delete the rectangle.. Good luck.  
« Last Edit: October 01, 2017, 19:33:44 pm by Bubba »
My 2¢

Win10 (64 bit, CB(1.0)rc 1(64 bit) Mach3, ESS, G540, Endurance Laser.

Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2539
    • View Profile
Re: Dimensioned Objects (polyline, circle, rectangle) plugin
« Reply #9 on: October 01, 2017, 18:35:48 pm »
Like Bubba, I try to invent tricks to snap or align to other objects with known dimensions. Often I edit directly points coordinates which with complex curves is a PITA. In this respect it is a real disadvantage that rectangles are referenced only by their lower left corner (missing the other corners and the center). Also, a constant display of object's or selection's extremas would be of great help.

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8648
    • View Profile
Re: Dimensioned Objects (polyline, circle, rectangle) plugin
« Reply #10 on: October 01, 2017, 18:45:27 pm »
Fly,
Although rectangles are defined by their lower-left corner, ANY corner of a rectangle can be grabbed for moving, and any corner will 'snap' to other features.

The Centroid plugin will give you a center-point, if you need one.  Yes, it would be nice if those features were 'built-in' characteristics of a rectangle, but the tools are there, nonetheless.

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

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5065
  • Made in England
    • View Profile
Re: Dimensioned Objects (polyline, circle, rectangle) plugin
« Reply #11 on: October 01, 2017, 18:53:10 pm »
Thanks for the replies, that's why I wrote this plugin, to make it a lot easier.
Filmed in Supermarionation

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5065
  • Made in England
    • View Profile
Re: Dimensioned Objects (polyline, circle, rectangle) plugin - UPDATE
« Reply #12 on: December 27, 2018, 19:17:29 pm »
New version attached to the first post in this thread.

I rewrote this plugin, it now handles polylines, circles and polyrectangles

No more messing about or guessing dimensions, enter the sizes as you draw. After using this plugin I rarely use CamBam's native methods for creating those objects.

Attached to the first post are;

Two versions, one for CamBam v0.9.8, one for CamBam v1.0
PDF Manual (I have reproduced most of the text here) PLEASE READ IT FIRST !

Dimensioned Polyline
-----------------------------
The first thing to say is; if you do not type any values into the user interface then the plugin will operate in a similar manner to CamBam’s native Polyline draw function.
i.e. Continue clicking points as desired, ‘Esc’ to reject the drawn polyline, ‘Enter’ to accept the draw polyline.

The user interface will display, “Enter First Point”, you should move the mouse cursor to the desired position then press the left mouse button.

The user interface will then display, “Length”, this is optional as previously explained, but if you do enter a value the following will occur;

If you drag the polyline ‘rubber band’ so that the line is LONGER than the value entered,

e.g. you enter 20 but you drag the line out to 30,

then that portion of the line from the previous point to the mouse cursor will change colour indicating the desired length.
Press the mouse left button to accept the line once you have positioned it as required.
Now continue on to the next point and so on or press ‘Enter’ to finish.

If you drag the polyline ‘rubber band’ so that the line is SHORTER than the value entered,

e.g. you enter 20 but you drag the line out to 15,

then the line will not change colour and pressing the mouse left button will accept the shorter line.
Now continue on to the next point and so on or press ‘Enter’ to finish.

Dimensioned Circle
--------------------------
The interface will display, “Enter circle centre point then type Diameter :”

1. Position the mouse cursor to the desired centre point of the circle then left mouse click, this will draw a ‘rubber band’ circle.
2. Type in the required diameter of the circle.
    Dragging the circle to a larger or smaller diameter has no effect on the end result.
3. Press ‘Enter’ or left click the mouse to accept the diameter entered.

Dimensioned Polyrectangle
------------------------------------
The first thing to say is; if you do not type any values into the user interface then the plugin will draw a Polyrectangle to points defined where the left mouse button was clicked. It takes three mouse clicks to complete a polyrectangle, First Point, Width, Height.

The interface will display, “Enter First Point”, you should move the mouse cursor to the desired position then press the left mouse button.

The user interface will then display, “Width ?:”, this is optional as previously explained, but if you do enter a value the following will occur;

e.g. a value of 20 is entered (Do not press ‘Enter’ after typing)

If the mouse cursor is to the LEFT of the first point then a rectangle of width 20 will be drawn to the LEFT
If the mouse cursor is to the RIGHT of the first point then a rectangle of width 20 will be drawn to the RIGHT

Click the mouse left button to accept the width or use ‘Backspace’ key to edit the entered value first.

The user interface will then display, “Height ?:”, this is optional as previously explained, but if you do enter a value the following will occur;

e.g. a value of 60 is entered (Do not press ‘Enter’ after typing)

If the mouse cursor is HIGHER than the first point then a rectangle of height 60 will be drawn ABOVE
If the mouse cursor is LOWER than the first point then a rectangle of height 60 will be drawn BELOW

Click the mouse left button to accept the height or use ‘Backspace’ key to edit the entered value first.

« Last Edit: December 27, 2018, 19:25:33 pm by EddyCurrent »
Filmed in Supermarionation

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5065
  • Made in England
    • View Profile
Re: Dimensioned Objects (polyline, circle, rectangle) plugin
« Reply #13 on: December 28, 2018, 11:07:37 am »
I forgot to mention that if you press the 'Shift' key while dragging a 'rubber band' line point around it will snap to the major angles of 90, 60, 45, 30 degrees.
Filmed in Supermarionation

Online dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6889
    • View Profile
    • Cambam V1.0 French Doc
Re: Dimensioned Objects (polyline, circle, rectangle) plugin
« Reply #14 on: January 16, 2019, 22:22:36 pm »
Hello Eddy

I get a translation problem with this plugin.

Each time a new value is entered ; it is added to the translation list. (pic 1)

Also the translation is applied for the first "enter width" but not for the second text that ask for the size. (pic2)

same for both width and height

++
David