DC Exploration #3 - Scaling and Copying

DC Exploration #3 - Scaling and Copying

Postby Chris Fullmer » Thu Nov 27, 2008 2:53 am

Ok, this challenge is designed to start thinking about different possibilities when scaling a DC. I think the most common desired outcomes of scaling would be to either have the DC stretch like regular scaling, OR have it copy series of subcomponents which all stay the same size. The example of this being a fence. It would make sense to have a fence that instead of stretching when scaled, it would make copies of the board and place them side by side for the entire desired length. Stretching in this case would be bad. So that is the Challenge,

Make a fence that when scaled, will copy the boards next to each other and does not stretch any dimensions of the boards.

Hints:
- Constrain the Length attributes by inputing (for example) =2". If you force it to equal a length, it can not be scaled in the direction
- Use the "Copies" attribute tell the DC how many copies to make. Remember that 1 copy equals 2 total (1 original plus 1 copy).
- Use "copy" (no quotes though) to help position the dynamically created copies. Example x=copy*12 will set each copy 12 inches away from the previous one on the X axis.


Want to take it further? Here's some ideas:
- Include an Options menu where the user can specify the dimensions for the boards.
- Make an object that requires some components to be scaled (stretched) and some to copied.
- ??

Post all questions and findings and explorations of your own back here. I'll try to post back with a model that shows how to do all of what I posted later.

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: DC Exploration #3 - Scaling and Copying

Postby thomthom » Thu Nov 27, 2008 9:29 pm

Not a fence, but I had just made this one.

Grid.png

Grid.skp


You size it wither with the options or the scale tool. Spacing is set via options. I was thinking of adding construction points for the intersections.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: DC Exploration #3 - Scaling and Copying

Postby thomthom » Sat Nov 29, 2008 4:28 pm

What happened to this DC exploration series. Seems like interest faded after the site crash?
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: DC Exploration #3 - Scaling and Copying

Postby Jim » Sat Nov 29, 2008 4:46 pm

I am trying to create a dynamic row of books.

When you scale the row (longer), you need to insert books to fill the space. For the row of books to be believable, the books can't simply repeat - they need to be different widths, heights, and have different materials.

The problem is where to position the "next" book. It needs to be placed at (or past) the end of the previous book, but there isn't a way to access the position of the previous book.

Ideas?
0
Hi

Jim 
Global Moderator
 

Re: DC Exploration #3 - Scaling and Copying

Postby remus » Sat Nov 29, 2008 5:07 pm

jim, a not very elegant solution could be to have a list of 'random' values that you can use for the width. That way you would know what the width would be each time and so youd be able to work out where to put each new book.

I imagine its going to be a little bit more complicated than that, but it might work.
0

remus 
 

Re: DC Exploration #3 - Scaling and Copying

Postby thomthom » Sat Nov 29, 2008 5:12 pm

Yea, as Remus said, I was going to suggest the same. You either have a set with seemingly random numbers that would repeat after a while which you can use to predict the sizes of the books.
Or if you can create an algorithm that will give the same row of numbers. However, to prevent that all book shelves end up the same you can use a seed number which is randomized. Maybe even use the interact tool to make the bookshelf generate a new seed number so you can click your way to a pleasing result.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: DC Exploration #3 - Scaling and Copying

Postby remus » Sat Nov 29, 2008 5:16 pm

If your brain isnt too scrambled jim, you could try getting some books leaning at an angle, or some books stacked on top of the others :D
0

remus 
 

Re: DC Exploration #3 - Scaling and Copying

Postby Chris Fullmer » Sat Nov 29, 2008 11:16 pm

remus wrote:If your brain isnt too scrambled jim, you could try getting some books leaning at an angle, or some books stacked on top of the others :D


I just got back form a short vacation and hopefully I'll post something on this tonight. But you comment Remus reminded me that what I wanted to make was siding for a wall or roof of wood shingles. And you could input the a worn-out amount. So for a new roof, all shingles would line up nicely, but the older you make the roof the more shingles are mising, or cracked in half, or rotated, etc.

Well, hopefully later I'll get teat started.

And yeah, the DC explorations sort of died a little after we put so much sincere interest into the first few, just to lose all that to the server crash. I'll try to post another topic later tonigh, unless someone else beats me to it!

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: DC Exploration #3 - Scaling and Copying

Postby Jim » Sun Nov 30, 2008 1:07 am

remus wrote:jim, a not very elegant solution could be to have a list of 'random' values that you can use for the width. That way you would know what the width would be each time and so youd be able to work out where to put each new book.

I imagine its going to be a little bit more complicated than that, but it might work.


I just had a thought that if I made some number of components each consisting of a "bundle" of 3 books of differing width:

book 1 = |_1_|
book 2 = |__2__|
book 3 = |___3___|

