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

0 Members and 1 Guest are viewing this topic.

ymg

  • Guest
Re: Triangulation (re-visited)
« Reply #450 on: October 01, 2015, 11:42:35 AM »
TopoWar,

There is still a bug in the handling of contour when a point lies
exactly on the contour.

Will check it out and post a revision.

ymg

TopoWAR

  • Newt
  • Posts: 135
Re: Triangulation (re-visited)
« Reply #451 on: October 01, 2015, 03:10:10 PM »
ok, thanks for answering, would have to make a function that excludes items that are on the lines break or break lines, I could do that, but you have better knowledge than I about the lisp. thanks to the pending review, I am very grateful for the work in this routine!
Thanks for help

ymg

  • Guest
Re: Triangulation (re-visited)
« Reply #452 on: October 01, 2015, 04:09:43 PM »
TopoWar,

The problem is not with the breaklines, but in the contouring
when some of the point are right on the z of contour.

A workaround pending the revision would be to move everything
up or down by a few millimeters and then call contour.

I will hopefully post a revision by the end of the day tomorrow.

Hasta Luego!

ymg

TopoWAR

  • Newt
  • Posts: 135
Re: Triangulation (re-visited)
« Reply #453 on: October 01, 2015, 04:14:01 PM »
now I understand! thanks for everything!
Thanks for help

ymg

  • Guest
Re: Triangulation (re-visited)
« Reply #454 on: October 01, 2015, 04:30:49 PM »
TopoWar,

Here I attached your drawing.

I contoured after moving all points up by 3 millimeters.

I then moved back everything but the contours at
previous position.

Note that I edited your "Linea de Quiebres" by recreating
then as 3dpolyline going from node to node.

ymg

squirreldip

  • Newt
  • Posts: 114
Re: Triangulation (re-visited)
« Reply #455 on: October 02, 2015, 06:52:43 PM »
I've been looking through this thread and wish to give a huge bravo to all involved.

This has some incredible possibilities and I was thinking of some possible improvements:


First thought:

Has there been any thought to using a database for storage of the TIN utilizing something like the work that nullptr has done here http://www.theswamp.org/index.php?topic=28286.0?

If a database was implemented could the TIN creation be faster and/or larger data sets?


Second thought:

(This may also be tied to the first)

What if the TIN was to utilize a simple attributed block for definition.  The block could define the database file location, the display of the TIN (i.e triangles on/off, contours on/off, boundary on/off, contour increments, etc...)

I'm thinking the block could be placed into the drawing and then routines run against the block.
A user could then have a set of routines for, say, adding points, adding breaklines and updating the display.


Third thought:

If the TIN were to be defined in a block then I see two useful routines that could be created...

(GetElevation TIN P)

TIN = Handle of the TIN
P = 2D Point
Return = Elevation (or nil)

and

(GetSection TIN P1 P2)

TIN = Handle of TIN
P1 = 2D Start Point
P2 = 2D End Point
Return = List of 3D points starting at P1 and ending at P2 including all intersections of edges.

ymg

  • Guest
Re: Triangulation (re-visited)
« Reply #456 on: October 03, 2015, 08:35:55 AM »
squirreldip,

Adding an interface ta a database would probably slow things considerably.

As it is, a tin normally should be named.  So you can have many different TIN
in the same drawing.  There is a command named "TOG" that let you isolate
layers so only the tin or contours are visible. That part of the interface
does need some additionnal work.

The getsection routine is actually available and part of the (c:prof) routine.
If you draw a line on the Tin and execute c:prof, you have it with a grid.

What is planned is to choose an alignment and draw all the sections on a
given spacing along the alignment, including sections at beginning and end
of curves.

Bear in mind, that this done in lisp, so anything over 20,000 points is pushing it.

ymg

 

squirreldip

  • Newt
  • Posts: 114
Re: Triangulation (re-visited)
« Reply #457 on: October 04, 2015, 02:45:48 AM »
In my testing I've found that the limit seems to be closer to 10,000 points.

Alignments and cross sections is where I'd like to see this go (I'm a transportation engineer) - I have alignment routines that emulate what was done back with Land Desktop and use them extensively.  It's difficult in Civil3D to define complex geometry for large interchanges (for example) and custom lisp programming has proved very valuable in my design work.

For alignments I've developed base routines that 'Get Alignment', 'Write Alignment' and 'Draw Alignment'.  With an alignment defined I've found that two basic routines required -> given a coordinate return the Chainage and Offset and given a Chainage and Offset return the coordinates.  Create the building blocks and all other ideas will fall into place.  (Also similar routines for Profile and Superelevation).

My experience with Alignments and Profiles is why I'm suggesting building the TIN as a simple object and then having a few building block tools to run against it.  With these developed so many other tools can be created.

Most of the datasets I use are much, much larger than 20,000 points so I'm stuck using the Civil3D surfaces.  I'd really like to find a solution that will work without Civil3D.

ymg

  • Guest
