Image Sampler Grasshopper

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video tutorial I want to talk about a mich sampler and how you can use it to produce a form like this it's the surface based on this image that you can see here I will also talk about a technique you can use with image sampler to dispatch and have two set of data so you can use it to produce circles based on this image sampler you see here and the next part I will talk about using this technique to produce two set of data and how you can combine them so you can produce patterns based on your image so basically this is a video tutorial about the image sampler tool which you can tool which you can find in parms menu and up here you have the image sampler or you can easily search it by double clicking and typing image [Music] so let's start from scratch first I'm going to let's try to produce a point here because when we want to use the image sampler tool basically what it it is and what it means is let me just double click on it and explain it so if you double click there you have such a setting here you can choose the file path so I'm going to choose a file basically you can choose a gradient image maybe a colorful image or whatever you want but the best is the gradient image because you can easily and smoothly transform between the colors so I think that the best image you can use in the image sampler is a gradient image and I will show you why the colorful images will not have a good effect or you have to produce some Photoshop effects on it or whatever you want okay so I have produced this image with grasshopper so I will teach this technique also in another grasshopper tutorial but let's just select this and you can see that you have different channels here and basically if you have a gradient or a grayscale image you can use this one okay let's zoom in you have the color brightness which you can use for a black and white channel so I'm going to use this you can also use the red Channel it only outputs the red Channel and basically the first is the RGB so let's just talk about RGB here so it's the red green and a blue channel combined so we have an RGB you can have the red Channel or the green channel or the blue channel if you have gradients or you're working with these colors separately so you can use these you can have the transparency one if you're working with an image that has an alpha Channel as a transparency here you can use the color view if you are going to another set of colors and the last is the color saturation but basically the best is for the brightness of the image we are not going to change this X domain and Y domain because it's based on the zero one zero one and I'm going to explain this and what happens okay let's go for the okay you can also see that it auto-updates if you have the take off have this checked the image will be also updated if you change it in a another program or whatever you working and if you save in the file you will have this image in your grasshopper file okay so the what is an image sampler let me just explain it here so every sampler is basically a simple tool which will use a two-dimensional coordinate so we have two axes here so basically this is 0 to 1 and this is 0 to 1 and what happens here is in this corner we have the 0 0 coordinate up here we have the 1 1 coordinate and here we have the 1 0 and we have 0 1 so whenever you want to have the output from the image sampler you have to give it a UV coordinate so the UV coordinate is very important if you don't know about the UV coordinate feel free to check the value 8 surface video I've talked about UV coordinate and what it meant and what it means how you can use the UV coordinate it's a little bit different from the XY coordinate or XYZ coordinate we have in the main canvas so for a simple one let's check this out if I give an MD slider which is simple which is a simple tool you can use for a UV coordinate and let's just connect a panel to this you can see that we are extracting the color of these coordinates by this UV coordinates okay so you can see if I change this to the corner we have a brighter one if we come here we have a darker one and basically can see the changing data here okay so this is the basic of the image sampler which you have to understand to work with it so we have to connect a UV coordinate to the image sampler so we can use it as the data and work with it so what I'm going to do here is let's have an exercise with some points here I'm going to go to the web tour section and I'm going to use a point here so it's a construct point tool okay and here we go we have a zero zero zero we just go from the top zero zero zero coordinate here and if we connect this to the image sample we have output of this color okay we don't want this let's just go for an eight I'm going to make copy of this point with an array like a rectangular array you can go for the array rectangular array let's just array this point and we need a Cell rectangular cell here I'm going to give it a rectangle okay and let's just give it a size I'm going to give it a equal size for X&Y okay so this is basically the size and here we go the X counts maybe 50 to 50 because more points mean more data on the image sampler so I'm going to give a 2500 points which are basically our XY points so we cannot connect this to this because what will happen is those points will go out the border you know we have a maximum of one to one coordinate here that you can see here that we will have let's check this out we have 28 0 84 0 and those are too much so how can we just correct this there's a small and a cool technique you can use and this is thick this is the technique I'm going to type here so if we have an X Y Z coordinate so that's a point in the space and we want a UV coordinate what should we do so you can easily use this tool ok let's make it go for blue ones okay you can use the CP surface CP surface tool and a bit of repair mat right so what will happen will you will project this point onto a surface you have a surface that is repower my choice I'm going to explain that and you will have the UV coordinate so if this let's just explain this if we have a surface here this will this point ok this point maybe it's just something like this maybe it's 200 200 but because we want to use it in the image sampler we have to have this coordinate ok so it's basically a 1:1 coordinate so maybe this point it's going to be something like a 100 coordinate but basically what we need is something like this I'm just going to I'm going I'm explaining this because you have to understand what a UV coordinate is based on a surface so the best way you can convert a point from an XY coordinates to a UV coordinate is to have a surface so I'm going to use the surface tool I'm going to use this bounding box and I'm going to give this bounding box to the points and right-click on the bounding box and use the Union box because I want a union box which will cover all the points okay that's a union box and you can see the surface will be merge and now we can use the technique the CP surface technique I'm going to use the surface closest point and let's just project this point into the surface and this is the surface we want to project these points but remember when you're going to give the CP point CP surface technique you have to right-click on the surface and choose the requirements right cell first project those points by the surface closest point tool and give the points to the point and choose a base surface to this and basically you have to have the requirements rise input so let's just read a requirements rise and here we go we have the UV coordinate and you can see here that we have from 0 0 to 1 to 1 and all the data will be between the 0 0 and 1 1 and that's the technique you can use to have the UV point you have also the projected point here which we don't need it's basically the same as the point because those points are on the surface and and it doesn't have any difference but the main technique we use the surface closest point is we have an apartment-sized surface we have a UV point and here we go okay low so let's go and use this UV point and connect it so we are just mapping this points onto this image sampler and we have the data let's reconnect this we have a zero to one data based on the brightness of this image okay color brightness so we are ready to go we have everything we want and now we can use these numbers to give this point some weight so the best and the easiest way you can do is to just move these points let's just MV move these points in the Z direction and if I connect this to the Z direction what will happen is that basically this white will go to one so maybe something a little bit of move here okay just the one here and the blacks are going to go to the zero so it's near the points okay you can see here that the points are already near each other okay so we need something to spice this up we can do this with two techniques one is to just multiply this go to the math multiplication multiply this through maybe 25.6 give this to Z and let's just increase that and we're going to turn off everything so have the surface okay here we go and you can see that those points are moving based on this image we change this so we can check this out another one okay go to this face you see that's going face on the picture and it will have some move your butts but basically that's not it we can use this technique also but it's better to just go for the next one okay so now we have it that's why because that's why I told you to use a gradient color because you can smoothly change the data and have weight flow for all those points and now let's go and give a surface to this point so I'm going to the surface and use this surface one points let's keep the Q counts basically that's the you counts because we have the fifteen to fifty rate points and here we go let's just turn this off and here's the surface Shadid points okay so you can see that lets give us a color going to the display section and going to the custom review and let's just connect a swatch here give it a color okay my favorite color you can see the results okay there we go you can change that there's another technique you can use if you want to give a minimum and the maximum you're controlling and that's using the remap tool I've explained about the remapped in the introduction you can use that or into in the first tutorials that I will put it also in the website so I'm going to give this the data and let's just give it from 2.5 so maybe 400 okay and use the remap technique so what there's a benefit in using remap because you can change the minimum and the maximum so basically you are changing the location of those colors that's the better results and let's just okay I don't want this let's just change this to the curve and here we go you can see this let's just go max and this is the first thing you can use there are several techniques you can use for the leaving sample let's just go and have a copy-paste turn this off and you know okay what about working with the points okay we can also maybe just draw some circles here okay we can draw circles on these points and have the radius of these circles based on the image sampler so I can go to the curve I can go to the circle I'm giving the points to the center of the circle so we will have a circle one circle the radius one in each point and then I'm going to connect this to this okay let's just turn the points out and here we go it's a 0.72 39 radius for the circles and we can have this easily so you can see how easy it is to use the image sampler to combine it with geometry or use it for the parametric design techniques we can also combine this with dispatch technique which I talked about in this patch tutorial so how you can do it is going like this so let's just go and have it like let's go to the math section and we can just check for larger or smaller so I'm going to give a larger here and say which numbers are larger than 25% so there will be some of the points that are true some of which are false and in that tutorial in this patch tutorial talked about this patch which we can just dispatch these points let's just dispatch these points okay check this out this is the list a and this is the list B so we'll have two lists we can use the list a for the circles and I'm going to dispatch also the data we used for the remap I'm going to explain what happened here okay maybe you're just confused but let me just explain it's a simple one okay here it goes okay so what I did is I just checked the data from the image sampler is it bigger than 25% yes it is or no it is not so I dispatched first the points so we will have only the bigger than 25% colors coming out for the points we dispatch the points and now we also dispatched what the output of the image sampler so we'll also need only the data of the color only if it's bigger than 25% and I remap this to only one number because I want it to be a single radius for all the circles here so here we go let me just take this a bigger size and a bigger circle here you see that okay we can also use the list B if we go for the list B you can see that we are choosing for the inner parts of this black section so you can go here and use the list B for one circle and let's let's just change this for the another list of the list a let's just go for the list a and give it another circle so this is the technique you can just have list a and list be in two different points two different numbers over a map and here you go you can see that the results I'm going to change this to curve you can change the number the best part is that you can change the number of the colors you want okay so I can go and just turn this off we'll have a simple one on maybe I just need the curves and I can change how much of the colors I need how much percent of the brightness I'm going to work this okay and this is the next one you can change this this is how it works and you can also use it for whatever you want you can maybe let's just give it another example I'm going to save this file so you can work on it okay let's turn this off and go for another one maybe we can just use this to extrude let me have that logic here so I'm going to have this logic is it bigger or smaller than something and now we have two groups two set of points and what we can do here is maybe we can just have the panels here okay I have these panels or whatever you want you can do anything so let's just have another so what I'm going to do is let's just have another practice or exercise we can have a rectangle here and let's just array this rectangle so we have a rectangular array I'm going to array this rectangle with with its own cell okay go to the maybe 30 third okay now we are going to explain how I'm going to use the image sampler with the rectangular array so what we need is let's give this image sampler here and use the graph so we have the brightness okay we need a UV point so if I give an surface area and get the centroid these centroids are and are in XYZ coordinate you can see you can see here 3297 and so on so these are not you'll be coordinate they are x and y and z coordinate so what we need is to have a CP surface we have going to go to soapy surface and project these points on a surface so how can we have the surface here we can have began going to the surface and using the bounding box and have the bounding box from all of the rectangular arrays and don't forget to have the Union box on so we have one box output here in the flat box and here we go we have to repower maîtrise the surface and we're good to go we have the UV coordinate and let's just connect this and here we can just turn this off and what about just extruding them so I'm going to extrude these rectangles in the Z direction and using the image software so thank you it's a map from 10 to maybe 200 okay and here we go and you can see that I'm just extruding this based on the color we have here or the brightness we have here we can also have a cap here and finish this tutorial and go the cap holes let's just bake this okay and you can see that we can just easily produce rectangles and boxes based on the image we are using okay but change this happens and here you can see that it just extrudes okay and another one so this is a tutorial about image sampler feel free to ask questions in the comment section in YouTube channel or in the website and thank you for watching if you have any commands which you don't understand or you think you need a tutorial about it feel free to ask and we will answer them in our parametric house YouTube channel thank you for watching [Music] [Applause] [Music]
Info
Channel: Rhino Grasshopper
Views: 18,456
Rating: 4.987988 out of 5
Keywords: grasshopper3d, grasshopper tutorial, parametric design, image attractor, grasshopper attractor
Id: 9RvgvPw6kxo
Channel Id: undefined
Length: 26min 25sec (1585 seconds)
Published: Tue Jun 19 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.