Baking extrusion objects?

Hi All,

Rhino creates extrusion objects when possible. Is grasshopper able to bake extrusion objects? I always get a polysurface from baking.

Grasshopper 1 was written before Extrusion objects existed and it was never modified to cater for them. If you extrude in GH you will get polysurfaces from the outset.

Hi David.
Is this still the case for Rhino 6/Grasshopper?

I would like to extrude urban plans to random heights, with keeping the model as small as possible…
if not, do you have a suggestion how to do it any other way, maybe outside grasshopper?

Thanks a lot in advance!

It seems that it still not there. See this discussion

It could be easy to generate Extrusion using Rhinocommon
But it is possible that Grasshopper will transform it in something else and lost its advantages.

hi. thanks…
could u combine the rhinocommon solution with some randomizing parameter for height?

I did a little example

The benefit in size is huge !!

The C# is super simple. I generate some closed polygon which are extruded randomly. One with a C#, but if you bake with Grasshopper Button it will become Brep/Polysurface (heavy 20Mo)
If using Legacy extrude 15 Mo
If using my component and the boolean bake (< 1 Mo) but take care :warning: if you let it at true at every change it will generate data in rhino

if (bake)
RhinoDocument.Objects.AddExtrusion(Extrusion.Create(curve, height, true));
A = Extrusion.Create(curve, height, true); (11.3 KB)


fantastic! …thank you a lot!

somehow this randomizes the height to both sides though.
(from my base curves in rhino… could it be some thing in the script?

imho GH should really incorporate this at some point (@DavidRutten)… it makes models a 10 times smaller…

Extrusions (along with Sub-D surfaces) will be included in Grasshopper 2.0 as native geometry types.


Hi Laurent… still having this problem with “Flipped” curves…
even if i flip them manually in rhino / or using flip curve component in GH…
could it be something in the script?

I have noPC now. Could you post some examples curves ? And script if you changed things. There are also many other functions in rhinocommon.

haven’t change anything… but it seems to be irregular. does the script have to be different for windows?

i even culled all curves that extrude into the opposite (negative) direction… and flipped them, then used the script on them again. Result: some still extrude into the wrong directio…

samplecurve.3dm (87.4 KB)
samplecurve.3dm (87.4 KB)

It was easy to fix, just have to read documentation. Not a clean program but seems to work.

private void RunScript(Curve curve, double height, bool bake, ref object A)
Plane plane;
curve.TryGetPlane(out plane);
if (plane.Normal.Z < 0) height = -height;

if (bake)
  RhinoDocument.Objects.AddExtrusion(Extrusion.Create(curve, height, true));
A = Extrusion.Create(curve, height, true);

} (17.0 KB)

1 Like

whoopwhoop! thanks so much!
if only i could code…

so to recap… extrusions are better for file size, meshes are best for smooth viewport experience if one only works with a onboard gpu.

Hii laurent,

I am doing rhino inside Revit. So, I have already 3d geometries from Revit, which I bake from grasshopper to Rhino. So, my question is, If I already have 3d geometries in grasshopper then how can I convert it in extrusion in Rhino?

Four years later…

I have no idea, I dont use Revit.

Hii Laurent,

I saw you previous comments, you made C# script and convert 3d poly surfaces to extrusion. For that, you create a 2d curve, then put some height integer & make it 3d in grasshopper like attached image. But, what else if I have already 3d poly-surface in grasshopper how can I convert it in extrusion while baking in Rhino?

Can anyone ans. this question? It is rally urgent.

Hi - you just need to extract the edges of the bottom surface of each Brep, find the height of each Brep, and feed these into the component that @laurent_delrieu wrote.

extrusion_GH - from (23.6 KB)

Thank you, Wim Dekeyser it helps me a lot. Thank You Sir.