reconstructing and animating heat-map cross-sections

reconstructing and animating heat-map cross-sections

Anonymous
Not applicable
876 Views
1 Reply
Message 1 of 2

reconstructing and animating heat-map cross-sections

Anonymous
Not applicable

I'm trying to put together animated blobs using heat-map cross-sections I've made in excel.

each of the 8, circular cross-sections consist of 316 cells with temperature values, and there's a new set of 8 cross-sections for each frame of the animation: 

 excel heatmap.jpg 

The way I've been doing it is setting a minimum tempreature in Excel, below which it turns the number into a zero, and above which it turns into a 1. then it automatically colours all the cells with 1 red, and I import the spreadsheet into photoshop. In photoshop, Itell it to trace paths around all the red blobs, and export the resulting splines to an illustrator file.

photoshop splines.jpg

No issue so far.

 

This is where 3DS MAX comes in, and the part I'm sure I can make more efficient and accurate.

 

I import the splines to 3DS MAX and stack them on top of one another at the correct distance, and I extrude them so they're just touching and I've got all these stacked, spline-shaped objects.

extruded.jpg

I would love to just loft between them for this step, but holycrap am I doing something wrong or is there a reason there's no obvious way to just smoothly connect polys between these cross-sections, and instead you have to endlessly fiddle with the spline vertex numbering so it doesn't turn into an unaligned, twisted-up mess??

 

I don't want to, but at this point I take my ziggurat-like blobs into ZBrush and use the dynamesh tool to stick them together and smooth them out. Then I can export them and get back to 3DS MAX goodness 😛

 

And this is about where I'm up to. I have my many blobs (around 900 of them for a proper, full set of frames), and I want to render them, one after the other to make an animation of how they change over time.

smoothed blobs.jpg

Too much work to move the camera to a new blob every frame (900 frames for one animation, and dozens of these animations I want to do with as little fuss as possible) and I haven't got any concrete ideas about how to do it otherwise - maybe something with transparent materials or something? I'm pretty noob when it comes to animation 😛

 

So the ideal scenario would be to minimize or eliminate my time in other applications (photoshop, zbrush, etc) and get 3DS MAX to understand each of these blob meshes is a new frame.

 

I'd be very excited to find a different way to draw them too, like using voxels or something - each Excel cell represents a 1 cm by 1 cm cross-section, and is 2.5 cm away from the cross-section above/below it (meaning I'm effectively dealing with a 20 cm tall cylindrical volume with a 10 cm radius). 

 

Accuracy is very important, and the temperature value at the center of each cell must be preserved, although interpolating smoothly between them is very desireable, and is one of the great benefits of the photoshop step with its excellent bicubic interpolation algorithm when generating smooth splines for the cross-sections. I have been developing algorithms in excel to do this between the 8 cross-sections, and also looking into tricubic interpolation which would be the ultimate solution for approximating all the points I want through the whole volume, but once again, this feels like something I should be able to get 3DS MAX to do somehow, either through something like lofting, or something like voxels.

0 Likes
877 Views
1 Reply
Reply (1)
Message 2 of 2

leeminardi
Mentor
Mentor

I was thinking that you might be able to go from  Excel directly to 3ds Max.  I wrote a quick proof-of-concept Excel VBA macro to generate a bunch of boxes based on the 1's and 0's of the spreadsheet.

Given a rectangular array of cells that contain a 1 or 0 the user selects the top left cell and then runs the macro "blocks". It searches a row for a 1 or a 0, if a blank cell is encountered it goes to the next row. For each 1 that is encountered a Max script statement is created that make a box of dimensions w,h,and d (see the code). 

 

Sub blocks()
' select the top left cell before running.
w = 10  ' box width  (x)
h = 10  ' box height  (y)
d = 10  '  box depth
fn_path = "C:\_junk\"
fn_Script = fn_path & "Boxes.ms"

Range("B2").Select
Open fn_Script For Output As #1
i = 0
j = 0
While ActiveCell.Value <> ""

    While ActiveCell.Value <> ""
        If ActiveCell.Value = 1 Then
            r = ActiveCell.Row
            c = ActiveCell.Column
            
            aline = "Box pos:[" & i * w & "," & j * h & ",0] isSelected:on width:" _
            & w & " length:" & h & " height:" & d
            Print #1, aline
        End If
        ActiveCell.Offset(0, 1).Select
        i = i + 1
    Wend
    ActiveCell.Offset(1, -i).Select
    j = j + 1
    i = 0
Wend
Close #1
End Sub

For the following spreadsheet,

bx1.JPGThe generated script looks like this:

Box pos:[30,0,0] isSelected:on width:10 length:10 height:10
Box pos:[40,0,0] isSelected:on width:10 length:10 height:10
Box pos:[50,0,0] isSelected:on width:10 length:10 height:10
Box pos:[0,10,0] isSelected:on width:10 length:10 height:10
Box pos:[10,10,0] isSelected:on width:10 length:10 height:10
Box pos:[20,10,0] isSelected:on width:10 length:10 height:10
Box pos:[30,10,0] isSelected:on width:10 length:10 height:10
Box pos:[40,10,0] isSelected:on width:10 length:10 height:10
Box pos:[50,10,0] isSelected:on width:10 length:10 height:10
Box pos:[60,10,0] isSelected:on width:10 length:10 height:10
Box pos:[70,10,0] isSelected:on width:10 length:10 height:10
Box pos:[0,20,0] isSelected:on width:10 length:10 height:10
Box pos:[10,20,0] isSelected:on width:10 length:10 height:10
Box pos:[20,20,0] isSelected:on width:10 length:10 height:10
Box pos:[30,20,0] isSelected:on width:10 length:10 height:10
Box pos:[40,20,0] isSelected:on width:10 length:10 height:10
Box pos:[50,20,0] isSelected:on width:10 length:10 height:10
Box pos:[60,20,0] isSelected:on width:10 length:10 height:10
Box pos:[70,20,0] isSelected:on width:10 length:10 height:10
Box pos:[0,30,0] isSelected:on width:10 length:10 height:10
Box pos:[10,30,0] isSelected:on width:10 length:10 height:10
Box pos:[20,30,0] isSelected:on width:10 length:10 height:10
Box pos:[30,30,0] isSelected:on width:10 length:10 height:10

  etc.

At the left in the image below is the result of the script and at right is the result of a Boolean union of all the boxes.

bx2.JPG

The program could be enhanced to do multiple cross sections.  After you get the full shapes as a result of unioned boxes you could use Max features to smooth the shape. 

 

Does this approach have possibilities?

 

lee.minardi