Idea - Spacing dots along a line/path

This forum is for 'Work-in-Progress' QCAD user developed script Add Ons and Plug-ins.

Please use this forum to request/submit your script Add-Ons & Plug-in idea's.

Moderators: andrew, Husky, J-J

Sterling
Active Member
Posts: 27
Joined: Wed Nov 19, 2014 11:15 pm

Idea - Spacing dots along a line/path

Postby Sterling » Fri Dec 05, 2014 2:39 am

Howdy!

Would it be possible to create a function where I could draw an arc, circle or perhaps a line, and create 'Points' along it at a distance specifically set by the end-user?

As you can see in the images I am making points along a half-circle.
#1) For this, I have made an ARC at 180 degrees. Next I create a new layer; create a center point and draw lines out from the 'center' roughly drawn where I desire it, and then, to get more accurate, I type in the angle afterwards. I used to draw these on graph paper, and map the coordinates and hand-code the data I will do this for every point I need to make. (Something of a long process and prone to errors!).
DotsOnLine_.jpg
Multiple layers used to draw shapes, helping me line things up
DotsOnLine_.jpg (119.27 KiB) Viewed 9985 times


#2) When the other layers are hidden/removed, we have achieved points on an arc! (Note this is *not* the final outcome! This is a work-in-progress and I am just starting on it.) ;)
DotsOnLine_b.jpg
Arcs removed to see how it looks
DotsOnLine_b.jpg (59.92 KiB) Viewed 9985 times


Thanx for your time!
>>>Thanx!

~Sterl~

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 1937
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Idea - Spacing dots along a line/path

Postby Husky » Fri Dec 05, 2014 10:02 am

Howdy!

Sterling wrote:Would it be possible to create a function where I could draw an arc, circle or perhaps a line, and create 'Points' along it at a distance specifically set by the end-user?


Just curious ...
Question for Points on a line:
The tools "N Points on a Line" or "Move / Copy" will not suit what you are looking for?

Question for Points on an arc or circle:
Whats about the "Rotate" tool?
Example: Draw your arc - place on the end(?) a point - check the "Property Editor" to get the exact length of the arc - use this information in the Rotate dialog for a calculation.

In this example my arc length is 78.539816 and I like to have every 10 units along(!) the arc a point ...

Worldhusky-2014.12.05-01.png
Worldhusky-2014.12.05-01.png (2.07 KiB) Viewed 9966 times


Worldhusky-2014.12.05-02.png
Worldhusky-2014.12.05-02.png (24.19 KiB) Viewed 9966 times


Worldhusky-2014.12.05-03.png
Worldhusky-2014.12.05-03.png (3.13 KiB) Viewed 9966 times
Work smart, not hard: QCad Pro

User avatar
Clive
Moderator / Drawing Help
Posts: 1299
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: Idea - Spacing dots along a line/path

Postby Clive » Fri Dec 05, 2014 1:15 pm

Husky's idea is good for creating points at equal distances, however currently there is no tool to place points along an arc, line at varying distances. Maybe someone in the community will take up the challenge of developing such a tool, alternatively it might be worth considering to sponser Andrew to develop a tool if this would be worth your while :wink:.
For the best support please state your operating system, QCAD version and add any supporting DXF/DWG files, screenshots etc...

User avatar
Clive
Moderator / Drawing Help
Posts: 1299
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: Idea - Spacing dots along a line/path

Postby Clive » Fri Dec 05, 2014 2:40 pm

This may help.

Try placing your points using the snap to entity option and the snap distance option, if you know the distances between one end of your Arc, Circle, Spline etc. and the points in sequence, you can simply type them into the Snap distance field :wink:

Points along an Arc,Spline.png
Points along an Arc,Spline.png (29.45 KiB) Viewed 8539 times


*Note if you are placing points around a Circle using this method you will need to divide the Circle (Modify -Divide) into two arcs.
For the best support please state your operating system, QCAD version and add any supporting DXF/DWG files, screenshots etc...

User avatar
Clive
Moderator / Drawing Help
Posts: 1299
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: Idea - Spacing dots along a line/path

Postby Clive » Fri Dec 05, 2014 3:56 pm

Not to stretch the point too far (excuse the pun :)) here's a similar method to Husky's ... but more of a click and go method.


Equal distance points on Arc pic 1.png
Equal distance points on Arc pic 1.png (12.52 KiB) Viewed 8518 times


1. Set up required layers.

Equal distance points on Arc pic 2.png
Equal distance points on Arc pic 2.png (9.22 KiB) Viewed 8518 times


2.Working on layer 'Construction' copy with reference the Arc in question and paste to the 'current' layer (Construction).

Equal distance points on Arc pic 3.png
Equal distance points on Arc pic 3.png (27.85 KiB) Viewed 8518 times


