If you're reading this, we've just migrated servers! If anything looks broken please email dion@thinkmoult.com :)

Blender: create a DXF of contour lines from a mesh of terrain

What would be your preferred way, in Blender, to create a DXF of contour lines from a mesh of terrain?

Comments

  • edited August 2021

    No way ! Contour from triangulated mesh does not make any sense.
    Would rely on either grass / cloudcompare to do so.

  • Thanks @stephen_l
    In this instance, we have the mesh already in Blender, that we'd like to export out as DXF of contours.
    That is, it's not a raster image we want to convert to a contour--as I understand the grass/cloud compare workflows to be, but i could be wrong here.

  • edited August 2021

    The point with this is that in triangulated mesh only the vertex are likely to be "source of truth - measured points" (and maybe even not).
    By generating "dumb" lines on faces, you actually take interpolate samples on flat triangles, messing with source surface by adding many "wrong" data.
    As points interpolated on triangles are likely to be majority of exported points, the result tend to worse and may add huge deviation, repeat the process 10x and you likely to end up with a plain wrong smoothed surface.
    I guess that grass is able to handle this by evaluating surface curvature and re-generate better quality lines limiting such kind of issue.

    That being said, bpy.ops.mesh.bisect() may allow to actually cut terrain given a plane and normal and then retrieve non manifold edges to generate lines.

    paullee
  • I trust @stephen_l more than my take but my understanding is that contours from a TIN mesh is the traditional way that surveyors create contours. Yes it is an rough interpolation of the surface and it separates the points of truth from the contours but contours are not meant to be that precise. If you are surveying you make sure that you shoot the points you care about and then refer back to those actual points when making design decisions that require a high level of precision. So if your terrain is from a surveyor then you are likely not losing too much.
    It would be great to have a way to generate contours in blender. If it is from lidar it is also from TIN
    My work around has been to export them to QGIS using this clunky method:
    https://community.osarch.org/discussion/632/
    Most of the workarounds in the video are because I have vertical planes that I don't want too rounded off and I am trying to piece together many objects.
    Once you have it in QGIS is is just a matter of creating contours and exporting them as a DXF. But my process adds even more error as it converts it to raster and then to contour. I am assuming that grass GIS also does this.
    The FreeCAD Trails workbench (still in active development so pretty unstable) can also export contours from a mesh. https://forum.freecadweb.org/viewtopic.php?p=508934#p508934

    Meetlattheoryshawbitacovir
  • @theoryshaw said:
    What would be your preferred way, in Blender, to create a DXF of contour lines from a mesh of terrain?

    Sverchok Bisect for me:

    You can even directly dump it into a svg:

    MeetlattheoryshawAcebaswein
  • Nice!.... is there a svg to dxf node? Would be nice to preserve the contours in the z dimension, verses a 'flattened' svg.

  • edited August 2021

    Well blender has direct dxf export, so you can just bake the contours and export them, but as was discussed in a different topic, the plugin is quite old. I personally use ifc for interoperability whenever possible.
    And no, sverchok currently only works with svg.

    (You have to enable the "export autocad dxf" plugin in preferences. For simple geometry like this it works just fine)

  • That's quite a few nodes - I wonder if there is an effort to group together nodes that are useful for architectural purposes to improve the user experience. Perhaps ping @kaiaurelienzh this could be part of IfcSverchok? (because we don't want to pollute upstream with a whole bunch of architectural nodes) Ping @nikitron

    bitacovirAce
  • @Moult said:
    That's quite a few nodes - I wonder if there is an effort to group together nodes that are useful for architectural purposes to improve the user experience. Perhaps ping @kaiaurelienzh this could be part of IfcSverchok? (because we don't want to pollute upstream with a whole bunch of architectural nodes) Ping @nikitron

    Don't know about any existing library, but grouping the nodes is really easy now (the discussion on the topic: https://github.com/nortikin/sverchok/pull/809) I suppose we could easily create a bunch of groups (all we need is a couple of ideas what it should be) and ship them as archi-sverchok examples. But I would do that separately from IfcSverchok.

  • Ah yes, a series of architectural-focused node grouped would be very beneficial I reckon, as a lot of Sverchok is "low-level".

  • @baswein said:
    I trust @stephen_l more than my take but my understanding is that contours from a TIN mesh is the traditional way that surveyors create contours. Yes it is an rough interpolation of the surface and it separates the points of truth from the contours but contours are not meant to be that precise. If you are surveying you make sure that you shoot the points you care about and then refer back to those actual points when making design decisions that require a high level of precision. So if your terrain is from a surveyor then you are likely not losing too much.

    It depends. Based on my experience as a military surveyor, the key issue with deriving contours directly from a sparse mesh is that it results in "blocky" contours, and ultimately contours are to help the end-user visualise the terrain, rather than to act as an authoritative source of heighting (which is the actual point cloud data), and even then is subject to all manner of error sources.
    I would generate the contours themselves as curves, to solve the blockiness issue, which tends to create uncertainty in the minds of end-users who lacked the background to understand that the map is not the ground...

    baswein
Sign In or Register to comment.