Export Mesh as STL-File

I am new to working with Grasshopper and am currently trying to save a geometry directly from Grasshopper as an STL file, which saves the file in a folder. does anyone have any tips on how to do this?

This can be done with EleFront and hopefully soon with the a new Grasshopper Rhino component…

obj.gh (884.1 KB)

if you don’t mind OBJ, change the address inside.

Anyplan soon to let export block definition component STL files or whatever rhino can export (dwg, dxf, 3mf, …)?

Currently this is possible with a python component. Here is a sample for STL:

All other formats are possible too using this method. As @martinsiegrist commented, we do intend to add this in Grasshopper as a new component at some point.

2 Likes

Thanks for the quick response.

Also found something from @jho on youtube that make the same thing but in C#

The C# solution export all the geometry at once, not individual items but i thing i have to dig in the for loop to get individual geometries. Will look how the python one works.

Basically what i’m trying to do is :

  1. Having a buch of geometry produced wether by a GH script or the discretization of bigger geometries.
  2. Export them in desired format (pdf, stl, 3mf, dxf, …) at least with a name that let us identify each elements.

I see my students having way too much confidence in what they can draw without knowing the mess that will come when building things. I tend to think that if you draw something, you should be able to get execution drawings done and build it on your own, period! What’s funny with parametric is that you get the same problem as on huge urban projects, that is, massive plan production with a quite identical bottleneck.

At the end of the day it always involve design skills, building knowledge, communication mastering, maths and code aptitudes.

Wether it is one object at a time or multiple objects, that is normally controlled by the list access or object access set on the component input.

Ok thanks, will investigate further.

Ok fine, python thing is working :smiley:, and even better it works with geometries pullled by content cache component. No need to bake.

Will search how to get names from GH instead of using the cnt counter inside the script. Looks like the script select order is from upper right down to bottom left row by row.

1 Like

3d print Batching at work…

Couldn’t resist to fire a 256 batch…
from rhino STL export to Gcode packing ready to print files in less than 3mn…

I’m on!

1 Like

Hello, it is May 2025 now. Does the current gh version already provide a standard module for saving gh content as stl format files?

Not yet. Still have some issues to work out.

But, here is a Python Component that should work: Rhino - Code-Driven File IO

The extension on the filename will control which format type it will create.

1 Like

Thanks a lot for your reply, I used python to check the file directory and then used a custom battery in C# version to do the job.

OK, so we have an early version of this export ability in todays 8.21 build. This is a work in progress build. But, please give it a try to see if it would work for you.

The Export Block Component can now export a number of different file formats. In this case the Block is essentially be used as a blank document container. The extension on the export file controls which file type is written:

These are the file types supported in the v8 RC:

  • 3DM
  • FBX
  • DWG
  • DXF
  • OBJ
  • SAT
  • STL
  • STP
  • SKP
1 Like

Is this available in Rhino 9 WIP too?

Not yet. V9 components will take a bit longer to develop.

This was the fastest way to get feedback and see how it work for various people.

Ok, I just tried in Rhino 8 and export seems to work fine but the *.stl could not be opened.

test.stl (684 Bytes)

This *.stl crashed Rhino 8 when I opened it. Twice in a row +1

The *.skp below also can’t be opened.

test.skp (5.9 KB)

Finally something that works:

test.stp (16.4 KB)

Can I get the original model also?

Sure. It was just a simple box. I tried both without converting to mesh and without and both *.stl files I couldn’t open.

How does the export component choose the scheme?

test_box_100x100x100.3dm (39.5 KB)

Currently it takes the defaults for file options.