3.Working only on layer Construction, split the Arc into required number of parts, remember to check the Green tick.

Equal distance points on Arc pic 4.png
Equal distance points on Arc pic 4.png (31.29 KiB) Viewed 8518 times


4.Now working on layer 'Point' place a point on either end of your Arc.

Equal distance points on Arc pic 5.png
Equal distance points on Arc pic 5.png (2.08 KiB) Viewed 8518 times


5. Use the Rotate tool and follow the prompt -Center - using the 'Snap to Center' option, snap to the arc's center.

Equal distance points on Arc pic 6.png
Equal distance points on Arc pic 6.png (35.33 KiB) Viewed 8518 times


6. The Rotate options dialog window opens, select Multiple, type in the number and hit the cursor button, this will allow you to use the mouse cursor to select the rotation angle.

Equal distance points on Arc pic 7.png
Equal distance points on Arc pic 7.png (16.3 KiB) Viewed 8518 times


7. Select the point as your reference.

Equal distance points on Arc pic 8.png
Equal distance points on Arc pic 8.png (9.59 KiB) Viewed 8518 times


8. Set the snap option to 'End' then snap to the nearest end point (your end points created from your divisions) from your reference point.

Equal distance points on Arc pic 9.png
Equal distance points on Arc pic 9.png (23.9 KiB) Viewed 8518 times


9 Turn on/off appropriate layers and job done :wink: .

Equal distance points on Arc pic 10.png
Equal distance points on Arc pic 10.png (5.09 KiB) Viewed 8518 times
For the best support please state your operating system, QCAD version and add any supporting DXF/DWG files, screenshots etc...

Sterling
Active Member
Posts: 27
Joined: Wed Nov 19, 2014 11:15 pm

Re: Idea - Spacing dots along a line/path

Postby Sterling » Fri Dec 05, 2014 4:24 pm

My history/reason for asking...FYI: I built a CNC machine, and am teaching myself elements of GCoding and CAD work. I've made this particular forum-request, because I am designing custom cribbage boards, and to make the peg-holes even on a curve is more difficult than I had realized.

#1) Husky –
- The "N points on a line" (command PN) are for straight lines, not an Arc.
- I am new to all of this and I think I understand your solution. I will give that a try. Thanx!

#2) Clive
– Wow, I think you give me too much credit, as your example went beyond my understanding! When I have some free time, I will certainly give that a try, and hopes it expands my knowledge of the software, Thanx!
>>>Thanx!

~Sterl~

Sterling
Active Member
Posts: 27
Joined: Wed Nov 19, 2014 11:15 pm

Re: Idea - Spacing dots along a line/path

Postby Sterling » Fri Dec 05, 2014 5:10 pm

Hmm... Husky's solution doesn't seem to work for me. Did I misunderstand?

Steps Taken:
#1) I created an ARC using "2 points and Angle" (A2)
#2) Property editor states the arc is 180 degrees with a length of 5.885146
#3) I place a "Single Point" (PO) at the end of the arc.
#4) I then highlight the single point, and select "Rotate" from the menu above (R,O)
#5) I entered the formula but nothing happened. (tried this several times)
...
The only way I seem able to get the points to appear ON THE ARC (where I want them) is to...
#1 - #3) As above
#4) Using the center coordinates of the Arc from the Property window, make a Point in the center.
#5) Selected the End Point of the Arc,
#6) Selected Rotate
#7) Select the Center Point; When the Rotate Options window appears enter the formula & press [Okay].
...The points appear 360 degrees around the center point. (half on the arc, half below, completing the circle).
- I have tried to double and half the division number at the end to see if it gives me what I need; if the points appear all the way around, I could simply delete the unwanted points.

I'll think and play with it some more. This is MORE progress than what I had before, Thanx!
>>>Thanx!

~Sterl~

Sterling
Active Member
Posts: 27
Joined: Wed Nov 19, 2014 11:15 pm

Re: Idea - Spacing dots along a line/path

Postby Sterling » Fri Dec 05, 2014 5:47 pm

Clive -
Your "Snap on Entity" using the Distance measurement seems to be working, thanx!
...It looks a little weird, but I suspect that is my failure to accurately perform math functions! ;)
>>>Thanx!

~Sterl~

User avatar
Clive
Moderator / Drawing Help
Posts: 1299
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: Idea - Spacing dots along a line/path

Postby Clive » Fri Dec 05, 2014 6:16 pm

Sterling wrote:Clive -
Your "Snap on Entity" using the Distance measurement seems to be working, thanx!
...It looks a little weird, but I suspect that is my failure to accurately perform math functions! ;)


Okay, good, you just have to remember that the distance entered is the distance from the end point of the arc/entity to the most recent point you need to place - so for example if you need to place a set of points along a line starting with the first point at a distance of say 13.56 then the next at an interval of 10 units, you would proceed as follows:
1.First point distance -type 13.56.
2.Next point distance - type 23.56 and so on ...

