Error message in extruded component when z =0

Hello everybody
I am a beginner in grasshopper, who can help me please, I wanted to do an extrude for a 2D plane, but when the vector value Z = 0, I got a message “1. Curve could not be extruded”, Is there a method for the value 0 to remain as input and without the extrude component showing me an error?
BUILDING1.gh (15.9 KB)

What’s your expected output when z = 0?

You could use Combine like this:


BUILDING1_2024Mar31a.gh (18.1 KB)

The purple group is very peculiar :question:

1 Like

thank you for the answer Mr. Joseph_Oster, it works well

This got more complicated than expected… maybe I’m not awake yet. Assigning random heights was easy enough but it got difficult when I wanted to have the tallest towers at the center.


BUILDING1_2024Apr1a.gh (14.3 KB)

P.S. This version preserves the original point numbering, thanks to the white group. I still feel like I’m missing something simpler? :thinking:


BUILDING1_2024Apr1c.gh (17.0 KB)

Along the way, I accidentally stumbled across this version that sorts the extrusions differently:


BUILDING1_2024Apr1b.gh (15.0 KB)

please for the second time I need your help, I want to create 9 buildings and I control their height each one alone with the minimum of sliders, if that is possible


GENERATIVE DESIGN.gh (8.6 KB)

I hastily added this white group to a version of yesterday’s code and made a few changes to preserve the data trees. Haven’t got time this morning for anything more.


BUILDING1_2024Apr2a.gh (12.5 KB)

I thank you very much for your time to help me, I am grateful to you Mr Joseph_Oster

I was worried at first when I saw all buildings with the same point list numbers but quickly understood why. The squares (and their center points) are sorted by distance to their average, which is a center point for all extrusions in each “clump” (building?). So they all have the same point list, regardless of the random heights. Zero is always the tallest.

So I went back to using their original numbering sequence with a different method. While I was at it, I added the ability to set different height domains. One per building if you like or in this case, just four that are reused.



BUILDING1_2024Apr2b.gh (24.3 KB)

This gets into the weeds… As I tried to explain in my previous post yesterday, sorting the squares by distance from the center resulted in all buildings with the same point list sequence, even though their heights varied randomly.

By comparison, this code (all three versions) adds Jitter to avoid that:


BUILDING1_2024Apr3a.gh (16.8 KB)

More difficult was getting the same randomized jitter effect while labeling the squares sequentially:


BUILDING1_2024Apr3b.gh (29.3 KB)

Finally, I implemented the same white labeling for version ‘Apr3a’:


BUILDING1_2024Apr3c.gh (26.2 KB)

1 Like