Author Topic: [SOLVED]: Center lines for rectangles  (Read 5003 times)

Offline Mark81

  • Wookie
  • ****
  • Posts: 329
    • View Profile
[SOLVED]: Center lines for rectangles
« on: July 26, 2017, 11:39:51 am »
Hi! Is there a way (or a plugin) to automatically add the two lines that pass for the center of a rectangle?
Right now I'm doing to manually inspecting the corner points but it's time consumimng and if the rectangle is rotated it's not trivial...
« Last Edit: August 03, 2017, 16:30:36 pm by Mark81 »

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4933
    • View Profile
Re: Center lines for rectangles
« Reply #1 on: July 26, 2017, 12:34:12 pm »
Try this. Select the rectangle then; Draw->Pointlist->Extents
Snap to Objects will aid placement of the lines.

I've got the point now where I don't know if some menu items are native CamBam or plugins  :D

Edit: It only works if the rectangle has not been rotated   :P, it may be possible though to use the feature before rotation has occurred
« Last Edit: July 26, 2017, 12:41:37 pm by EddyCurrent »
Made in England

Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2519
    • View Profile
Re: Center lines for rectangles
« Reply #2 on: July 26, 2017, 12:42:00 pm »
Or use the Aligner plugin. I really can't imagine working in CamBam CAD without it. Logic is very simple - aligns the selected objects relative to the last selected one - minimum 2 object must be selected.
http://www.atelier-des-fougeres.fr/Cambam/Aide/Plugins/Aligner.html
« Last Edit: July 26, 2017, 12:43:49 pm by Dragonfly »

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4933
    • View Profile
Re: Center lines for rectangles
« Reply #3 on: July 26, 2017, 12:46:53 pm »
Or  :D

Explode the rectangle, select a side then; Draw->Point List->Divide Geometry (enter 3)
Do this for all sides then rejoin the rectangle, add the centre lines, delete the pointlists

That could likely be the basic of a script

Of course some extra Snap points would be better.
« Last Edit: July 26, 2017, 12:51:29 pm by EddyCurrent »
Made in England

Offline kvom

  • CNC Jedi
  • *****
  • Posts: 1608
    • View Profile
Re: Center lines for rectangles
« Reply #4 on: July 26, 2017, 14:21:14 pm »
One thing that many other CAD programs do is snap to the center of a line.  I use that feature a lot.

Offline Garyhlucas

  • CNC Jedi
  • *****
  • Posts: 1429
    • View Profile
Re: Center lines for rectangles
« Reply #5 on: July 26, 2017, 22:57:08 pm »
Also extremely useful in other CAD programs is snap midpoint of any two points. This works for line end points, circle centers etc.
Gary H. Lucas

Have you read my blog?
 http://a-little-business.blogspot.com/

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8593
    • View Profile
Re: Center lines for rectangles
« Reply #6 on: July 26, 2017, 22:59:16 pm »
What's the matter with just snapping to the corner apices of the rectangle, drawing diagonals, then marking the intersection?

What am I missing?

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

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6716
    • View Profile
    • Cambam V1.0 French Doc
Re: Center lines for rectangles
« Reply #7 on: July 26, 2017, 23:51:34 pm »
Or  :D

Explode the rectangle, select a side then; Draw->Point List->Divide Geometry (enter 3)
Do this for all sides then rejoin the rectangle, add the centre lines, delete the pointlists

That could likely be the basic of a script

Of course some extra Snap points would be better.

Hello

Just a variation ; after the rectangle as been exploded, select all lines then use Draw/points/centers to get a point in the middle of each line.

Quote
What am I missing?

I think Mark want the lines that divide the rectangle by 4 rectangles .. not the center (for the center, it's easy, just use Draw/points/center on the rectangle/polyline)

++
David

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4933
    • View Profile
Re: Center lines for rectangles
« Reply #8 on: July 27, 2017, 08:56:05 am »
« Last Edit: July 27, 2017, 21:32:21 pm by EddyCurrent »
Made in England

Offline Mark81

  • Wookie
  • ****
  • Posts: 329
    • View Profile
Re: Center lines for rectangles
« Reply #9 on: August 03, 2017, 16:22:45 pm »
Hi! I apologize for the delay. I will try the plugin as soon as possible and I will write back a comment. I thank you all very much!

Offline Mark81

  • Wookie
  • ****
  • Posts: 329
    • View Profile
Re: Center lines for rectangles
« Reply #10 on: August 03, 2017, 16:30:21 pm »
GREAT JOB!!!
Thank you very much!

Just to report: it works only in v0.9 for me (in 1.0 it says "error loading plugin centerlines.dll")

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6716
    • View Profile
    • Cambam V1.0 French Doc
Center lines for rectangles
« Reply #11 on: August 03, 2017, 16:57:10 pm »
Hello

Works for me on V1.0

Check if net framework 3.5 is installed/enabled on your Windows ; because the plugin works on 0.98, I guess it has been compiled with net 3.5

++
David
« Last Edit: August 03, 2017, 16:59:15 pm by dh42 »

Offline Mark81

  • Wookie
  • ****
  • Posts: 329
    • View Profile
Re: Center lines for rectangles
« Reply #12 on: August 03, 2017, 17:03:01 pm »
Check if net framework 3.5 is installed/enabled on your Windows ; because the plugin works on 0.98, I guess it has been compiled with net 3.5

That could be an issue because right now I've installed only .NET 1.1, 4.5.x and 4.6.x.
I will try to add also 3.5.

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4933
    • View Profile
Re: [SOLVED]: Center lines for rectangles
« Reply #13 on: August 05, 2017, 20:22:31 pm »
Well spotted David, yes I used .NET 3.5

@Mark81
attached the source files here; http://www.cambam.co.uk/forum/index.php?topic=6740.msg54799#msg54799
Made in England