This method will suit if you are placing points at equal or unequal spacing!
For the best support please state your operating system, QCAD version and add any supporting DXF/DWG files, screenshots etc...

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 1937
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Idea - Spacing dots along a line/path

Postby Husky » Fri Dec 05, 2014 8:33 pm

Sterling wrote:Hmm... Husky's solution doesn't seem to work for me. Did I misunderstand?

Steps Taken:
#1) I created an ARC using "2 points and Angle" (A2)
#2) Property editor states the arc is 180 degrees with a length of 5.885146
#3) I place a "Single Point" (PO) at the end of the arc.
#4) I then highlight the single point, and select "Rotate" from the menu above (R,O)


#1 - #4 is already correct ...

... the next steps would be:
#5) The rotate tool needs a reference point for the rotation - snap to the center point of the arc.

Worldhusky-2014.12.05-02.png
Worldhusky-2014.12.05-02.png (49.1 KiB) Viewed 9386 times


#6) Now the rotate dialog pops up - use a formula similar to this "180/58.590703*10".
180 = degree of the arc
58.590703 = the length of the arc (taken from the property editor)
10 = desired(?) distance along the arc

Worldhusky-2014.12.05-03.png
Worldhusky-2014.12.05-03.png (88.6 KiB) Viewed 9386 times


Don't forget to tell the tool how many copies do you need - in my example 5. :wink:

Result:

Worldhusky-2014.12.05-04.png
Worldhusky-2014.12.05-04.png (1.99 KiB) Viewed 9386 times


Is it now, with this explanation, working for you?

Edit:
I forgot - if you need to rotate in the other direction .... "-(180/58.590703*10)" :wink:
Work smart, not hard: QCad Pro

Sterling
Active Member
Posts: 27
Joined: Wed Nov 19, 2014 11:15 pm

Re: Idea - Spacing dots along a line/path

Postby Sterling » Fri Dec 05, 2014 11:38 pm

Thanx, Husky, I'll give that a try.
For some reason, when I tried the second (inner) path using Clive's method something went awry. :/
And yes, I double checked my numbers and did all the math in an excel spread sheet to so I had all the required distance marks in place. But...it didn't seem to line up properly to me. (The points represent peg-holes for a cribbage board)