Re: Triangulation (re-visited)
« Reply #458 on: October 04, 2015, 04:37:59 AM »
squirreldip,

I agree with you that alignment is the way to go.

Unfortunately, this is probably the weakest part
of  "Triang" at this point.

One way to keep a triangulation would be to compress
it and keep the point in an ordering that permits to rebuild
it in linear time. (see the work of Mark Kreveld)
I know it is possible for Delaunay Triangulation but I am not sure
if it can be done with a Constrained triangulation.

Alignment would need a way to represent spirals and vertical curves.
They also need to refer to  typical section for a given chainage.
Superelevation, either through Design Speed parameters or chainage
also must be kept with the alignment.  Yet another item are widenings
of the roadway.

So lots of work!

ymg

squirreldip

  • Newt
  • Posts: 114
Re: Triangulation (re-visited)
« Reply #459 on: October 04, 2015, 05:24:17 AM »
I've attached my routines for creating alignments.  Alignments are defined by LWPolyline or separate entities - if separate entities they are lines/arcs/spirals (spirals are clothoid, defined as polylines with extended data - I tried to emulate how LDD created spirals which hadn't changed from the original DCA programs back in mid '80s).

All 6 routines must be loaded.

basic routines are:

GALIGN : Gets alignment - select start point, start station and then select polyline (or <return> to select collection of entities then the program will link them endpoint to endpoint)
WALIGN : Writes the alignment to a text file
RALIGN : Reads the alignmet from a text file
DALIGN : draws the alignment
DALIGNOS : draws an alignment at a specified offset

FITSPIRAL : will create a spiral-curve-spiral corner when two lines are selected or fir a spiral between a line and an arc.

Alignments are stored in a variable ALIGNLIST - list of alignment entities:
TANGENTS/ARCS : (STA P1 P2 BULGE OFFSET)
SPIRALS : same but BULGE is list (PLT PI PST Lo)
PLT = Long Tangent Point
PI = Spiral PI
PST = Short Tangent Point
Lo = Compound Spiral Cutoff Length (0 for full spirals)

Plus two analysis routines:

(XY (list STA OFFSET)) : Returns a list (X Y)
(STAOFF (list X Y)) : Returns a list (STA OFFSET)

There's other routines defined in the files - I think most of their names are pretty explanatory for what they do...

These were created many years ago by myself.  Originally in the mid 90's when I was working in Kuala Lumpur on their Bombardier LRT.  Also originally in Lisp but moved to Watcom C back in the DOS days - moved back to Lisp in the early days of Windows and most recently I've rewritten most of the routines in VB.NET to increase the speed.  I've used these for creating alignments with hundreds of entities - longest I've worked with is just over 150km long.  The speed is needed when solving iteratively (I've got routines for 3D modelling of LRT trains which are very processor hungry and the lisp version is too slow).

These were written long ago so the programming style may not be up to what others may expect and there's very little documentation in the files.

I also have Profile (parabolic vertical curves) and Superelevation (basically lists of station/left super/right super) alignment programming but I'll leave you with this to have time to look and review.

I hope these will be of some benefit.

Edit:  Added AArc.lsp which adds 3 routines:  ALINE, AARC, ASPIRAL (note for AARC +ve radiis are to the left and -ve are to the right)
AARC : Attach Arc to selected entity
ALINE : Attach Line to selected entity
ASPIRAL : Attach Spiral to selected entity
« Last Edit: October 05, 2015, 06:54:43 PM by squirreldip »

ymg

  • Guest
Re: Triangulation (re-visited)
« Reply #460 on: October 04, 2015, 07:32:35 AM »
squirreldip,

Thanks for the upload, I will take a look at them and revert.

ymg

AARYAN

  • Newt
  • Posts: 72
Re: Triangulation (re-visited)
« Reply #461 on: October 14, 2015, 07:46:05 AM »
Hello ymg,

While trying to make contours (Major - 1 & Minor 0.5 with max smoothening) I am getting an error (bad argument type: numberp: nil). Can you please test the attached xyz file from your end.
« Last Edit: October 14, 2015, 07:55:09 AM by AARYAN »

ymg

  • Guest
Re: Triangulation (re-visited)
« Reply #462 on: October 14, 2015, 05:31:26 PM »
aaryan,

If you want me to test, upload the drawing with the points plotted

Problem is probably the bug due to point with a z eaqual to contour.

Try to move everything by up or down by 3 milli.

This is a workaround until I finish debugging.

ymg

pedroantonio

  • Guest
Re: Triangulation (re-visited)
« Reply #463 on: November 15, 2015, 10:16:54 AM »
Hi ymg. Any news about TriangV0.6.4.0 .lsp .Any updated version ?

Thanks
Modify message

ymg

  • Guest
Re: Triangulation (re-visited)
« Reply #464 on: November 15, 2015, 12:47:29 PM »
Topographer,

Not yet, done some progress though on the problem in Contour.

ymg