Dave Richards
Member
- Messages
- 2,930
- Location
- SE Minnesota
Components, Hiding Edges, Arrays, Apply to.rb.
In the bolt threads tutorial I wrote about using textures instead of actual geometry when possible to indicate details. Sometimes however there might be a need to draw the details. Here's a way to draw a repetitive geometry without loading up the file and the video card too much.
In this example I'm drawing a grille for an opening in a door. I start out by drawing a single element of the grille, front left. Then I hide the edges that will join the neighbors. This is done with by holding the Shift key while clicking on the edges with the Eraser tool, front right.
I make this element into a component. For those that have read my babblings before, you know how I like to emphasize the use of components. Components are cool. When there are multiple examples of some object--the grille element in this example--components are the way to go. You can draw one and copy it as many times as you need. SketchUp only has to keep track of the geometry for the first component and then the locations for the rest. This helps keep file size down and performance up.
The other benefit to using components is in editing. If you need to make a change to them, you only need to edit one. All the others get edited at the same time. If you decide you don't want to edit them all, you can make a component or components Unique. This in effect divorces those components from the original family.
So, back to the grille. After making the grille element into a component, I locate it at the center of the opening. This is done by using some construction lines to identify that center and then moving the component into place.
Next, I copy the component using Ctrl+Move tool. I move the copy to one side by the width of the component. Suppose the component is one inch wide. I move the copy 1" and hit Enter. This results in two of the grille elements sitting next to each other. Without selecting any other tools, I type in a multiplier in the form of *n, Enter. This makes multiples of the original. The number you type is equal to the number of copies not including the original. You can experimant with different numbers as long as you don't select another tool. In this case it looks like maybe *6 worked correctly.
After that, I copy the original in the opposite direction using the same technique. Now I have one entire row of the grille element running across the opening. Next, I'll select that entire row and copy it up and down in the same way experimenting with the multiplier until I get the right number.
We now have a grille but the edges overlap the edges of the hole. We need to fix the edges so that the grille is cut to fit the opening. For that we will use Make unique from the Context (right click) menu and a Ruby script Plugin called applyto.rb. You can get that script here: http://www.crai.archi.fr/RubyLibraryDepot/Ruby/applyto.rb Just save this file as applyto.rb in the Plugins file under SketchUp.
Now we start to edit the grille to fit the opening. Select one of the edge components, right click and choose Make unique. Then edit the component and trace along the edge of the door opening and use Push/Pull to eliminate the waste. Deselect the component and select it again. Right click and Click on Component definitions>Get definition. Then select the other components that should get the same editing, right click and choose Component definitions>Apply definition. Work around the edges of the grille until you're finished.
I hope this is useful. Keep in mind I'm showing only one use for the techniques but there are any number of other applications that would benefit from these as well. It occurrs to me that this last part might not make a lot of sense to some of you so I'll see what I can do to clear that up.
In the bolt threads tutorial I wrote about using textures instead of actual geometry when possible to indicate details. Sometimes however there might be a need to draw the details. Here's a way to draw a repetitive geometry without loading up the file and the video card too much.
In this example I'm drawing a grille for an opening in a door. I start out by drawing a single element of the grille, front left. Then I hide the edges that will join the neighbors. This is done with by holding the Shift key while clicking on the edges with the Eraser tool, front right.
I make this element into a component. For those that have read my babblings before, you know how I like to emphasize the use of components. Components are cool. When there are multiple examples of some object--the grille element in this example--components are the way to go. You can draw one and copy it as many times as you need. SketchUp only has to keep track of the geometry for the first component and then the locations for the rest. This helps keep file size down and performance up.
The other benefit to using components is in editing. If you need to make a change to them, you only need to edit one. All the others get edited at the same time. If you decide you don't want to edit them all, you can make a component or components Unique. This in effect divorces those components from the original family.
So, back to the grille. After making the grille element into a component, I locate it at the center of the opening. This is done by using some construction lines to identify that center and then moving the component into place.
Next, I copy the component using Ctrl+Move tool. I move the copy to one side by the width of the component. Suppose the component is one inch wide. I move the copy 1" and hit Enter. This results in two of the grille elements sitting next to each other. Without selecting any other tools, I type in a multiplier in the form of *n, Enter. This makes multiples of the original. The number you type is equal to the number of copies not including the original. You can experimant with different numbers as long as you don't select another tool. In this case it looks like maybe *6 worked correctly.
After that, I copy the original in the opposite direction using the same technique. Now I have one entire row of the grille element running across the opening. Next, I'll select that entire row and copy it up and down in the same way experimenting with the multiplier until I get the right number.
We now have a grille but the edges overlap the edges of the hole. We need to fix the edges so that the grille is cut to fit the opening. For that we will use Make unique from the Context (right click) menu and a Ruby script Plugin called applyto.rb. You can get that script here: http://www.crai.archi.fr/RubyLibraryDepot/Ruby/applyto.rb Just save this file as applyto.rb in the Plugins file under SketchUp.
Now we start to edit the grille to fit the opening. Select one of the edge components, right click and choose Make unique. Then edit the component and trace along the edge of the door opening and use Push/Pull to eliminate the waste. Deselect the component and select it again. Right click and Click on Component definitions>Get definition. Then select the other components that should get the same editing, right click and choose Component definitions>Apply definition. Work around the edges of the grille until you're finished.
I hope this is useful. Keep in mind I'm showing only one use for the techniques but there are any number of other applications that would benefit from these as well. It occurrs to me that this last part might not make a lot of sense to some of you so I'll see what I can do to clear that up.
Last edited: