[LumenRT 11] How to export the Sculptable Terrain?

Trying to apply a river mesh to sculptable terrain. In order to do so, I am wrapping a river plane against a terrain grid mesh in a 3D modelling program. It is not precise enough as the heightmap application algorithms differ between the 3D modelling program and LumenRT.

So I would like to export the LumenRT sculptable terrain into a 3D mesh file.

I've found that opening a LumenRT scene generates a terrain .bin file within a AppData temporary folder. The BIN file seems to be VUE related, but I have been unable to open it in e-on's VUE Infinite.

I've also tried to do it with Python programming, which with LumenRT 11 is now an option. Even though there is a function that spits out all altitudes of the EONTerrain, I cannot pinpoint the EONTerrain object as it does not appear in ObjectList(). Perhaps Sculptable Terrain is either not VUE Terrain or extendes the EONTerrain?

Parents
  • Hi Oto

    This .bin file is not a VUE file actually.
    What is the format of your terrain grid mesh?
    Is it an regular 3D object (like .obj etc)?
    In this case LumenRT does not perform any interpolation or smoothing to this object, so if you can retrieve the altitudes from this mesh in your modelling program, then they should stay the same in LumenRT.
    Otherwise, if your mesh is converted to a LumenRT heightmap, then as a workaround you can use lrt.GetDropOnGroundTransformation() (as proposed in my reply from your previous post) to "sample" the terrain at several XY locations.

    Regards,
    Alex

Reply
  • Hi Oto

    This .bin file is not a VUE file actually.
    What is the format of your terrain grid mesh?
    Is it an regular 3D object (like .obj etc)?
    In this case LumenRT does not perform any interpolation or smoothing to this object, so if you can retrieve the altitudes from this mesh in your modelling program, then they should stay the same in LumenRT.
    Otherwise, if your mesh is converted to a LumenRT heightmap, then as a workaround you can use lrt.GetDropOnGroundTransformation() (as proposed in my reply from your previous post) to "sample" the terrain at several XY locations.

    Regards,
    Alex

Children
  • Regular 3D objects are not sculptable so I use heightmap.

    [Edit] And yes, true. The .bin file is not a VUE file. Probably mistook it for Terrain .lob file when viewing the binary contents with a Hex editor.

  • As a workaround, created a Python script that uses the mentioned function to export LumenRT terrain as comma delimited CSV file.

    import os
    
    # radius of block from center
    size = 1000
    
    if __name__ == "__main__":
    	f = open( 'lumenrt_exported_terrain.csv', "w" )
    	f.write('vx,vy,vz\n')
    	ray = lrt.Ray()
    	
    	vx = size
    	vy = size
    	while vx > -size:
    		while vy > -size:
    			ray.start = lrt.float3(vx,vy,0.0)
    			# vz - height
    			vz = lrt.GetDropOnGroundTransformation(lrt.GetSelectedObject(), ray)[3][2]
    			f.write(str(vx) + ',' + str(vy) + ',' + str(vz) + '\n')
    			vy = vy - 1
    			
    		vx = vx - 1
    		vy = size
    		
    	f.close()

    How to use:

    1) Set the size Python parameter, 2000 for 4km X 4km LumenRT scene, 4000 for 8km X 8km etc.
    2) Add a cube object to LumenRT scene or use a rectangular building, like Building 17.
    3) Resize the object to 10 cm in all dimensions, press F5 to zoom in on it
    4) While having the object in view, open the Python file import window
    5) Switch to LumenRT and choose the Selection tool
    6) Keep clicking on the object until its parameter window appears
    7) Switch to Python import window and run the script
    8) The resulting CSV will be generated beside the .py file

    5 of these steps are necessary due to the function requiring an Instance, not VUE EONBasicObject, type of object as its first parameter.

    Answer Verified By: Oto