Author Topic: Point elevations from contour lines?  (Read 2862 times)

0 Members and 1 Guest are viewing this topic.

Atook

  • Swamp Rat
  • Posts: 1027
  • AKA Tim
Point elevations from contour lines?
« on: September 21, 2021, 03:01:43 AM »
I'm looking to assign elevation values to a collection of n block references (100<n<3000). The elevations will be pulled from a topo xref of contours (polylines on elevations). All of this is to be done in vanilla AutoCAD and BricsCAD using .NET. Requiring Civil 3d is not an option.

One method would be to interpolate the elevations from the polylines on either side of the point, but that math seems complicated, let alone inefficient. It seems that creating some kind of surface (TIN?) would allow me to just read the elevation of the surface at each point. Or maybe there's some triangular black magic that's a good way to do it.

I normally just work in 2D, so I'm out of my wheelhouse. Wizards of the swamp, how would you do this?

badjo_5

  • Mosquito
  • Posts: 18
Re: Point elevations from contour lines?
« Reply #1 on: September 22, 2021, 04:17:27 PM »
This is not so hard, interpolation is simple, but question is to do an interpolation with what.
First, find nearst point on curve closest to your block, then find same thing on the opposite side. You have bearing from block to nearest point, reverse that angle and shoot a ray, then find intersection that ray with other pline's. Take nearest and you have three points for interpolation.
Something to speed up: if polyline elevation (where nearest point is) is 100 m, then build selection set from polylines at elevetion 99 or 101, depends on equidistance.
 

Atook

  • Swamp Rat
  • Posts: 1027
  • AKA Tim
Re: Point elevations from contour lines?
« Reply #2 on: September 24, 2021, 12:06:42 PM »
Thanks badjo. :)

MickD

  • King Gator
  • Posts: 3619
  • (x-in)->[process]->(y-out) ... simples!
Re: Point elevations from contour lines?
« Reply #3 on: September 24, 2021, 07:06:25 PM »
If the polylines are contour lines (that is, the whole polyline and its vertices lies on a single elevation) you should be able to grab them all then sort on the z coord. You only need the start point of each polyline to get the z coord.
If you need to process the vertices of each polyline, do the above but add each to a collection so you can process them by elevation as needed.
Hope that made sense :)
"Short cuts make long delays,' argued Pippin.”
J.R.R. Tolkien

badjo_5

  • Mosquito
  • Posts: 18
Re: Point elevations from contour lines?
« Reply #4 on: September 25, 2021, 01:26:27 PM »
Or another approach: take all points from polylines, create TIN's, then if triangle contain point, interpolate.

HOSNEYALAA

  • Newt
  • Posts: 103
Re: Point elevations from contour lines?
« Reply #5 on: September 28, 2021, 07:01:42 AM »
hello
possible An example drawing is attached