Notifications
Clear all

[Closed] Reporting of road conditions via 3d model

Hi there.
We have a client that wishes to generate a visual representation of a series of road condition reports.
I am imagining a realtime model platform (which platform im not sure of…suggestions??) that will visually represent an excel sheet that shows the following…
example of data
sorry cant get the embed image happening.

so each table is 8 columns (or lanes on a road) by 5 rows (representing layers of road base). Each cell may be 1 of 2 colours OR clear (ie nothing)

We have 4,500 of these tables in one excel sheet. This corresponds to a record every 30m’s for 90 kilometres of road.

What i wish to do is import this data into max to create a model that we can export to give visual indication of problem areas.
Ideally the realtime model would have a section tool to be able to slice away part of the model.

I should also say that the model needs only be visually accurate to reflect the data only. ie no need for representation of correct xyz’s only a linear sequence of records. So the output would be a big cube of colour that could be sliced to see underlying road condition.
Ideally realtime model could be scaled along the axis of the road to allow for more detailed examination of particular areas. Im imaging each cell would be represented by a box which is either coloured or clear as indicated above.

The first step is to get the data into max via a CSV import im guessing. Thats about where my ideas come to a grinding halt.

any ideas?
also any suggestions on where else to post this within and/or outside CGtalk appreciated.
I imagine this is a scripting job but maybe there are tools that do this kind of thing?

thanks

1 Reply

Start by searching the MaxScript help with “text file input and output” and also “external file methods”

Keep your data simple while you figure it out. Try to work with just one column of data at first. Then figure out how to parse two columns and so on. 

In the help under the first example above, there is an example of how to read every line in a file one by one.

This is a simple example that I wrote to pull point position data out of grasshopper. It simply reads through the csv line by line, gets rid of the curly brackets and adds square brackets. I’m sure the pros here would have a more elegant solution.

[left](
  	 thefile = (openFile "C:\	est.csv") -- open the file, loading it into memory
  
  	 while ((not (eof thefile))) do -- loop through the file until the End Of File.
  	 (
  		 p = readline thefile -- read the next line in the file and store it in the variable "p" The data type here is a string.
  		p = trimleft p "{" -- remove the curly bracket from the left
  		p = trimright p "}" -- remove the curly bracket from the right
  		p = "[" + p + "]" -- add square brackets back to the string
  		pt = Point size:5 constantscreensize:true centermarker:true cross:false-- create a point, set the size and set some properties
  		pt.position = execute p -- set the position of the point equal to the string stored in the variable p. The execute command effectively converts the string into 
  											 -- a Point3 value that maxScript can read as a position.
  		pt.wireColor = gray -- set the color
  	)
  	 close thefile -- close the file
   )
    [/left]