Simulating Accoustics with Rhino and Grasshopper (Part 2)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

I don't think my computer will like this

👍︎︎ 1 👤︎︎ u/DBBBD1 📅︎︎ Feb 15 2021 🗫︎ replies
Captions
[Music] hello hello hello and welcome to yet another tutorial this time around we're going to do some acoustic simulations using apache there pachyderm i don't know how to call it a plugin for rhino and grasshopper so first of all about the plugin you can just get it from footforino.com and i don't have it open but it is going to be there right so it is let me just write it here for you food food for rhino dot com um that plug-in apache derm p a c h y d e r m patchy derm uh that plugin uh has a installer rather than you don't install it in a typical way or actually you do install it in a typical way it's just that all other plugins in grasshopper are not installed in a typical way but it is an executable file it is an installer which means you just double click on it will run the installing process and you'll have it right so apache derm can be run in rhino uh if you just type in once you've installed it and you type in patchy term you can see some of the tools here listed but we will be using it in grasshopper because why not right in in grasshopper it's a little bit a little bit more custom let's see it like that you can mess around with more things in grasshopper and kind of roll back the animations a little bit easier and then change things up a little bit easier as well so next up what kind of setup do i have well the first super important thing is that i'm using meters not millimeters but mirrors so what i've done is i've exported my panels which are located right here and yeah they're just there i've exported my panels or rather a single panel into a new file i've opened it up and i just arrayed it and this is just me talking so let me just grab a clipping plane move it up so that you can see at least how the panels are arranged in the room so this box right here is just a box right um it represents a room these panels represent panels that are going to be in the room and the point right here represents the speaker right a point from which sound waves are being generated so in total i have uh 40 yeah 24 on both sides so 48 copies of my panels i have a single box and a single point right that's my whole setup and i am using meters rather than millimeters that's very important for simulation purposes right so you need to scale everything down to be correct size in meters if you don't know how to change the units in your file you just type in units hit enter and here you just change it to 2 meters right please don't change your robot cutting or simulation file uh into meters keep it at millimeters is just for this particular particular work that you need to do it for this particular simulation sorry that you need to do it one last thing before we move move into grasshopper is pachyderm patchy derm works with closed poly surfaces so it needs to be a closed geometry meaning you can't have exploded shapes and it does need to be a poly surface geometry at least i think so i might be wrong about that one yeah that's basically how how it goes a bunch of panels box and a point inside of the box anywhere the room size that i'm using is six meters by 5.5 meters by three well kind of three meters right so it's it's not uh not a big room but but it will be good enough so that's our setup all right now the in grasshopper i assume you already have pachyterm installed so in grasshopper this is the definition that we're going to do so it's going to be a really small one and i'm just going to kind of guide you through it so this is like my notes as per usual so once you have installed that plugin it's going to have an a letter yeah there we go acoustics or whatever yeah acoustics um and this is the the plug-in itself right so there's a lot of things that you can get with this plug-in you can get reverberation times you can get the the how is it called how much sound the walls eat up according to the frequency of sound so do the walls eat up more of the high pitch noise or do the walls eat up more of the low low pitch sound so you can get a lot of different things here i am going to just show you the pure basics of it right and also something that's not an excel spreadsheet but rather a visual representation of the sound waves um bouncing around in your room let's get started so the main important component that we're going to use is under visualize it's going to be called visualize pachyderm i'll call it pachyderm i know maybe it's not the correct way to pronounce it but i'll just say pachyderm visualize pachyderm rays that's the main one i'm just going to plop it here and just see what what it asks me to give it it asks me for a room right okay it asks me for a source okay so source of the sound uh directions of of the from from away from the source so um basically towards where is are the vectors going right then terminating surface we don't really care about that and then the last one number of bounds so how many times does the sound particle bounce around before it stops right before it gets deleted okay so room first right uh here under computation no it's not here under model i have either a nerve scene or polygon scene i have no idea what's the difference i mean it seems like it's the same thing so i will like i would assume this is a mesh but when i give it a mesh it just complains so and it likes when i give it a nurbs poly surface so i'll just keep giving it a nerf poly surface i guess so polygon scene or yeah polygon scene that's going to be our room oops that's going to be our room and the question is what uh what constitutes out of these all of these elements what constitutes it to be what is a room out of all of these elements well a room is everything except for that single point and let me go to wireframe view so a room is everything this box as well as these panels they belong to a room right except for this little point right here because this is the source of the sound so for room uh rhino geometry grass operation yeah we will just kind of reference it then as a beer up or series of beer ups set multiple like that there we go so it got referenced in and i will just plug it into grasshopper geometry like that right so now it kinda kinda works and actually uh before we kind of go full ham here let me clear values and i will just choose like one or two panels from here and the room itself it's it's going to be too heavy to deal with with all of the geometry set so i'll just have like the box and two panels set for now so only three b reps in total it's asking us if uh does the component obtain the geometry from rhinoceros model and i'm gonna lie i'm gonna say no right i'm gonna say no and hope that it's going to be okay with it the reason why i'm saying no is because uh if i said yes then it would try to get material properties from the rhino file and i don't really want that so i'm not gonna give it any uh then we have grasshopper layers so it's asking us what kind of layer should wait what kind of error do we get yeah so it's asking us [Music] what layer uh which layer from here should it use to determine the material right so what we're going to do and actually let me double check this yeah what we're going to do is for every b rep that we have we will set the index of the layer to zero that's because i have only one layer and that's called default and that is right at the top so it means it's layer index zero right uh easy enough so first of all if i just give it index 0 here it's going to complain it's going to say number of these objects needs to be the same as number of numbers number of indices so what i can do is i can take this number zero and repeat it repeat data repeat it the the amount of times of us how many objects i have here in this brep component so i can just measure list length because this this is a list of geometry list length is going to spit out number three for me because right now i have only three elements referenced the box and these two panels right here so it's going to spit out number three for me and basically the output of this is just going to be zero zero zero right three zeros but if i give this component like five p reps then it's going to be five zeros here uh that's how it works so i fed it in and now this seems to be working if this is complaining then what you might need to do is you might need to go into rhino type in patch pachyderm acoustic enter it will open up this this box here or our menu here where you'll go into materials and you'll choose uh your layer so usually you just have one so i'll just choose this layer right here the layer in which your elements are together with the box itself uh default layer and i'll just choose the material that i want to want these to have so in this case it will be faster that's it we're done i just click close that was easy okay so this is not complaining anymore what's the last one voxel grid depth number of voxels in each dimensions i have no idea what you mean by this yeah i mean i i understand what you mean by this but why is this a thing let me check one thing i know i know pretty crappy tutorial if i need no no no cancel yep let me pause the video and we will start a new okay so guess what we're not gonna do uh we're not gonna start exploring in the middle of a freaking tutorial that is not a good idea polygon scene that's that's all you need to know source source objects okay i'll come back to acoustics the acoustics there we go um and here under audio i believe no under model i will find geodesic source geodesic of course right here and i'll just plop it in like so that's going to be our source this little guy right here um it asks us for the origin right and we do have the origin we have this little point here so i'll reference it in point set one point that's going to be our origin point then it's going to ask us for the power um how do i how how intense the the sound is so it's 120 i guess decibels i don't know probably decibels so 120 decibels that's fine um and signal delay that's that's also the the way it's constructed this is this is fine we don't want any delay for the for the signal so we want to start it immediately as we're going to start the simulation okay so there's this kind of little guy here that's going to produce a bunch of sound waves right um next up we have ray directions so what kind of directions do we want these sound waves to take right in in which direction should should the sound waves go and for this you can do like a bunch of different things the one that i used was i believe it's from pufferfish plugin it's called vector star yeah vector star so this this guy right here um let me just check yes it is in the puffer fish plugin so you can download puffer fish from food for rhino as well food for rhino.com pufferfish and you will fare fish and you will have you'll have this tool so what it does it creates a bunch of vectors according to you know like a spherical array of vectors is created with this tool um so we can say that our plane is our point so that it starts from our point then it's going to ask us for how many divisions how many steps of division should they take so if we give it one step of divisions you'll see that it creates twice as many points so this is no steps one step right if we give it 10 steps this is how it's going to look like and i think we can kind of do like 50 steps yeah something like that right so in total we end up having 15 608 vectors right uh everything else subdivision type and dimensionality we don't we keep it as default so we have these vectors the thing is that they are omnidirectional meaning they go in all of the in all directions i actually think that it's much more informative if we um yell yell into at one direction and see how it bounces back right so i'm going to only keep the vectors that are looking towards these panels how do we do that well we first need to deconstruct these vectors the construct vector into their x y z coordinates once that is done we will know um like from these coordinates we will know which vectors are looking in uh wait this is x this is why according to world which vectors are looking in positive y direction and which vectors are looking in negative y direction right so i can just ask um is is the y-coordinate larger than zero uh well slash zero that's a smaller one so i'm asking basically yo are you a reversed vector or are you looking forward right which side are you looking at according to the zero axis and it's going to kind of give me a bunch of yes no yes no answers here true false and with those i can use curl pattern pattern tool to actually take the list of vectors and call them with this true and false pattern and it removes everything no it doesn't but why doesn't it show up oh yeah that's because i'm stupid it doesn't show up because vectors are naturally not displayed so i need to do a vector [Music] display there we go these vectors according to this point and we can see that it's looking backwards it's incorrect the direction so it's actually very easy to fix all i need to do is in the colp input the pattern input i will right click on it and choose invert and it's basically everything that was true becomes false everything that was false becomes true so that means it kind of shows the other side of the vector array okay so we know that our vectors are correct i rather aiming in the correct direction and that is indeed going to be our directions so i'll just connect it like so easy how many vectors were left seven thousand eight hundred and four uh we'll have seven thousand eight hundred and four rays in total that's good that's fine um terminating surface as i mentioned before we don't care about it this is a surface that eats up the vectors we don't care about that one but number of bounces we do care about so i will say for now let's just do two bounces or rather let's do one bounce that so basically from this point uh let me hide some things it's a little bit in the way yeah there we go so from this point it produces a bunch of rays that uh hit the wall and the panels and whatnot and these top right because uh it only can do one bounce right so let's do two bounces bam they go backwards now right until they hit this wall here let's do three bounces now it's getting a little bit crazy right so you can see that you can't really see anything right when you do it this way so this is where we will start making an animation of particles rather than animation of lines because lines are super complex and particles are not particles are just points and everyone likes points so let's do some particles i need to remember how to do that yep got it oh yeah and uh just to make it more pretty i will do wires b wrap wireframe or these beer ups i will say give me a custom preview and i will change the swatch color swatch of this custom preview to white and now i will hide everything here in rhino just so that you know i we end up having like pretty clean graphics here [Music] um okay let's come back here i want points on these curves and the the tricky thing is that if i have like you know these kind of bouncy curves right and i i constantly want the point to move along all the this curve and make a bend and all of these curves also have like different lengths because they bounce around different differently but i want always all of the points to move uh by the same amount right according to each other so if one point moves by one meter the other one needs to also move by one meter right um how do we do that well glad you asked i can see um by the way the output is here the curves are here i can see we will evaluate the length we will evaluate the length of these rays right like so and let me hide them they are super in the way and i can just say um how do i do this i can just say okay give me the lengths of all of the curves right so i get numbers in in meters for all of these all of these curves right here and give me the longest one so sort list sort it and then reverse the output because it sorts it from smallest to largest and i want it sorted from largest to smallest so i reverse the output and give me with list item i can extract then the largest length of um of these kind of sound rays that that we have so it's 14 meters okay and then what i can do is i can take it and i can multiply it multiply it by an a slider right a number between zero and one right so let's say zero point five zero zero zero whatever this kind of number zero and one so if it's multiplied by zero we get zero if it's multiplied by one we get the length of the longest curve right our longest ray if it's multiplied by i we have half of the length i think that will work let's try it out absolutely doesn't work okay good to know so one thing that we need to do is under normalized the last thing is i will just make a toggle boolean toggle plug it in here and and choose to it to be false and now if i take a look [Music] boing nice huh okay so that works that works and basically here then we can have like five uh bounces rather than three and we can take a look at a much longer simulation because now we're giving it five bounces right okay we're getting there we are getting there so we have our animation right now it's time to actually make it um make it nicer so i'm going to say let's color it right or do we first no no first we will be patient this is going to take a little bit of time depending on how what kind of computer you have and what kind of a element you have this might take a long time to calculate uh so what god damn sorry about that so what i'm going to do is i'll reference all of the panels and all all of the elements in the box in here i set multiple b-reps and i will go and make some coffee because this will take like uh two minutes i guess in my case in your case it might be much much longer uh if it takes more than half an hour then that means you need to do something's crashing so if something's not right then you will need to reduce the amount of elements or something like that but we'll fix that once we get there right for now two minutes i'm gonna go grab some coffee right back we are back we are back and this works actually it only took a minute so that wasn't that wasn't that bad um now i will hide everything here right there we go and i'll run the simulation just just to see what's going to go happen nothing happens why because i am not previewing the output so now i'm previewing the output and i can see just a swarm of things just bouncing around oh you might also have point lever set to cross so it's going to look like that bouncing around doing their thing right so now now we will take this i take this thing right here and we will create a nice gradient for it so i will use a gradient gradient tool basically what i want is these particles to change their color over time when they are when they are hot at first and the more particles we kind of the more particles bounce around and get lost the colder let's say the color is going to become right so i'll go from red to blue in this case um i think that's fine and we just need to figure out how do we color those particles well first of all i will use what's called the cloud display point cloud display i'll just plug this these points into the point input here for the cloud display and disable the preview here then i will change the size of the points here because they are way too big right to something a little bit more reasonable um 0.02 maybe size yeah that's like two centimeter sized points right here um don't remember what did i use oh i deleted that part well we will uh adjust it so 0.02 millimeters of meters is fine and then the last one is colors right so we need to give give these points colors so right now if i just plug this in it won't work right because this doesn't have an output yet because it doesn't have any input yet so how does the gradient work well basically it is you can think of it as a list of numbers a range of numbers uh and it asks you for okay what's the start what's uh what number is this color what number is that color and then every number that you plug in between those two numbers is going to receive a color for it so a very quick example would be if my uh lowest color is zero or lowest number is zero right so red represents zero and my largest limit is ten and then if i give it five here it's going to be yellow right if i get closer to 10 it becomes blue if i get closer to zero it becomes red right so we can change it this way so now how do we automate this well we need to know uh first of all what's the uh what's the low limit so what will we consider to be red red is hot red means we have a lot of um a lot of particles bouncing around right so i will just say okay um where do we get it from these vectors right these starting vectors from which the particles are going to be emitted is basically how much how many particles we have at the start so i'll just measure list length this length of these vectors and i'll plug that one into l0 like that right so red represents 7804 in my case l1 should represent 0 because it becomes blue when there's no particles left right so it gets cooled down and then for the the parameter so so basically for the number that should be evaluated i need to guess or not guess but rather calculate how many particles do i have right do i have left so this is basically the list length of these guys right here after the evaluation uh the reason for that is um when i run this script and let's say we're near the end this is going to be orange and it's going to say yo i ran out of length of the curve and for most of the curves because i've already reached the end of most of the curves so i had to delete the element or the particle so most of the outputs that i will see here at the end of the simulation are going to be nulls that is not good i want to actually completely remove them so i will say um clean tree clean tree like that one in here like that so and for uh the the removed nose you need to have it as true and it's by default true so now i have only eight particles left at the end of the simulation so that's pretty damn close to two zeros so they're going to be quite blue and i can just i think just measure the list length of them to get the number of how many many particles i have at a given time and plug that one into the parameters and you can see well you can't really see let's make it a little bit bigger or you can see that now the rest of the particles are blue so what's what's happening is when i start the simulation right they're red and as they're bouncing around some of them get caught for instance here in these elements right and they bounce around in the elements many times and they get deleted right so the the first impulse changes the color a little bit and then as they are bouncing around more and more and more they uh they change color right to indicate that there is less of us so the more aggressive the panels are in catching the sound waves and bouncing them around inside of the panels the faster the change in gradient is going to be right from red to to blue in my case it's it's quite smooth a smooth transition that is one thing another thing is just straight up changing the color i guess changing up the color of the preview right so let's take a look at the right hand side view and here i have it set to either wire frame or shaded it doesn't matter i'll use shaded for this that seems fine and actually i will change one more thing i don't want these points to be fuzzy as they are right now i will right click it i want it to be blurry points right something like this so now i will change the size of them back to 0.02 a little bit sharper a little bit nicer okay so we have this uh let's change the display so for to do this i want to first get rid of the grid so i'll type in grid enter i'll choose show grid no show grid access no show world access no i just got rid of all of this unnecessary information uh then i will go to display tab here in the on the right hand side and where it says background i will expand this and choose solid color and for the solid color i'll use black like this well you can use any color you want right but i will use black so we have something like this and let me see my camera is not in the way that's good now back in here back in rhino or grasshopper i can come back to this slider right here i can move it back to zero right click on it animate choose to animate it and i can animate the this the slider in in given amount of frames right so let's see my frame rate is going to be 30 frames per second and i want a 10 second animation so i will have 300 frames right so 10 seconds of animation and i will go to browse this is where i choose where i'm going to save it and i'll just make a new folder here or oops oops oops oops sorry sorry in desktop i'll make a new folder and can i rename this uh right click rename there we go i will rename this to uh i don't know uh side view export something like that i'll create one more because i know i'll need it not here though delete in the desktop i'll create one more folder i'll click on it right click on it rename uh perspective uh view export so i have two folders perspective view and side view export this is the site view so i'll choose this this folder right here hit ok i have this going bmp files are fine the resolution larger 1080 1920 that's great uh all of this seems to be okay and it kind of even shows you a preview of it that's nice but i don't really care about that part i'll just hit okay right once you hit ok it's going to move the slider automatically it's going to generate the frames and save the frames separately right that's that's what it's doing so it's saving the frames as a separate file and while it's doing that i will run the in my case adobe premiere pro there's many many different software packages that you can use to stitch these frames together into an animation this is the one that i use but the free one is davinci resolve davinci as in the guy and resolve as in resolve so you you can use that free software to stitch the frames together there's also you can even do that in photoshop or in blender that would work as well just create a new project real fast call it qqq doesn't matter okay right so it's it's right now creating the project for me um and also finishing up the final oops final frames of the animation these guys don't seem to move because they were shot out parallel to the to the wall to the front wall so they're just kind of bouncing back and forth that indicates echo in in this case a lot of echo right animation saved great let me open it up here so i'll just double click here this is not a a tutorial for for premiere pro so i'm not gonna kinda go too deep with this side view image sequence open up um that's i just need to quickly quickly oops that's time code that's my bad uh interpret footage um 30. so we're dealing with 30 frames per second plug plug that one in press play that's what we get right so this is how the sound waves will behave inside of your room and this is at one quarter of the resolution so you didn't see that that much but this is the like the full resolution and that's how it's gonna look like okay so we have that going super oh no okay it's alive um i will do the same thing with the perspective view i'm just trying to stop it now but it doesn't want to please stop did you stop yes you stopped okay uh i'll do the same thing with the perspective view so here uh hide the grid uh show grid no should grid access no shoulder axis no uh the display solid color black that's good um perhaps something like this ish something like this we'll we'll do the trick you can do axo as well if you want to maybe axle will will be cool nah nah perspective is nicer in this case let's do perspective like that same thing same procedure right click well turn it back to zero right click animate choose the correct folder that's important okay everything else is kind of saved hit okay it's gonna do the same thing in perspective and it's going to save every every frame as an animation from from your simulation let's let's do this while he's doing it i'll just talk a little bit so i kind of already touched upon the fact that if you have a three-dimensional panel and it traps sound waves inside of it right that panel will that type of panel will eat up the sound quite drastically uh that is important to to know and to understand and that's something that you can focus on with with your your designs but the most interesting thing for me is directing the sound waves right seeing how the sound waves as they bounce off from the panel wall are they bouncing downwards are they bouncing upwards and how how do you be um how do the sound waves behave according to the geometry of the panels that's the most interesting thing and that's something that you should experiment with right in architecture we really don't have that many instances where this kind of workflow is considered to be standard right um so so that's something that you should kind of take a look into this is done that's perfect we go back to premiere import import import double click we find perspective view choose this one okay [Music] right click modify not time code i keep clicking on oh i can just go here interpret footage 30 frames per second hit ok and plug that boy in as well so i have now two of them and i can kind of position them on top of each other i can for instance i can reposition them and let's see i can scale this one a bit wait did i just use the same algorithm wrong one this one that's the perspective one no that's not the perspective one goddammit [Music] keep messing it up wait where's where's my perspective one is this the prospective one did i import the incorrect one i imported the incorrect one didn't i yes wait that's weird this is the like the side view why is it doing that let's try again edit or not edit sorry animate oh that was my bad so here viewport was set to be right rather than perspective so it exported the right hand side view i wanted the perspective view to be exported so i'll just go really quickly go to um that perspective view export panel here folder here delete everything and re-export so animate and this time around let's let's do it properly uh so viewport not right hand side view but perspective view in this case hit okay and now we wait again i'm sorry well while we wait we can kind of mess around here with these panels or not i guess because this got deleted reimported here media offline are you the correct one then yes you are the correct one okay so this this guy right here i could uh kind of do some cropping to it oh this is getting slow and that's because of this huh we need to wait we need to wait my computer can't handle two programs at the same time so we will wait or or maybe we don't no we do we do okay let me stop the recording and we'll continue in just right so now when we have this exported and everything is working we can uh kinda as i did before apply crop apply crop to both of these i probably will need to crop them apply the scale i'll just do 50 for both of these uh move one of them to the side oh wait that's horizontal right yeah that's horizontal so one is located here the other one is going to be located here and actually deal with 66 scale i think no something less text 60 percent scale seems to work 60 and then this is where crop will come in so that's the right hand side view or right hand side rock like that that's it that's that's all we need to do uh maybe even move this a bit even further on the side once we will play this is what kind of output we get and it's super laggy so oh no no my video card doesn't like this anyway you will see it i will render it out and i'll put it at the end of the video so go and have fun with the with these simulations i hope you enjoyed this one this tutorial right here and see you next time [Music] you
Info
Channel: Gediminas Kirdeikis
Views: 7,759
Rating: 5 out of 5
Keywords: kuka, abb, robotic wire cutting, wirecutting, rhino, tutorial, grasshopper, gh, robot, lecture, free, accoustics, pachyderm, simulation, analysis, acoustic, acoustics, accoustic, sound
Id: t9t5jnw6XTk
Channel Id: undefined
Length: 47min 31sec (2851 seconds)
Published: Wed Feb 10 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.