In the image, you can see the PINK and White points make a nice arcs, half of what I need, however they are still a bit off.
- The White points do not line up between the center-point and their corresponding point on the outside.
- The Pink point on the top doesn't line up perfectly with the green center-line like the white one does.
- The spacing isn't quite right yet either. The outside bottom white point is the last hole in the prior series of 5 peg holes. So, that being the last spot before the next series of '5', where the turn begins, I need to delete the first and last pink point.
...I'm not sure why. It might be that I shortened the number used for measuring the distance points. The coordinates initially came back with 6+ digits to the right of the decimal, but I shortened them to 3, thinking anything beyond that probably wouldn't matter. (I'll try to re-do it all again tonight and see if I get different results.)

My rational behind this (If you play cribbage you will understand, if not I can whip up another JPG to upload)
#1) I needed 10 points to drill across an this 180 arc. To ensure that they would be evenly spaced for this curve, I thought I would need 13 points. 10 points for the peg-holes, and 3 points to mark the spacing between the series of 5 = [space] + [5points] + [space] + [5points] + [space].

...but (shrugs) it didn't come out the way I thought.
need to and I need to adjust the spacing so there are 5 evenly distributed holes (points) between that and the green center line.

DotsOnLine_c.jpg
DotsOnLine_c.jpg (107.98 KiB) Viewed 9288 times
>>>Thanx!

~Sterl~

Sterling
Active Member
Posts: 27
Joined: Wed Nov 19, 2014 11:15 pm

Re: Idea - Spacing dots along a line/path

Postby Sterling » Sat Dec 06, 2014 1:45 am

Howdy gents...
I regret to inform you that I am still not getting the job done. Husky, I have tried your method, and here is what I did... Step-By-Step

#1) Made two paths for the cribbage holes, where the arcs will meet, outer-to-outer, and inner-to-inner.
1.jpg
1.jpg (167.32 KiB) Viewed 9274 times


#2) Using 2 Points and Angle to make the ARC
2.jpg
2.jpg (101.04 KiB) Viewed 9274 times
3.jpg
3.jpg (136.81 KiB) Viewed 9274 times


#3) Length of the ARC = 5.885146 (also has Center point of X3 Y1.9375)
4.jpg
4.jpg (151.92 KiB) Viewed 9274 times


#4) Make Center point at X3 Y1.9375
5.jpg
5.jpg (52.94 KiB) Viewed 9274 times
6.jpg
6.jpg (95.97 KiB) Viewed 9274 times


#5) Point on the end of the arc has been selected, then I chose Rotate from the menu options.
7.jpg
7.jpg (98.91 KiB) Viewed 9274 times


#6) Clicking on the center point, then in Rotate Options window, place in math and number of points needed. I needed 13 points to create 10* peg holes.
Here is the input:
8.jpg
8.jpg (78.24 KiB) Viewed 9274 times


#7) Unfortunately, it did not work. As you can see, the dots went ALL THE WAY AROUND. :/
9.jpg
9.jpg (33.15 KiB) Viewed 9274 times


* Here is why I wanted 13 points for 10 holes...(Again, I do not know if you know how to play, so I feel compelled to ensure accuracy here!)
Holes on a cribbage board are evenly drilled in sets of 5-per-player (thus 10 holes because it's 2 player! :) ) with a space between each set that is approximately double between the holes. So, by making the space between every point the same, all I would need to do, is delete every 6th point and I would get series of 5! This image is of cribbage board I made for someone out of hardwood flooring. The holes are not 100% precise, but they are very close and as you can see there are 6 sets of 5.
Example.jpg
Example.jpg (185.96 KiB) Viewed 9274 times


So, I'm not sure what to do here and I apologize greatly if I am making a mistake that I do not see...!
>>>Thanx!

~Sterl~

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 1937
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Idea - Spacing dots along a line/path

Postby Husky » Sat Dec 06, 2014 3:05 am

Howdy gentleman,

Sterling wrote:#4) Make Center point at X3 Y1.9375


Forget to MAKE a center point by yourself! You don't need to do that! Yes - it's right that the Rotate tool is asking for a reference point - and in this case it has to be the center of the arc but you can easily pick this center point with an automatic snap.
The work order would be:
1. Start the rotation tool
2. Choose the snap point CENTER tool,
3. Click with the mouse on the arc - and you will see that the reference point will be placed directly on the center of the arc ... :wink:

This is what I'm talking about:

Worldhusky-2014.12.05-01.png
Worldhusky-2014.12.05-01.png (25.64 KiB) Viewed 9367 times





But - honestly - I don't understand why you have to work with distances on the arc. To make it correct you have always to calculate the radius for the arc before you draw it - otherwise it will never suit both criteria - distance and number of holes ...
I would just work with angles ... :shock:

Please do me a favor. Attach your dxf file with this two paths example and tell me exactly how many holes do you need on this 180° arc.
I like to show you my solution for this problem, ok?
Work smart, not hard: QCad Pro

Sterling
Active Member
Posts: 27
Joined: Wed Nov 19, 2014 11:15 pm

Re: Idea - Spacing dots along a line/path

Postby Sterling » Mon Dec 08, 2014 6:04 am

Howdy -

So, to further expand my situation (and try to learn), i have discovered that making these points on an Arc is different than trying to make them along a shape that was drawn by a bunch of short lines.
To clarify - I have drawn an apple (for a school teacher - not the electronics corporation), and I want to intersperse it with points. I used the "Line From Two Points" tool (LI), to draw it, and now I have approximately 60 straight lines that make up the apple.
In reviewing what has been posted earlier, It seems to me that CLIVE'S options might work=
Clive wrote:This may help.

Try placing your points using the snap to entity option and the snap distance option, if you know the distances between one end of your Arc, Circle, Spline etc. and the points in sequence, you can simply type them into the Snap distance field :wink:

Points along an Arc,Spline.png


*Note if you are placing points around a Circle using this method you will need to divide the Circle (Modify -Divide) into two arcs.


(Heh-heh) I'm sure you gents already knew that it wasn't going to work out~!

As I sift through the 'Help' file, I realize I'm not educated on this. I'm not coming up with something that I could understand. Is there a "Merge" or "Join" function that would bring all the line segments together so I can use Clive's process? Or not? Have I unwittingly created an entirely different situation?

Once again...thanx in advance for your time!

In confusion...

~Sterl~

User avatar
Clive
Moderator / Drawing Help
Posts: 1299
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: Idea - Spacing dots along a line/path

Postby Clive » Mon Dec 08, 2014 10:58 am

Sterling wrote:As I sift through the 'Help' file, I realize I'm not educated on this. I'm not coming up with something that I could understand. Is there a "Merge" or "Join" function that would bring all the line segments together


You can create a continuous Polyline from seperate line, arc segments, use the-
Draw > Polyline > 'Craete from Segments' command.

Create Polyline from segments.png
Create Polyline from segments.png (3.62 KiB) Viewed 8583 times
For the best support please state your operating system, QCAD version and add any supporting DXF/DWG files, screenshots etc...


Return to “QCAD 'Script Add-On & Plug-in challenge' - Work in Progress”

Who is online

Users browsing this forum: No registered users and 1 guest