Author Topic: Triangulation (re-visited)  (Read 312792 times)

0 Members and 1 Guest are viewing this topic.

ymg

  • Guest
Re: Triangulation (re-visited)
« Reply #465 on: November 16, 2015, 09:40:25 PM »
Here is Triang V0.6.5.5

Finally got around to fix the bug in Contour generation.

Also fixed another one, where we could get into an endless loop
when clearing holes in the triangulation.

Sorry about the delay.

ymg

TopoWAR

  • Newt
  • Posts: 135
Re: Triangulation (re-visited)
« Reply #466 on: November 17, 2015, 10:27:40 AM »
YMG , Thank you for your work in this routine, very grateful !!! :-D :-D
Thanks for help

ymg

  • Guest
Re: Triangulation (re-visited)
« Reply #467 on: November 17, 2015, 01:25:48 PM »
TopoWar,

The fix creates the contour 0.001 unit lower than it should when we
have a summit that is right on a contour interval.

Would appreciate feedback if you test it.

ymg

TopoWAR

  • Newt
  • Posts: 135
Re: Triangulation (re-visited)
« Reply #468 on: November 17, 2015, 02:49:46 PM »
YMG , Hello, I've done some tests, the above error is gone, but I found an error I've seen for a long time, the routine creates a bad triangle, the point of the triangle 2 3 4 is in the same direction, this occasions that by making the curves generating an error, this routine may well, the wrong triangle is created to be a point in the middle of a line, it is assumed that the user should not do this, but few would know, in order see dwg, in previous versions I had made a function that eliminated the triangles where the angle was the same between the vertices 2-3 3-4. Thanks and I hope comments.

run c: cont interval 0.25, returns error at the wrong triangle
Code: [Select]
see entity (handent "733b")
« Last Edit: November 17, 2015, 02:59:40 PM by TopoWAR »
Thanks for help

pedroantonio

  • Guest
Re: Triangulation (re-visited)
« Reply #469 on: November 17, 2015, 03:02:13 PM »
Hi TopoWAR your breaklines is not correct .Look the attach file and you will understand.

TopoWAR

  • Newt
  • Posts: 135
Re: Triangulation (re-visited)
« Reply #470 on: November 17, 2015, 03:10:06 PM »
Topographer ,You are right, I know the lines are wrong, the question is, how many people know that the lines are not done well? for example, a client sent me the file so that you do the corners, had thousands of lines, the routine did not work, I had to start investigating where the error occurred, what I say is: is there any way that the user know that that line break this bad?
Thanks for help

ymg

  • Guest
Re: Triangulation (re-visited)
« Reply #471 on: November 17, 2015, 07:10:16 PM »
TopoWar,

I will see what I can do to prevent this.

However, bear in mind that there always wiil be a way to
come up with something that will make it go wrong.

We are working with real number, hence finite precision.

Your example drawing is as bad as it gets.

However It did help in finding a few bugs. :oops:

ymg

TopoWAR

  • Newt
  • Posts: 135
Re: Triangulation (re-visited)
« Reply #472 on: November 17, 2015, 07:15:57 PM »
I understand, at some point I had solved the problem with the following code in previous versions.

Code: [Select]
(setq n_tl nil)
(foreach temp tl
      (setq p1 (list (car (nth 0 temp)) (cadr (nth 0 temp)))
    p2 (list (car (nth 1 temp)) (cadr (nth 1 temp)))
    p3 (list (car (nth 2 temp)) (cadr (nth 2 temp))))
      (if (or (equal p1 p2 0.0001) (equal p2 p3 0.0001))
()
(setq n_tl (cons temp n_tl))))
         (setq tl n_tl)
Thanks for help

pedroantonio

  • Guest
Re: Triangulation (re-visited)
« Reply #473 on: November 18, 2015, 01:27:49 AM »
Hi and forgive me but i know that the reason we use the breaklines is to help the program to understand what really happened in the field. So we add this break lines to draw the TINS correct. If we add wrong breaklines i don't know how the program  will understand that and fix it or alert us. The program can not know what we have measured outhere (in the field).It is our responsibility to add the  break lines  correct. If my friend TopoWar change the break lines in the drawing he will take other TINS for the same points. It was just a thought

Quote
how many people know that the lines are not done well? for example, a client sent me the file so that you do the corners, had thousands of lines, the routine did not work, I had to start investigating where the error occurred, what I say is: is there any way that the user know that that line break this bad?

I understand that. I also have clients who can not draw on autocad and i know topographers who do not use breaklines and there terrain models are complitely wrong. I was working to a topographer before some years  and he use Land Development 2002 to make the terrain model.For break lines he add a polyline and then change the polyline level to 0. He thought that his break lines are correct, but there are all wrong. After some time met another topographer and explain me  the correct way how to do the breaklines. He told me to add line from point to point because the line have other elevetion to the beginning and other elevetion to the end. And i have to pick all the points one -one. For that time i never trust any terrain model because the most clients don't know how to do it correct. They believe that thay will buy a programm and then  select all the points and BOOM Magic !!! :-D

Thanks
« Last Edit: November 18, 2015, 01:49:49 AM by Topographer »

TopoWAR

  • Newt
  • Posts: 135
Re: Triangulation (re-visited)
« Reply #474 on: November 18, 2015, 10:29:33 AM »
Hi, I know you are right, I'll make a little guide to how you should make the breaklines, which are point-to-point logically, this for people who do not know, the routine works perfectly to thank you for the effort all !!!! Cheers!!!! :-D
Thanks for help

ymg

  • Guest
