The project I’m working on involves using Grasshopper to model vector graphics in pixel units, with the intention of exporting to a non-antialiased, “quantized” bitmap for further use in other software.
Here’s a screenshot of my sample input ( the closed circular curves) and desired output on the right.
My current rather convoluted workflow involves:
- Baking the curves
- Creating hatches from the curve boundaries
- Selecting only the hatches, and exporting as Illustrator .AI files at 1 mm = 1 point scale
- Opening the AI file in Illustrator, select all
- Using “Asset Export” Tool in Illustrator at 1x scale, 72 ppi, with no antialiasing
- Naming the file manually ( Illustrator defaults to calling it “Asset 1.png” no matter the original filename)
These steps have to be done dozens of times a day, in an iterative design process, so I’m wondering if there there any plugins or shortcuts out there to make this more efficient?
I’ve managed to automate steps 1-3 using a Python script (attached below) but it doesn’t always work, and sometimes freezes the GH canvas when run on another computer’s installation (Windows, RH 5).
Note, Rhino’s ViewCaptureToFile doesn’t work for my purposes, because it produces an anti-aliased bitmap scaled to the viewport dimensions instead of the model scale.
hatches_export_sample.gh (9.1 KB)