Saving kb's - png or component?
-
Hi all,
I'm in the process of optimizing my SketchUp model by saving kb's.
What is more kb efficient?- Using a png image and copying it using ctrl + move x 20 (to create a row of 20 columns)
- Or importing a png, exploding it, creating a component and move copying that 20 times?
Thanks,
Ward
-
You can use the unexploded image file to make a component as well. add some geometry (draw a line), select that and the image and make a component. Then edit the component and erase the line.
-
As Csaba says, draw a line along the base of the unexploded png (for example) then hide it. Select both and make it a component. That way...if you have 20 of the things...you save 20 faces and 80 edges.
Be aware that file size does not necessarily equate to navigability. There are many models of several Mbs (because of image files) that are perfectly navigable. On the other hand, I can show you a file of only around 100Kb that will crash your computer...or at least be impossible to navigate effectively.
The use of components will save file size and is also useful if you want to edit or update said feature right across the model, but ultimately the only thing that counts as far as navigability is concerned is the number of faces and edges. -
An Image is a special kind of Component [as is a Group]. Images and Groups aren't accessible through the Component Browser, unlike 'vanilla' components... they are accessible through the Definitions-collection via the API
Each of these has a 'definition' and you place it down as an 'instance'.
Therefore the bulk of the size is in the geometry inside the definition, with each instance 'marker' adding only a small amount to the total too.
That's why exploding everything in your model will make it a lot bigger. as you then have all of that extra geometry, that has been previously locked up in 'definitions' - each definition is like a mini SKP in its own right.
When you copy an Image it becomes an Instance of the same definition, so it's not the same as having two similar Images.
An Image consists of four hidden edges and a face that has the image file applied to it as a texture [again this is actually a Material BUT it's not accessible through the Materials Browser or Materials-collection via the API, while still part of an Image]. Therefore it doesn't add a lot of size from geometry BUT its loaded image file can have an impact. If you explode an Image it reverts to its five pieces of geometry and the material is added to the standard Materials list, and applied to the face scaled to match its hxw.
So, exploding one image is unlikely to have any discernible affect on the file size, BUT if the image is used multiple times it will.
If you 'trim' the sides of the face - e.g. to match the image outline - you have obviously added some edges which will bump up the file size; but again, if you have duplicate instances of this as a component that you have made, then it's likely that the file size affect will be lessened when compared to having it all as 'raw geometry' loose in the model... -
Thanks for the comments guys.
I've learned an important lesson creating this model. I always thought components were the holy grail for a light model, turns out I was wrong...
The model had way to many faces and edges because of all the components. I replaced most components with 1 single face with a .png texture. The kb's increased a little bit but the amount of faces and edges dropped drastically.
Advertisement