Help optimizing components in a cluster component to run faster

Hi All,

I have made this cluster component to create a parametric street canyon that has the following inputs :


and then outputs Shading surfaces, Sidewalks, Streets, Probing Point, Walls, custom Probing Plane, and context Surfaces.

Inside is pretty simple, but it is lengthy and I am wondering if someone can help me to optimize it. I am 99% sure that there is a lot in here that can be simplified, I am just a noob at this and do not know exactly how to go about it/what can be/what cannot be.

This part makes the shading on top

This makes the sidewalks and Street, so that if you make the sidewalk wider, the street gets narrower

Here I make the canyon surfaces themselves, a lot of copying tho:

And then I find the center of the canyon to make a probing point, probing plane, and make everything rotateable (for street orientation)

Right now it takes about 196ms to run the component, which seems like a lot to me? Maybe it is not. Regardless, I would love to simplify the component anyway.

Any help would be much appreciated. Script attached.
ParametricStreetCanyon.gh (36.9 KB)

missing

I don’t see any reason for this to be a cluster?

I’m sorry, what do you mean by this? The component you reference is one singular component to find the center of something :

What I mean is that the Heteroptera plugin is required so anyone who doesn’t want to install it won’t be able to help.

Oh I see. So sorry. Here is an updated version w/ a stock rhino center component
ParametricStreetCanyon.gh (41.2 KB)

This has fewer components, though is not fully optimized as it might be simplified further.

Fixed a problem with Offset Curve by providing a ‘P’ (Plane) input.

ParametricStreetCanyon_2021_Jun21a.gh (31.5 KB)