bundle 1 = |_1_|__2__|___3___|
bundle 2 = |__2__|___3___|_1_|
bundle 3 = |___3___|_1_|__2__|
bundle 4 = |__2__|_1_|___3___|


Each book 1, 2, and 3 are different widths from each other, but the bundle of 3 are always the same width. So I just need to randomize which bundle to insert.

|_bundle 1________|_bundle 2________|_bundle x________|
|_1_|__2__|___3___|__2__|___3___|_1_|___3___|_1_|__2__|

I'm still not sure if this would work, or look right, but I think it will. (If that makes sense.)
0
Hi

Jim 
Global Moderator
 

Re: DC Exploration #3 - Scaling and Copying

Postby Jim » Sun Nov 30, 2008 1:23 am

And to extend the idea... a stack of books could be the same width, as well as a leaning bundle.
0
Hi

Jim 
Global Moderator
 

Re: DC Exploration #3 - Scaling and Copying

Postby Chris Fullmer » Sun Nov 30, 2008 1:39 am

Ahh, yes I was thinking about this Jim, and I thought it was simple. But I started playing with it and in about 5 minutes I saw just how not simple it really is. The random width means that the amount of copies will vary depending on the width of the books. That is tricky!

I had a thought on placing them though. Each X should be the X of the previous (called "LastX") + the LenX of the previous (called LastLenX"). So what about each component passes its X and LenX out to a custom attribute in the parent component. So the next copy created would look to "parent!lastX" and "parent!LastLenX" to figure out its new X. Then after it sets its X and LenX, it writes its current state to the parent, overwriting the previous states and the cycle continues. So it runs like this

Copy0
X=parent!LastX + Parent!LastLenX (These values will be zero since they have not been filled yet)
LenX=3 (randomly chosen)
<<<Sends X to parent!LastX>>> (which is 0)
<<<Sends LenX to Parent!LastLenX>>> (which is 3)
Copy1
X=parent!LastX + Parent!LastLenX (Now this reduces to 0 + 3)
LenX=2
<<<Sends X to parent!LastX>>> (which is now 3)
<<<Sends LenX to Parent!LastLenX>>> (which is now 2)
Copy2
X=parent!LastX + Parent!LastLenX (Now this reduces to 3 + 2)
LenX=4
<<<Sends X to parent!LastX>>> (which is now 5)
<<<Sends LenX to Parent!LastLenX>>> (which is 4)


Anyhow, its all theoretical since I am not on an SU7 enlightened computer at the moment. I hope that makes sense. In my mind it does, but I'm sure it will probably fall apart due to something I've forgotten. Anyhow, think about it :)

Chris
-1
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: DC Exploration #3 - Scaling and Copying

Postby Chris Fullmer » Sun Nov 30, 2008 2:24 am

Hmm, it was well thought out, but its not working. Its not updating the custom attributes in the parent component as I was hoping it would. Bummer. I'll keep playing,

Chris
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: DC Exploration #3 - Scaling and Copying

Postby wmanning » Mon Dec 01, 2008 9:45 am

Chris, I think your idea was nice, but it might require more regression calculations back and forth from parent to child component in a way that DCs aren't designed to do right now.

I think Jim is on the right track with groups.

I went a different direction with this one, making a couple of useless shapes that copy when scaled. One is a spiral ramp or slide, the other is just playing with shapes. For the second one, Stretch, make it pretty wide, like 30-50 feet in order to see how the shapes play out.

EDIT: the SpiralSlide is an odd one. You need to Import it, but I get weird behavior. when you open it you will see that it in the Component Attributes it says Copies at the parent level. Delete this attribute, then use the scale tool on the component. What is weird is that every time I save the component (through the Component In Model context menu Save As) and re-open it, I always have this extra copies command. If you scale it with this copy at the parent level it takes a long time, and you see the number of copies explode if you have Outliner open. Any ideas why? Maybe I just need to clean things up and reinstall...
0

wmanning 
 

Re: DC Exploration #3 - Scaling and Copying

Postby Jim » Mon Dec 01, 2008 12:10 pm

wmanning wrote:the SpiralSlide is an odd one. You need to Import it, but I get weird behavior.


It appears to behave normally for me. I dragged the file into SU7, deleted the Copies for the top-level DC, then scaled the DC.

Now the first time I tried, I got a lot of extra copies because I didn't delete the Copies attribute first - and only deleted it after the copies were already made. But this does not delete all the copies that had already been created.

When things get messed up like that, you can set the Copies attribute to '=0' before deleting it (based on my experience.)
0
Hi

Jim 
Global Moderator
 

Re: DC Exploration #3 - Scaling and Copying

Postby wmanning » Tue Dec 02, 2008 8:31 am

Thanks Jim, I'll try that.

The really odd thing though, is that after deleting the copies at the parent level, if I then save the component, I still get components at the parent level the next time I import it...

