Jump to content

Recommended Posts

Posted

Hi guys

 

I would love a lisp that could create a boundary around a topo survey extent, using the outermost data to create it. Would this be possible? I have attached an example topo we have.

 

Thanks in advance

topo.jpg

  • Replies 23
  • Created
  • Last Reply

Top Posters In This Topic

  • marko_ribar

    6

  • bigmaz

    6

  • Lee Mac

    5

  • GP_

    3

Top Posters In This Topic

Posted Images

Posted

What program was the topo contoured/triangulated in? If you have access to that it will almost certainly be able to create the boundary around the data.

Posted
What program was the topo contoured/triangulated in? If you have access to that it will almost certainly be able to create the boundary around the data.

 

This is topo recieved from the surveyor, with Contours, points etc. I can create a surface with Civil 3D, but it will triangulate between the gaps, which I do not want. So instead of manually drawing a border around the topo, I thought it would be great if there was a lisp that would do it for me.

Posted
This is topo recieved from the surveyor, with Contours, points etc...

 

Without DTM?

Posted

A boundary may already exist. Did you ask the surveyor to include it?

Posted

There is no border at all. Could what I asked for be done with a lisp?

Posted
...Could what I asked for be done with a lisp?

 

Yes, if there is a DTM (3Dfaces triangular), but you can also quickly in AutoCAD: Copy 3Dfaces -> Flatten -> Region -> Union

Posted

Ok, so it cannot be done at all using the extents of the topo survey, points, contours, lines etc?

 

I want the boundary so I can bring it into the Civil 3D model of the existing ground, so I can clip the triangulation to the border. Shrinkwrap just isnt working well. So hence why I am asking. The only other way is to manually draw a polyline around the extent of the topo.

Posted

I don't know why the method GP_ proposed isn't working, can you elaborate? Another approach that comes to my mind is to project points to 0 elevation and use Convex Hull algorithm to draw boundary around points... I think you can find Convex Hull algorithm on www.lee-mac.com under subfunctions section...

 

M.R.

Posted
I don't know why the method GP_ proposed isn't working, can you elaborate? Another approach that comes to my mind is to project points to 0 elevation and use Convex Hull algorithm to draw boundary around points... I think you can find Convex Hull algorithm on www.lee-mac.com under subfunctions section...

 

M.R.

 

Because it isnt DTM....... As I keep saying, it is a topographical survey. Do you guys know what a topographical survey is?

 

Thanks, i'll have a look at the lisp you mentioned :)

Posted
Another approach that comes to my mind is to project points to 0 elevation and use Convex Hull algorithm to draw boundary around points... I think you can find Convex Hull algorithm on www.lee-mac.com under subfunctions section...

 

I'm afraid the Convex Hull is not suitable for this task, since the result will be a convex polygon (as the name implies), and hence will not outline the concave areas of the survey. Thank you for the recommendation however.

Posted
Because it isnt DTM

 

Exactly ... DTM works fine by me.

 

 

@Marko

I also thought of "Convex Hull" by Lee Mac, but is not suitable

 

366.jpg

 

 

 

Oops...

Hi Lee

We posted at the same time

Posted

Lee, do you know if what I want is possible with a lisp routine?

Posted
Lee, do you know if what I want is possible with a lisp routine?

 

Having examined your example image, at this point I would be inclined to say that this task would be very difficult to accomplish. If the endpoints of the contours always extended to the boundary, with the space between any two contours not exceeding the width of the area to be outlined, one could retrieve a set of such endpoints and use a suitable algorithm to join points by minimising the distance between any pair; however, I see from your graphic that the boundary consists of both contours and individual point entities, so this method would fail in places. Removing all assumptions we are simply left with a very large set of coordinates: such a set could be reordered and joined in almost infinitely many ways.

Posted
Because it isnt DTM....... As I keep saying, it is a topographical survey. Do you guys know what a topographical survey is?

 

You can segment contours with many points you like and them apply DTM or triangulate by ElpanovEvgeniy, then you'll get triangular area with 3dfaces => flatten them (entmod verticies that each z coordinate becomes 0.0) => region (select all 3dfaces) => union => extract edges and make contour LWPOLYLINE with explode => join line segments...

 

M.R.

 

Triangulate by Elpanov E :

http://www.cadtutor.net/forum/showthread.php?68348-points-density-dense.lsp-overlapping-points-and-speed-issue/page3&p=#24

Posted
As I keep saying, it is a topographical survey. Do you guys know what a topographical survey is?

 

