Overlaid heatmap


#1

Hi everyone. I’ve used sketchup for a few years, and want to look at adding an overlaid heat map to my models. I run a few arcades, and we use sketchup to create all of our games. I can rearrange them in sketchup easily, letting me know if the new placement makes sense. I would like to be able to assign a value to each game tied to the money it made, and than have a heat map based on each games sales tied to the other games. Games making more money will be yellow and red, less money darker colors. I’ve looked around for an extension that would help, but cannot find something I’m looking for. Thanks in advance!


#2

if you use groups and assign them to particular Layers, you can then use ‘Color By Layer’…

john


#3

If you have a spreadsheet of the machine (i.e., group) names and their sales, it should be a simple enough Ruby script to import the data and assign colors to the groups in proportion to the sales data. This is assuming that it would be okay to color the entire group the same color, of course.

Just out of curiosity, is your model a 2D floorplan? Or a walk-through 3D layout?


#4

We use it in 3D, but I was invisioning the heat map in just a top down view


#5

I created a simple plugin that uses shades of red to color components according to a list of component names and values. Given a text file that looks like this:

game_01,127.00
game_02,225.00
game_03,32.00
game_04,427.00
game_05,152.00
game_06,62.00
game_07,272.00
game_08,182.00
game_09,92.00
game_10,112.00

It alters a sample model I created using a Pac-Man game from Anthony A.'s Warehouse site:

The model is here: pac_mans.skp (1.2 MB)

The sample plugin can be found here:

https://sites.google.com/site/spirixcode/code/jimhami42_heat_map.rbz

Note: Within each component, I set the top face to the default color. Outside of the component, I colored each component with the yellow. Colors applied to the outside of the component only affect the default-colored faces inside the component. When the plugin is run, it reads the values from the file and applies them to the component by name which effectively only colors the top surface.


#6

Thats awesome, thanks Jim! I am kinda following along, I can get the models to change, as you have shown, but when I import my own model, I cannot get the top to change. I am changing the inside of the component like you said, and am copying one of the colors, but no luck. Would this work with a csv file as well?

Thanks again!

Chris


#7

Are the games in your model a Group or a Component? The plugin specifically looks for Components and won’t see them if they’re Groups. It’s easy enough to change the code if that’s the case.

If you don’t have any commas in your names, it should produce the same file format as I posted above. You will need to rename it from filename.csv to filename.txt in order for the plugin to find it as a text file.


#8

Ok, ive got it to change how I want, thanks again. Where do you get the color values from? Bright red is 427.00 etc. This will work well I think.

Thanks again!

Chris


#9

The colors are dynamically scaled according to the list of values. The maximum value will be a red value of 255 and the minimum red value will be 0. This means that your best seller will always be bright red and the worst will always be black.


#10

This topic was automatically closed after 91 days. New replies are no longer allowed.