Trimble Business Center

 View Only
Expand all | Collapse all

2D Lines to 3D Linestring

  • 1.  2D Lines to 3D Linestring

    Posted 07-21-2019 23:53

    Creating a 3D Linestring using a Polyline drawn in Civil3D and a CSV file containing X,Y,Z values.

     

    I generated a 3D line string using the XYZ values in CSV. The resultant 3D Linestring  does not register with the 2D Polyline at some places.

     

    Is there a quick way of:

    a) Editing the 3D Linestring (Red line) to match with the 2D Polyline(Green line).

    b) Creating a 3D Line string with the two sets of data.

     

    I attach the relevant files.

     

    Thanks.

    Attachment(s)

    zip
    CWE (190630).csv.zip   95 KB 1 version
    zip
    CWE 2D-3D.vce.zip   259 KB 1 version


  • 2.  Re: 2D Lines to 3D Linestring

    Posted 07-22-2019 20:54

    There is a TML called Insert Line Segment that allows you to quickly edit a linestring by adding additional nodes into an existing linestring - e.g. you can snap to the nodes of the Polyline to add nodes into the linestring that match the polyline.

     

    I dont know of a way to merge a Polyline into a linestring in an automated way - I guess you could add the two lines to a surface and the use Surface Edge Breakline to track the edge of the surface which should be the combination of the 2 lines - that would mean the Polyline was 3D also though or at least had a height along its length.

     

    I will take a look at you date shortly to see if there is anything else I can think of

     

    Alan



  • 3.  Re: 2D Lines to 3D Linestring

    Posted 07-23-2019 13:07

    I would create a surface out of the red line, then drape the green line on top of it.  If you are concerned about areas where the the green is outside of the red, then you could either manually edit the green line and add in the extra VPIs, or make a surface edge breakline, offset it however much you are comfortable with projecting and then add the offset line to the surface and re-drape the green line.

     

    Cheers



  • 4.  Re: 2D Lines to 3D Linestring

    Posted 07-30-2019 08:22

    Saif

    I just looked at this in detail - apologies I have been out for a week doing a Training Class and the weeks before I was preparing for the class so I just got back to this now.

     

    There is no easy way to do this - I did the following

    1. I opened the CSV file and separated the Left and Right Points into two files
    2. I then sorted the points by Easting value (Smallest to largest) because your road goes West to East
    3. I then renumbered all the points in Excel so that the Left started at 10000 and right at 20000 and incremented West to East - I deleted the Point numbers that you had (did this so I could draw the Left and Right Line using Connect points command
    4. I then used the Insert Line Segment TML to add points into the Red Line (Imported Line from points) where the Red Line deviated from the Green Line. T help here I turned on all Line Markings for these lines using Project Settings - View - Display Options t show all the segment end points etc for both lines - I edited the Green Polyline to make it a linestring so I could show its line markings
    5. The Insert Line Segment works where the Red Line has no data but the green line does - it pulls the red line onto the green line, and you have to chord the curved sections by adding more points the closer you want the two lines to follow each other. However it doesnt work in this scenario where the Red line highlighted in Magenta has data because the points that I imported are kind of locks on the linestring - you would have to move the nodes of the linestring to move the linestring to the Green Line using the Linestring Editor - however I dont know what you would want to do with the Elevations in this case as some of those moves are quite large (~2m).
    6. The Insert Line Segment also does not work well when a line doubles back on itself because it is inserting by "Distance Along" so it fails to pick the right segment to insert points into in those scenarios sometimes.

    6) You could also use the Create at Intervals command to create points every few meters down the green line and export those as a CSV and merge them with the Red Points and in this case sort by Easting (smallest to Largest) in Excel and then import them back to TBC and use the Connect Points command to create a combined line of the two sets of data. You could also use the points generated as "Snap Locations" if you want points added in at regular intervals vs "Nearest Snap" to randomly select locations to add where you think you want them. If you do a merge and sort in Excel - you will still get spike locations as shown in the picture above because you would be using all the points in both lines to create the composite line so you would still have manual editing afterwards.

     

    Could you tell me the reason for this exercise - why you had to do this - my guess is that one line is a Design Line and the other is an Actual Survey Line and you want to merge the survey data into the Design Line or move the Design Line to the actual survey line to match existing?

     

    How common is this - while we could relatively easily write a command to merge lines, I doubt that it would ever get it 100% right and you would still have manual cleanup afterwards unless we added a "despike" line option or something to eliminate the spikes that you would get - however we would need to understand how to manage elevations etc..

     

    If you are just trying to transfer the elevations from Survey line onto a 2D Design Line then I would simply offset the Survey line Left and Right to create a 3D Surface that follows the survey line and then use Change Elevation to add the Elevation of the Survey Model to the Design Line (as that may be what you are actually trying to do here) - if you want to do that in relation to an alignment then you could create a corridor using the alignment and add the Survey Lines as Ref Lines and then create a surface from the Ref Line - Left and Right using a Instruction for Left and Right, or you could connect the two Ref Lines with a connect instruction ad then project that outwards left and right using instructions that take the slope from Node to Node between Left and Right sides etc. Now you have a Corridor Surface or surfaces you can use Change Elevation and drape the 2D line onto those surfaces etc.

     

    I hope that this gets close to answering the question - with a little more detail as to what you are trying to achieve here I can maybe give more guidance.

     

    Alan



  • 5.  Re: 2D Lines to 3D Linestring

    Posted 07-30-2019 21:16

    Thank you very much.

     

    Will work through this and revert to you.

     

    Elevation points I had were all from Cross Sections at regular intervals

    along a Road Center Line. As a result, at locations where the Road edge

    line curved sharply away as in a Lay by, the chords were significantly off

    the curved 2D line. The client was insisting, for purposes of incorporating

    in GIS files (Geomedia), he needed the 2D Geometry to be strictly followed

    and Elevations imposed on them. I was wondering if you had some trick up

    your sleeve.

     

    I convinced  him to accept shorter chords (say 1m Length), regenerated the

    cross sections at shorter intervals only at desired locations (Not in TBC),

    exported points as a csv file and generated a 3D line string for each road

    element by "Connect Points" Command in TBC. I then exported the lines to

    AutoCAD for submission.

     

    I have submitted the data to the client and awaiting his formal approval.

     

    Thanks again.

     

    On Tue, Jul 30, 2019 at 7:23 PM alan_sharp@trimble.com <trimble@jiveon.com>



  • 6.  Re: 2D Lines to 3D Linestring

    Posted 08-01-2019 07:50

    As I thought - the question you asked was not the answer you were seeking ....

     

    Use the Elevate Lines command. Use the Points Option in the command. Select all the Points and then select the 2 Green Lines and set a tolerance of e.g. 0.2. This will add your elevations to the Green Lines as requested and make them 3D and keep their original geometry which is what you want in this case.  Any point more than 0.2m off the lines will not be used - you can increase the tolerance or decrease it as you see fit.

     

    Process takes about 5 seconds .... Another hour or two saved!

     

    Happy Modeling!

     

    Alan



  • 7.  Re: 2D Lines to 3D Linestring

    Posted 08-03-2019 02:25

    Thanks a lot.

    I have done this and sent to the clients. Hope it will be accepted now.

     

    Thanks again.

     

    On Thu, Aug 1, 2019 at 6:51 PM alan_sharp@trimble.com <trimble@jiveon.com>