So i have this script iv been working on. Essentially its a map of certain location and it generates a sort of population map for each location based on a few parameters such as area, change in population ect.
The script works well enough but i need to run this script on 6 locations in one file and its getting far to heavy for my computer.
The issue got worse as soon as i started inputting some of the large numbers into the script. The math is simple enough but for an example of the kind of numbers I’m using:
9,748,000-8,718,000=1,030,000
So im wondering if there are anyways i can simplify this script at all, while keeping all the easy access variables and such so my colleges will be able to interact with it?
not sure I’m fully understanding what the definition is doing, but it looks like at a certain point you’re converting the extrusions to meshes, and deconstructing them in order to measure their relative heights?
Hey, sorry for the late reply. Have been stuck on a different project at work all day.
But yeah you are right about the converting extrusions to mesh. I was following someone else’s script that worked similarly to what I was doing (although they were working on a mesh). So when i couldn’t figure out how to achieve it with a brep, I said screw it and converted the whole set to a mesh just for this small section of code (clearly not the best idea haha). Ill try swapping the component for mesh brep instead.
Is there another way for me to get the Z value for the breps without converting to any form of a mesh? Would this lower my times even further?
I have no idea what is happening with that gradient component at all though. What I’m trying to achieve with it though is something that looks similar to a temp map with the gradient changing as the height values change. The goal was for this to represent differences in economic wealth through different age groups (although this will be dependent on if my partner for this piece of work actually decides to do something and gather the data I have asked him too)
Also just a quick question, how do you bring up these component run times in the first place? This seems like a very helpful tool to analyse the weak points of a script!
to give colors to the mesh, you need mesh vertexes, in such a way you assign a color to those
in this case, my previous advice was against this feature I explain why
in order to simplify the mesh calculation times by reducing the amount of vertexes to the minimum, it comes out for each bar you’ll have vertexes only on top and on bottom:
so, actually, even if your gradient has 20 colors between start and end, they will never be sampled to any vertex, because there are no in-between vertexes between top and bottom that can receive those colors
aahhh i see, so in this case, an overly complex mesh is actually what gives the gradient tool something to work with. I don’t often use the any of the colour components in grasshopper, do they mainly all work with vertexes to give them their boundary’s to work within then?
So i assume if i wanted to create a gradient across a single planar surface, this would also need to be meshed to give the tool more vertexes to work with?
Oh and just in case you were interested, here is a draft version of what you have helped me create over this weekend. Still got some bits i would like to add here and there, but the gist of it is there.