Create new lines between two exsisting lines spaced based on slope

Create new lines between two exsisting lines spaced based on slope

christopher.l.evans
Advocate Advocate
1,161 Views
6 Replies
Message 1 of 7

Create new lines between two exsisting lines spaced based on slope

christopher.l.evans
Advocate
Advocate

Is there an existing lisp that will create a number of lines between two lines with equal distances?  The lines are not straight they are curved and have varying widths between them because of differences in slope,.  They are polylines with quadratic smoothing applied.

 

So I have topo lines that represent 5 foot increments.  I need to create 4 lines, in this case, between each set of topo lines to represent foot increments.  I need the distance between these new lines to vary and be equally spaced based on the slope between the original two lines.  This is survey data imported from 30+ year old blue prints.

 

Anyone know of a lisp that might fit this???

0 Likes
1,162 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
 
0 Likes
Message 3 of 7

Anonymous
Not applicable

I don't have access to program I wrote years ago, but here is synopsis -

 

Select 1st line "Line#1"

Save last entity in drawing

Divide Line#1 into set number of points, saving coordinates to a List#1 [example = (setq List#1 (list P1-1 P1-2 etc.)]

Save last entity in drawing

Divide Line#2 into set number of points, saving coordinates to a List#2 [example = (setq List#2 (list P2-1 P2-2 etc.)]

Foreach each pair of points (example P1-1 and P2-1), create 4 new equal distance points (save coordinates to List#3)

[example = (setq List#3 (list (list P3-1 P3-2 etc) (list P4-1 P4-2 etc) (list P5-1 P5-2 etc) (list P6-1 P6-2 etc)))

Create a line from the (nth 0 of each group of points in List#3 = P3

Create a line from the (nth 1 of each group of points in List#3 = P4

repeat for P5 & P6

 

I hope that is clearer than mud.

 

 

Autocad_contours.png

Message 4 of 7

christopher.l.evans
Advocate
Advocate

That seems pretty clear.  I already have points on the existing lines, however the line higher on the slope will be shorter having less points.  Right now they are in the 1700-1900 foot range in length should I break it down to trying to do 100 foot lengths?  Otherwise there's several hundred or thousands of points just on one line.  I haven't worked with an extreme amount of points in a lisp like that so I don't know if it will cause issues.

0 Likes
Message 5 of 7

Kent1Cooper
Consultant
Consultant

@christopher.l.evans wrote:

....  I already have points on the existing lines, however the line higher on the slope will be shorter having less points.  .... should I break it down to trying to do 100 foot lengths?  Otherwise there's several hundred or thousands of points just on one line. ....


I ran across the same issue in a recent effort about averaging multiple Splines into one -- different quantities of fit points and/or control points were a problem for the approach I took.  What you want would need to be done by finding an equal number of presumably equally-spaced portions [equivalent to what Divide does, but saving the locations rather than placing Points or Blocks].

 

One thing that might get you started is WobblyPline.lsp with its WPL command, here.  Use the EXisting-object option to select a contour, tell it to Retain the original, and tell it how many segments [regardless of the number of segments in the original] you want it divided into.  If you ask for zero randomization of the points, it will make a Polyline of all line segments dividing your original contour [which can be of any kind of entity with linearity] into the number of segments you want, of equal along-the-original lengths, with all vertices lying on the original.  Do that to two of them, and you'll have Polylines with the same number of vertices to use as a basis for mracad's suggested approach, regardless of the comparative lengths or numbers of vertices of the original objects.

 

WobblyPline's code elements that determine those locations along the object could certainly be extracted and altered to save those locations into a list variable, instead of drawing a Polyline, to get a step closer to what mracad suggests.  I don't think the rest of it would be too complicated to work out.

Kent Cooper, AIA
0 Likes
Message 6 of 7

Anonymous
Not applicable
This can create a large list of points, however with today's computers it shouldn't be a problem.
Several things to consider -
Get the length of the line and calculate an appropriate number of divide points.
Or you can get the vertexes of the points instead of using divide.
0 Likes
Message 7 of 7

stevor
Collaborator
Collaborator

A possible start would be my 'Topo Tweener'

at  http://www.auscadd.com/free-lsp-2.html

with some of its subroutines on that page,

and some on:

http://www.auscadd.com/free-lsp-2.html

 

 

S
0 Likes