Applying an image to surfaces after Grasshopper functions?

Eh up,

I’ve done the usual searches but can’t seem to find a suitable solution for the question I have.

The question: Is there a way to apply an image to a surface(s) after a move and scale in Grasshopper? If I have one simple brep, I move and scale it to create hundreds of scaled breps - can I then assign the image to the resulting mass of surfaces which would be scaled and rotated etc. Rather than say, applying an image and then asking the PC to do all the work with a very detailed mesh…

In the past I’ve managed to sample images and assign colours to objects with Grasshopper and then animate them in Blender, assigning the colours to the correct blocks within the exported data… I tried to do it with your plugins @DanielPiker but it was too much for my PC. Pascal helped me with a couple of pointers a few years ago so I knocked out some quick renders having done the physics stuff in Blender.




The stuff I’m doing has been done to death… I know - but it’s either this or, take up smoking and drinking :joy:

iCloud Link - iCloud Photos (Ignore the music videos - that’s just me pratting around on my phone with free software - the images and 3D data is the important bit I need)

could be solved in blender.

or u do the meshing in GH and assign manipulated UV´s before the export to blender. (the plugin human or a simple script does assign uv´s to meshes)

I learned just enough Blender to drop the block on a surface and then render the outcome… I’d like to do it with Grasshopper as the result may also be with curves so I can export vector/scalable stuff.

Low res / low file size with a better crisp outcome

so what renderengine you plan to use?
you talk about export - why? when doing it all in gh?

can u upload an example GH-file or geometry?

You probably should sample the image to get the color before you do the scattering of your objects. There should be enough topics on this forum to find some that suit your need, don’t be shy to use the search button ( Search results for 'sample image color grasshopper' - McNeel Forum )! :slight_smile:

That’s the idea… If I use that plugin I get a really detailed mesh - if the resulting manipulation returns 6k no. off surfaces my PC will burn a hole in the floor and it would take hours to process. the idea is, run the process with simple surfaces, but then assign the single image, to multiple surfaces.

I don’t really want an image sampler - it’s a shame I can’t take a ‘picture’ plane and output the same detail as ‘picture’ plane…

make the geometry as simple as possible.
a cube can be a mesh from 6 faces.
and again : what do you want/need to export from grasshopper. the image? the geometry? the animation?
the image sampler is the solution!

Thanks for the response… The question is how to apply an image to thousands of surfaces with the correct orientation and scale. I have searched, but perhaps I’m not asking the correct question?

Apologies - I had a long phone meeting and now I’m typing as I’m about to go out, so should probably sit down and read the responses in greater detail!

I think I’ve answered my own question as I was sat doodling while on the phone :joy:

Morning Nathan,

I’ve checked the links you listed but that’s not what I’m looking for. Sampling images, extracting colour data etc isn’t the question…

In Rhino you can import a picture, you can trim the surface, cut holes in it etc while retaining the image data. I’m not looking for a rasterized mesh or some new-fangled way to interpret the image.

I’d like to be able to take one image as a surface, and basically, copy scale and rotate the surface. That part is easy - but retaining the image data or applying the image data to the resulting surfaces is the bit I’m struggling with.

I’ve wrestled with this for a while, I’m not asking instead of searching :slight_smile:

Any ideas, please?

Cheers,

Andy

Rhino.3dm (12.5 MB)

Hi Jakob,

Here is an example - you don’t need the GH file… I’d just like to apply a simple image to each one of those surfaces. Ideally without resampling the image as a mesh.

Obviously, I don’t know the inner workings of Rhino or GH, but surely there must be a way to open a picture as a surface the same way you can in the main program without having to sample it?

How does it work in the main program, but not available within GH?

Cheers,

Andy

Rhino 9 WIP has components with which to set up a material, texture mapping and assign it to meshes.

You’d do the assignment of the material and texture mapping to all objects when they’re in a grid, after that do the scattering.

In Rhino 8 and earlier you can use script components to set up the texture mapping and assign the material.

For this usage you’d set an OCS frame or add the same planar mapping.

1 Like

I asked Grok… Using the Human plugin to assign an image to a surface as a preview sorted it. I can manipulate the resulting surfaces for overlap etc and then assign the texture to the surfaces for rendering.

I just needed a quick visual aid, rather than some all singing all dancing way to interpret the file.

Sorry, I didn’t really know what question I was actually asking, until I asked!

Thanks for coming back to me.

Cheers,

Andy

Coming a bit more back at you I created a simple script showing what you could do setting up the texture mapping for meshes.

In the example script I create a simple rectangular slab out of tiny rectangles. These get texture coordinates set up such that once baked you can drop a simple material with texture in the base color slot.

In the demo you see me baking the regular rectangle, and once with the separate boxes translated and rotated randomly

The script (rhino7) is:
mapping-on-meshes.gh (16.9 KB)

A 3dm (rhino7) with two bake results:
mapping-on-meshes.3dm (10.8 MB)

2 Likes

Hi Nathan,

Thank you for taking a further look at it. The bit I was looking for was to be able to see it in real time within GH, but post manipulation, as I manipulate the bits within grasshopper and often overlap them and tweak them sequentially until I’m happy with the result… By that I mean, I didn’t want to create a mesh, then manipulate 6k instances carrying the same data, but apply it afterwards.

The texture is added afterwards in other software where I’m animating it. Adding textures and working with the results in Rhino itself isn’t the issue - I’m trying to work within GH on the fly and get away from manual stuff - if I can!

The Human plugin works well, it’s what I used to create the Pearl Earing 3D model - again, the image isn’t important, it’s the process and the resulting 3D geometry I’m interested in, the texture is a visual aid while tweaking.

Cheers,

Andy

You can pipe the geometry created in my script to a Custom Preview and set the material to the one in the file. You’ll get preview right in the viewport from the Grasshopper file.

edit:

I made some tweaks to the GH definition I posted earlier. Here a new recording and following that the updated script

mapping-on-meshes.gh (23.9 KB)

1 Like