TheSwamp
Code Red => .NET => Topic started by: Atook 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?
-
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.
-
Thanks badjo. :)
-
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 :)
-
Or another approach: take all points from polylines, create TIN's, then if triangle contain point, interpolate.
-
hello
possible An example drawing is attached