Either way it is fun to simply play with the formulas and later I can figure out what I want to build.
0

wmanning 
 

Re: DC Exploration #3 - Scaling and Copying

Postby nic_riche » Thu Mar 05, 2009 9:44 am

Hi there Chris,

I find dynamic components facinating.
I manufacture wood furniture in South Africa and I love using Sketchup.
Ver 7 Pro is great and would love to get involved in making dynamic models which can both re-scale and react as in doors of cupboards open and close, drawers open and close.
I am still trying to get the basics of how to make for example a cupboard that can scale and the doors can open and close etc...
I love the Idea of the cutlist and edgebanding calc's.

Very excited,
Nic
0

nic_riche 
 

Re: DC Exploration #3 - Scaling and Copying

Postby jason_maranto » Sat Oct 30, 2010 11:56 pm

I'm currently digging into DC a bit more -- I previously only used it for really simple things like setting textures and opening doors... this isn't a terribly useful model but it does showcase some of the problems I'm working on solving right now.

animcubesskp.skp


Best,
Jason.
0
I create video tutorial series about several 2D & 3D graphics programs.
User avatar
jason_maranto 
 

Re: DC Exploration #3 - Scaling and Copying

Postby Chris Fullmer » Sun Oct 31, 2010 12:22 am

Hey, thats cool. I like that!
0
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer 
SketchUp Team
SketchUp Team
 

Re: DC Exploration #3 - Scaling and Copying

Postby jason_maranto » Mon Nov 29, 2010 3:40 am

While nothing nearly as cool as the other spiral stairs here I have created my own -- just use the scale tool to pull up more.

DC spiral stairs.skp


Best,
Jason.
0
I create video tutorial series about several 2D & 3D graphics programs.
User avatar
jason_maranto 
 

Re: DC Exploration #3 - Scaling and Copying

Postby jason_maranto » Thu Dec 02, 2010 9:56 pm

Here's a scale-tool based fence that randomizes the board positions to create a more natural effect.

DC Rickety Fence.skp


Best,
Jason.
0
I create video tutorial series about several 2D & 3D graphics programs.
User avatar
jason_maranto 
 

Re: DC Exploration #3 - Scaling and Copying

Postby Trixta » Sat May 28, 2016 10:56 pm

Here are some Kitchen cabinets that I've been working on. Most proud of the Floor Drawer Unit with it's drawer boxes that scale along with the cabinet on the X axis.

Please note. This is a work in progress.
0
Win7 & SU14 Pro
User avatar
Trixta 
 

Re: DC Exploration #3 - Scaling and Copying

Postby bthomas3 » Sat Oct 01, 2016 1:21 am

Has anyone figured this out, by chance? I know it's been a while, but I have an application for it, and I'm racking my brain trying to figure out how to make it work. For mine, it's more of a "snake" component, where the user begins with one part, then selects 1 of 3 interactable "buttons" that creates a copy in one of the directions, turning the copy to fit. The link below should make sense of what I'm saying. Thanks in advance!

BT

http://forums.sketchup.com/t/help-makin ... opy/31487a

Chris Fullmer wrote:Ahh, yes I was thinking about this Jim, and I thought it was simple. But I started playing with it and in about 5 minutes I saw just how not simple it really is. The random width means that the amount of copies will vary depending on the width of the books. That is tricky!

I had a thought on placing them though. Each X should be the X of the previous (called "LastX") + the LenX of the previous (called LastLenX"). So what about each component passes its X and LenX out to a custom attribute in the parent component. So the next copy created would look to "parent!lastX" and "parent!LastLenX" to figure out its new X. Then after it sets its X and LenX, it writes its current state to the parent, overwriting the previous states and the cycle continues. So it runs like this

Copy0
X=parent!LastX + Parent!LastLenX (These values will be zero since they have not been filled yet)
LenX=3 (randomly chosen)
<<<Sends X to parent!LastX>>> (which is 0)
<<<Sends LenX to Parent!LastLenX>>> (which is 3)
Copy1
X=parent!LastX + Parent!LastLenX (Now this reduces to 0 + 3)
LenX=2
<<<Sends X to parent!LastX>>> (which is now 3)
<<<Sends LenX to Parent!LastLenX>>> (which is now 2)
Copy2
X=parent!LastX + Parent!LastLenX (Now this reduces to 3 + 2)
LenX=4
<<<Sends X to parent!LastX>>> (which is now 5)
<<<Sends LenX to Parent!LastLenX>>> (which is 4)


Anyhow, its all theoretical since I am not on an SU7 enlightened computer at the moment. I hope that makes sense. In my mind it does, but I'm sure it will probably fall apart due to something I've forgotten. Anyhow, think about it :)

Chris
0

bthomas3 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Dynamic Components

Who is online

Users browsing this forum: No registered users and 1 guest

Visit our sponsors: