• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Idea for ruby to reduce file size

Scheduled Pinned Locked Moved Developers' Forum
11 Posts 5 Posters 2.1k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    sketchy
    last edited by 12 Jan 2008, 00:21

    Disclaimer: I have no knowledge of Ruby scripting or what its capabilities are. But I had an idea that I thought I would share in case someone with more talent than myself was interested in kicking the idea around a little.

    Like many SU users I mostly model houses and other "built" structures. I make use of groups and components extensively. I do this for organization and to reduce file size.

    I noticed that many of my components or groups have some type of symmetry and could therefore be made up of multiple subcomponents rotated or mirrored about an axis or plane.

    Some of the Google components demonstrate this idea:radial symmetry in table.jpg

    But I immagine that for most people, including myself, it is unintuitive to model a quarter of a table and then rotate it. I model the table and then I move on. I don't take time to explode the table, make a component of 1/4 of it, then rotate it around and regroup.

    What about a ruby that would go into groups and components look for symmetry. If found it would create a component out of 1/4 (or whatever), rotate it around and delete the rest. A cylinder with 100 sides could be one poly rotated around the center point.

    Here is a link I found that has a nice flow chart for determining symmetry:
    http://www.artlandia.com/products/SymmetryWorks/tutorials/classification.html

    It seems like there would be alot of polygons that could be eliminated. Would this help with reducing animation times as well?

    So what do you ruby guys think, is this possible to do?

    1 Reply Last reply Reply Quote 0
    • S Offline
      SchreiberBike
      last edited by 12 Jan 2008, 04:39

      I do this a lot as small file sizes are necessary to keep things moving on my slow pc. It works, but there is a downside. You can't "smooth" a line between components. You can only hide it. That means the shading/rendering engine doesn't recognize that there is a continuous surface and it doesn't look as good as it could.

      Still a good idea, but not one you'd want to always use.

      1 Reply Last reply Reply Quote 0
      • D Offline
        Dave R
        last edited by 12 Jan 2008, 13:18

        Sketchy, you're right. This is a good way to help reduce file size. It would be kind of neat if this could be automated, too. John does make a good point about applying materials to components in which that has been done so caution should be exercised.

        Etaoin Shrdlu

        %

        (THERE'S NO PLACE LIKE)

        G28 X0.0 Y0.0 Z0.0

        M30

        %

        1 Reply Last reply Reply Quote 0
        • G Offline
          Gaieus
          last edited by 12 Jan 2008, 13:51

          Hi guys,

          Have a look at the attached file. If you "slice" your object (this case a circle) at its midpoints rather than at the endpoints, you can "keep" it seamless (using the good old techniques - hiding edges etc...).


          SeamlessCylinder.skp

          Gai...

          1 Reply Last reply Reply Quote 0
          • D Offline
            Dave R
            last edited by 12 Jan 2008, 13:57

            Gai, you beat me too it. I was about to post an example showing that. It's a good tip.

            Etaoin Shrdlu

            %

            (THERE'S NO PLACE LIKE)

            G28 X0.0 Y0.0 Z0.0

            M30

            %

            1 Reply Last reply Reply Quote 0
            • G Offline
              Gaieus
              last edited by 12 Jan 2008, 14:00

              Yeah, Dave, but in your other topic I realised that texture mappung is almost impossible this way...

              Gai...

              1 Reply Last reply Reply Quote 0
              • S Offline
                sketchy
                last edited by 12 Jan 2008, 15:34

                Yup Gai thats exactly what I was thinking. Does this method solve the rendering issue SchreiberBike brought up?

                And my fantasy involved an automated ruby that would to through every group/component and regroup based on symmetry. Or you could select specific groups/components. I would probably only do the whole model before sending it to LayOut, to someone via email, or posting it on a cool message board with file size limitations 😄 . I would keep a copy of the unmodified version as well.

                1 Reply Last reply Reply Quote 0
                • D Offline
                  Dave R
                  last edited by 12 Jan 2008, 16:02

                  Sketchy, Gai's method only partly helps with the rendering thing. You won't get a hard edge as you would by hiding a corner but textures would still have a problem. Imagine a tiled top on your table example. It would look like it was cut into pie-shaped segments with the tile cut on an angle. For some things like wood grain textures, you could get a look of a typical veneered top, so sometimes it could be good.

                  Etaoin Shrdlu

                  %

                  (THERE'S NO PLACE LIKE)

                  G28 X0.0 Y0.0 Z0.0

                  M30

                  %

                  1 Reply Last reply Reply Quote 0
                  • G Offline
                    Gaieus
                    last edited by 12 Jan 2008, 16:45

                    Yup, here is an example with different transitions of soft shadows (still the "original", low poly model).
                    Note that the "hardest" shadow edge is neither at a midpoint nor at an endpoint. This is not textured though - just the "clay" model (with the original Front Face) rendered in Kerky.

                    http://www.sketchucation.com/forums/scf/sas/Gallery/Gai/SeamlessCylinder.png

                    Gai...

                    1 Reply Last reply Reply Quote 0
                    • S Offline
                      sketchy
                      last edited by 13 Jan 2008, 17:03

                      Thanks for the render Gai.

                      For the sake of discussion here are the two models with textures applied. I didn't take any time to scale or move any of the textures.table with tile.jpgcylinder with wood.jpg

                      Here I took the tile texture and moved it slightly (no rotation or scaling). A pretty easy shift. I do recognize that other textures would be more problematic.table with tile2.jpg

                      1 Reply Last reply Reply Quote 0
                      • X Offline
                        xtrude
                        last edited by 13 Jul 2008, 17:14

                        Hi Sketchy,

                        Did you progress this idea at all? I'm looking for a automated process for splitting a large urban model into individual tiles.

                        Cheers

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post
                        Buy SketchPlus
                        Buy SUbD
                        Buy WrapR
                        Buy eBook
                        Buy Modelur
                        Buy Vertex Tools
                        Buy SketchCuisine
                        Buy FormFonts

                        Advertisement