Re: Triangulation (re-visited)
« Reply #475 on: November 18, 2015, 09:37:18 PM »
Found a bug in the c:prof function of Triang V06.5.5

Here is correction.

Starting work on Cross Sections

ymg

rw2691

  • Newt
  • Posts: 133
Re: Triangulation (re-visited)
« Reply #476 on: November 24, 2015, 10:45:49 AM »
YMG,

I am late to your project, but I have installed your program and tried to use it. I am very impressed with what you have been able to do. I can't believe you have done it with Lisp, and that it is a small code.

There are a few features, however, that I think could be improved. Building a TIN captures the point nodes and moves them to its own layer, "Point Natural Ground." That means that the nodes that the user has created (usually on a special layer of his own) are gone. It would be better if you simply copied them... or require that we "Import Points" by your own routine. That way the user would still have his own data that are separate from your own.

On account of some points being bogus by elevation (such as being at 0.0 or 99999.0), it would be useful to have maximum and minimum settings where your code would ignore them when building a TIN. Points like that always slip in when gathering them by actual field work.

Flipping a TIN is usually done after you look at the contours. I think there should be a way to regenerate the contours (ie. by the routine erasing the existing ones first).

Points are usually selected by Windowing them, and many are caught that aren't valid. The result is that bogus TIN's get built. As is, I have to snoop around and delete them before doing the Contours. Usually they aren't so easy to notice, and I end up with bad contours. Perhaps there could be a setting to not create a TIN that has a side that exceeds a certain distance.

Another way, which I expect is more difficult, is to have Boundary lines as a perimeter (which are similar to Break lines for the TIN) but function as an irregular window where TIN's cannot be built outside of it. I expect that this is too much to ask for.

Something more I want to suggest... All of your private functions should be named uniquely. Such as instead of "rtd", make it "ymg-rtd", because others may have their own "rtd" and it could function differently from yours. The same, if you have any globals, they should have prefixed names as well for the same reason.

I have to say again... This is a hot code! I think I am going to be using it for my survey work (and I hope you don't mind). Your code is far more than a simple academic exorcise. It is worthy of being applied to work. As for myself, generating a TIN system has always been beyond my programming capabilities. Integrating the TIN's with breaklines is what has always snagged me. That you have done so with such elegance is simply fantastic.

Rick
« Last Edit: November 26, 2015, 07:59:51 AM by rw2691 »
Hippocrates (400BC), "Life is short, craft long, opportunity fleeting, experiment treacherous, judgment difficult."

ymg

  • Guest
Re: Triangulation (re-visited)
« Reply #477 on: November 24, 2015, 12:15:35 PM »
Rick,

First thanks for your constructive comments.

On the points being sent to a layer, I more or less agree with you.
Original data, could be preserved.  However having points in a
lot of different layers is not a good idea either.  As it is you could triangulate
and leave the point where they were. The only function that would be affected
is c:tog that permits you to toggle layers on or off.

Filtering of the data for duplicates, and bogus elevation takes time.
At the moment only duplicates are filtered out.  As with any filtering
the problem is establishing the criteria.

If you erase manually the preliminary contour after flipping,
you can execute c:cont , select the 3dface and get the contour
updated.  Alternatively a small function could be written to do it,
or added at enf of flip routine.

If you want to trianguate and have more than one surfaces living in
drawing, some discipline needs to be exercised on which entities are
in the drawing.  Your previous example of bogus point should already
be filtered in the field.

Boundary  lines during implementation during triangulation would
probably slow thing down a lot.  Have you tried function "c:Xshape"
which erodes the outside of the tin and remove unneeded triangle.

The private function issue:  What need to be done is to localized the function
thus returning them to nil on completion.
I am totally allergic to the concept of having an initial prefix on function name.


Thanks again for constructive comments and suggestions.
Will probably act on some of them.

ymg

rw2691

  • Newt
  • Posts: 133
Re: Triangulation (re-visited)
« Reply #478 on: November 25, 2015, 01:29:18 PM »
YMG,

I tried XSHAPE. At some point it always deleted too many TIN's, and its actions seem random.

I tried setting a 3dpoly around the perimeter, but it deleted the poly when it built the TIN's, and its actions did not regard it as a breakline.

I changed the poly to line segments, and the XSHAPE still deleted too many TIN's (those being inside the perimter).

My only resort was to manually delete the exterior TIN's, and not use XSHAPE. Since the breaklines were another color I could tell what I should delete.

I still think it would be effective for the TIN to erase all TIN's that have a side that is too long. The down side is that a TIN that meets that condition could be inside the net.

But Topo's always have a concentration of usable points that are within a certain distance. Usually at around 50'. Allowing the user to set a parameter by the TIN query (perhaps 75' or 100') would eliminate most of the bogus TIN's, so long as the points were collected with consistency.

I like that your program keeps the breaklines above the TIN. That allows me to easily see where something might be wrong with how the TIN's connect with each other.

Rick
« Last Edit: November 26, 2015, 07:52:50 AM by rw2691 »
Hippocrates (400BC), "Life is short, craft long, opportunity fleeting, experiment treacherous, judgment difficult."

rw2691

  • Newt
  • Posts: 133
Re: Triangulation (re-visited)
« Reply #479 on: November 25, 2015, 02:07:21 PM »
YMG

Do you have to create a Voronoi net for the program to use the Voronoi principle? Or is the Voronoi net only demonstrational?

Rick
« Last Edit: November 26, 2015, 07:56:25 AM by rw2691 »
Hippocrates (400BC), "Life is short, craft long, opportunity fleeting, experiment treacherous, judgment difficult."