Colour Face by ZHeight Range

Hi Everyone,

I am wanting to create a heightmap of an city urban area that colours faces based on the Z height [to create a height control plan] . I used to do this in GIS software and and I used to know of a plugin to colour faces [color face by slope] based on their slope but I cannot find one to do it on the Z height.

Eg Colour all faces from 0-25m blue, all faces 25-50m green, 50-75 yellow etc.

Although I am really only interested in the top plane [eg roof] changing all the facade faces is ok and probably more flexible but in the case of a vertical face, how the z height is calculated needs to be considered.

Maybe I should search for “color” not “colour” :slight_smile:

It would help.

http://extensions.sketchup.com/en/content/clf-color-z

Thanks Dave,

I actually did and yes Chris did produce some great plugins… including that one, unfortunately it isn’t working for me on 2017 and also while fine for terrains it isnt quite what I need… I would have a go at modifying Chris’s script but that is quite a learning curve for me…

Chris’s plugin creates a blended gradient, preferably I only want a limited band of colours, and I want to specify a range of heights to be given that colour.

in planning, urban areas are often height controlled and I need to produce a height control plan showing buildings or lots in different colour codes.

I can do this manually but I actually have about 200 ha [450 acres] and about 1000 buildings ranging from houses to 40 storey 5 star hotels, on top of that I have not one but 8 options for the massing [ height] of this urban area.

[a] I could do this in QGIS, [that would be the best way to handle the urban area, but that is a completely new learning curve [and another software package]

[b] I could do it manually, explode all the model , view in elevation, select faces in elevation view and apply a suitable material… [I have already tested this process] but it [1] requires me to create a sacrificial model and [2] is really difficult to form an accurate selection group over a site almost 3km wide when I am trying to isolate individual floors of a building… again over 8 permutations of the urban area.

[c] I could projection map a colour band of known scale over the model [not attempted] , I did this before in old 3Dstudio days… It will require a sacrificial model but potentially quicker.

I would be grateful for any leads / thoughts on this task…

Regards

This gives you an idea of the scale of the task, the current colours are determined within Modelur [landuses] and I must retain those [hence the sacrificial model] to keep modelur calculations dynamic.

It does work in SU2017 for me but I can see that it might not be what you need.

I might take a shot at this…some questions to clarify the task:

  • From your writeup do I understand correctly that the highest point in each building is all that matters?
  • Is each of your buildings a separate group or component?
  • Do you have a list of specific fixed colors that must be used, can the extension select its own, or must the user be able to specify them differently for each run? (This has a major impact on how elaborate a user interface is required).

Thanks for your offer…

1] Preferably it is not locked to the highest building , as this may change in different design options, normally the height controls are predefined heights - eg 0-25m, 25-50m, 50-75m, etc and a color associated with each. the most flexible arrange would be for the user to input their preferred height bands and colours.

2] the buildings are groups [modelur requirement] but i expect I will create a sacrificial model to do the height mapping [eg explode]

3] As per [1], better if colour is user selectable as colours are also often to match authority colours. but if it is a material then the user can eaily change the material colours post processing.

Height control plans are usually [2d top views] but as uniquely we work in 3d the height control can also be a 3d view.

Thanks again

PS, we are using Modelur for dynamic modelling of the urban forms and although it knows the heights of the building and the number of floors… there is no way I know of expressing that visually from within Modelur

I have an initial crude version written. Do you have a sample file I could test it on?

yep thanks, post it here?

If it is <3MB you can upload it directly here. Otherwise PM me a link to a file share where I can download it.

HTMP-P3b-v2.skp (2.0 MB)

SU 2017 about 2 mb

Thanks! Sorting out bugs…

ok midnight here so heading to bed, thanks for the help

Here’s a first test version for you to try.

  • Install the rbz using the extension manager.
  • It adds a “Color By Height” item to the Extensions manager
  • When you click the menu item, it will open an input box to let you select the base height and step. They default to 0 and 25m.
  • In this test version the colors are hard-wired. I only created 15 steps, so if your choice of base and step needs more than this, the ones above the top step will all get the top color. There is a dialog that will warn you when this happens.
  • The operation adds materials to your model with names “CBH_0”, “CBH_1”, etc. where the number corresponds to the height bin. You can edit these colors after running the extension to use other colors (my defaults are a sort of ugly RoyGBiv).

ColorByHeight.rbz (2.3 KB)

Hi Steve,

Installed ok,
See it in the menu pulldown
but when clicked no input box appears
[similar issue I had with Chris’s plugins [intall ok bu no interface appearing]
I maybe have a interface conflict?
Did a shutdown and restart , no help
Removed a few complex plugins, no help

thanks immensely for your help though

Hi Steve,

We installed on a W& PC and it is working as intended - I suspect a recent W10 crapdate again…

I see that you coloured the entire group based on the max height of the group above the base, this is fine and it is very simple to edit the material name and colour to get the conventions we wish…

I also exploded the entire model to see if it would colour the faces individually… this would give us a band of colours up the facade… this didn’t happen as expected but it is not important, just a optional way of displaying height.

Thank you very much …

Gary

PS will post some sample output later in the week

Please try running it with the Ruby Console Window open and let me know if it reports anything. There could be a code bug I didn’t catch (I ran it on SU 2017().

Yes, as written it colors groups only not individual faces, and based on the height of the highest face in the entire group. Wouldn’t Chris F’s extension work if you explode first?

I could add an option to color each face based on its height without exploding the groups. This could work only if every group or component has only one instance (which was true in the sample you shared). That is, for example, you didn’t create a bunch of identical buildings by copying a group or component without also making each copy unique. Also, we’d need to decide on what height we want to use: lowest, center, highest? I’m not sure whether this option would make the extension run slower, as it already looks at every face to find the highest in each group…

If you like, you could share a list of the colors Modelur uses for height ranges and I could wire those in as defaults to save you the work of adjusting each model.

Here’s a revised version 0.3 that

  • handles the transformations of nested Groups and Components correctly (The previous didn’t! If you moved a Group or ComponentInstance vertically, its heights would be calculated incorrectly!)
  • adds an option to color Faces (the requested “rainbow effect”) vs color whole Groups or ComponentInstances There is no need to explode things before choosing this mode!

Notes:

  • locked, hidden, or associated with a non-visible layer will be skipped. This lets you control what will or will not be colored.
  • if you run the color instances mode and the model contains multiple copies of a Group or multiple instances of a Component, you can work around the uniqueness rule by wrapping each copy/instance
    in its own unique Group.
  • If you run the color faces mode, there can be only one copy of each Group and one instance of each
    component in the model. Otherwise all copies/instances will get the face coloring from the last one analyzed. This is a result of the way SketchUp captures model data and there is no workaround.
  • if you do a color all faces operation, you will need to undo it before subsequently running a color instances operation because face colors dominate the Group or ComponentInstance color in SketchUp.

ColorByHeight3.rbz (5.1 KB)

1 Like

Hi Steve ,

thank very much

Hi Steve,

Just a quick post to thank you again for all your help and post an example of its use in a real project…

We needed to map out the heights of numerous buildings over a 200+ Hectare urban area - this is a map of the existing urban area [can’t publish the new urban designs [there are 3 ] as they are still confidential]

We set the height range in 10 intervals and cover from 0 - 150m overall. As you can see it also mapped the elvations of the forms.

The plugin ran smoothly quick [5 seconds for these models].

It also kept our data structure [layers, groups etc] so no downside there either.

Again thanks so much!



2 Likes