nicholasds Posted October 17, 2018 Share Posted October 17, 2018 Hi all. Can anyone tell me what the best method for bringing in ASCII data into Houdini would be. I have PTX point clouds that I would like to mesh in Houdini, but I can't load them. Here's an example of the first 20 lines from one of the PTX files: 3680 2463 7115.197796 14574.203673 51.118767 0.737771 -0.675051 0 0.675051 0.737771 0 0 0 1 0.737771 -0.675051 0 0 0.675051 0.737771 0 0 0 0 1 0 7115.197796 14574.203673 51.118767 1 0 0 0 0.500000 0 0 0 0 0 0 0.500000 0 0 0 0 0 0 0.500000 0 0 0 0 0 0 0.500000 0 0 0 0 0 0 0.500000 0 0 0 0 0 0 0.500000 0 0 0 0 0 0 0.500000 0 0 0 0 0 0 0.500000 0 0 0 0 0 0 0.500000 0 0 0 0 0 0 0.500000 0 0 0 Thanks! Quote Link to comment Share on other sites More sharing options...
kiryha Posted October 17, 2018 Share Posted October 17, 2018 (edited) I have never deal with PTX, but I think Python is a way to go. If there are point coordinates in this file and you need to create the same points in Houdini, you can read them with Python, then create points (either with Python or with VEX). Should not be that hard to create a script which does this, more tricky would be to update point cloud in Houdini if PTX file was changed. Edited October 17, 2018 by kiryha Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted October 17, 2018 Share Posted October 17, 2018 Here is description of the PTX format: https://w3.leica-geosystems.com/kb/?guid=5532D590-114C-43CD-A55F-FE79E5937CB2 It seems to contain position, intensity and color data and supports multiple point clouds. I found some test data here: http://www.libe57.org/data.html Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted October 18, 2018 Share Posted October 18, 2018 With a single point cloud you could only create points for lines in your file that contain exactly 7 values (standing for Px, Py, Pz, I, Cr, Cg, Cb): import csv node = hou.pwd() geo = node.geometry() path = node.evalParm('path') geo.addAttrib(hou.attribType.Point, 'Cd', (-1.0,-1.0,-1.0)) geo.addAttrib(hou.attribType.Point, 'intensity', -1.0) def add_point(position, color, intensity): pt = geo.createPoint() pt.setPosition(hou.Vector3(position)) pt.setAttribValue('Cd', color) pt.setAttribValue('intensity', intensity) with open(path) as f: reader = csv.reader(f) for row in reader: values = row[0].split() if len(values) == 7: pos = tuple([float(i) for i in values[0:3]]) ins = float(values[3]) clr = tuple([float(i)/255.0 for i in values[4:7]]) add_point(pos, clr, ins) And perhaps filter out 'missing points' by removing any point that was set to 0,0,0: if(length(v@P) < 0.001){ removepoint(0, @ptnum); } py_import_ptx_02.hiplc 1 Quote Link to comment Share on other sites More sharing options...
nicholasds Posted October 22, 2018 Author Share Posted October 22, 2018 Wow, this is fantastic. Thank you so much for taking the time to explain this to me! Quote Link to comment Share on other sites More sharing options...
pezetko Posted October 22, 2018 Share Posted October 22, 2018 (edited) Hi, there is also nice Load Data Tablet asset at Orbolt from sidefx written in vex: https://www.orbolt.com/asset/ndickson::load_data_table and for e57 just use Lidar Import SOP: Edited October 22, 2018 by pezetko Just noticed you are asking for ptx not e57. Added Load Data Table HDA link Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.