There are some on the forum who know what a topographical survey is, but surveyors do not survey along contour lines. They create a DTM with the site data in order to draw the contours. Somewhere in the process of producing the drawing that you get, there has been a DTM and some intermediate data that the surveyor chooses not to pass on.

 

Your response to my question in post #5 was very quick, and I did wonder whether you had actually asked the question of the surveyor.

Posted (edited)

Anyway, if DTM can't be obtained from surveyor, I suggest you use these two simple routines with above link for creating DTM - triangulation :

 

(vl-load-com)
(defun c:segcurves ( / msp ss seg ch n ent stpar enpar k pt ptlst )
 (setq msp (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))))
 (prompt "\nSelect curves to apply segmentation with point entities")
 (while (not ss)
   (setq ss (ssget ":L" '((0 . "*LINE,ELLIPSE,ARC,CIRCLE"))))
 )
 (initget 7)
 (setq seg (getint "\nType number of segments inbetween points for segmentation per single curve : "))
 (initget "Yes No")
 (setq ch (getkword "\nDo you want to keep curves (Yes) or do you want to remove them after segmentation (No) <Yes> : "))
 (repeat (setq n (sslength ss))
   (setq ent (ssname ss (setq n (1- n))))
   (setq stpar (vlax-curve-getstartparam ent))
   (setq enpar (vlax-curve-getendparam ent))
   (setq k -1)
   (repeat seg
     (setq pt (vlax-curve-getpointatparam ent (+ stpar (* (- enpar stpar) (/ (setq k (1+ k)) seg 1.0)))))
     (setq ptlst (cons pt ptlst))
   )
   (setq ptlst (cons (vlax-curve-getendpoint ent) ptlst))
   (foreach pt ptlst
     (vla-addpoint msp (vlax-3d-point pt))
   )
   (setq ptlst nil)
   (if (eq ch "No")
     (entdel ent)
   )
 )
 (princ)
)

and after you create DTM with ee-triangulate.lsp or DTM.vlx witch may in some cases fail, you flatten 3dfaces :

 

(defun trunc (expr lst)
 (if (and lst
   (not (equal (car lst) expr))
     )
   (cons (car lst) (trunc expr (cdr lst)))
 )
)
(defun c:flatten3dfaces ( / ss n ent p1 p2 p3 p4 preflst midlst sufflst )
 (prompt "\nSelect 3dfaces")
 (while (not ss)
   (setq ss (ssget ":L" '((0 . "3DFACE"))))
 )
 (repeat (setq n (sslength ss))
   (setq ent (ssname ss (setq n (1- n))))
   (setq p1 (cdr (assoc 10 (entget ent))))
   (setq p2 (cdr (assoc 11 (entget ent))))
   (setq p3 (cdr (assoc 12 (entget ent))))
   (setq p4 (cdr (assoc 13 (entget ent))))
   (setq p1 (list (car p1) (cadr p1) 0.0))
   (setq p2 (list (car p2) (cadr p2) 0.0))
   (setq p3 (list (car p3) (cadr p3) 0.0))
   (setq p4 (list (car p4) (cadr p4) 0.0))
   (setq preflst (trunc (assoc 10 (entget ent)) (entget ent)))
   (setq sufflst (cdr (member (assoc 13 (entget ent)) (entget ent))))
   (setq midlst (list (cons 10 p1) (cons 11 p2) (cons 12 p3) (cons 13 p4)))
   (entmod (append preflst midlst sufflst))
 )
 (princ)
)

And then create regions (command "REGION") select all 3dfaces (look in filter in my code to obtain with (ssget)) - or go to quickselect and filter 3dface objects... => regions created => union , again filter for region objects and => single region created => explode => pedit (previous selection - what was exploded) - join and LWPOLYLINE that represent boundary is created...

 

Hope this helps...

M.R.

Edited by marko_ribar
Posted

Yes, Gile wrote it, so what now... I should retype it like I wrote it... You gave the source and I think this is acceptable for tracking... I think that Gile posted his functions on website to be used and think he won't mind if I used his subfunction...

 

M.R.

Posted
Yes, Gile wrote it, so what now... I should retype it like I wrote it... You gave the source and I think this is acceptable for tracking... I think that Gile posted his functions on website to be used and think he won't mind if I used his subfunction...

 

If you are using code that is not your own, it is common courtesy to include accreditation to the original author. Your point about the link being 'acceptable for tracking' is invalid, as, had I not refuted the origin of the function, the code would be assumed to be your own. In any case, why would you intentionally remove the original code header and author?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...