• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

In Development: Subdivide and Smooth

Scheduled Pinned Locked Moved Developers' Forum
262 Posts 65 Posters 40.8k 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.
  • J Offline
    justry
    last edited by 30 Mar 2008, 20:42

    I tried out Rick's script. Is it just me or is it real slow?! I tried it on the pillow example so I can compare with whaat's time; the first iteration took like 2.5 minutes, and the second iteration made sketchup go unresponsive for over 10 minutes till I had to terminate it.

    Maybe it's my machine; I'm on a pentium 4 2.4 GHz processor with 512 Mb of RAM. I was wondering what machine you're on whaat?

    1 Reply Last reply Reply Quote 0
    • R Offline
      RickW
      last edited by 30 Mar 2008, 21:43

      My subdivide project started out last year (almost exactly - March 31) - see http://groups.google.com/group/Ruby-API/browse_thread/thread/4eb73c8ffe38a62d# for the thread where I did a preview. Anyway, the script is unfinished, and is likely to stay that way. I don't need (or want) to try to compete with Whaat on this πŸ˜„

      Whaat's interface is significantly more advanced, and perhaps the internal workings are as well. It is what I imagined for my script, but did not have the time to do. I think Whaat's product, when released, will be a fantastic addition to SketchUp. I released mine very quietly (so as to not upstage Whaat's work) to provide a temporary solution for users who needed a subdivide script while they waited for Whaat to complete his impressive work.

      My best wishes to Whaat for great success with this script! I'm waiting for it eagerly, as well! πŸ˜„

      As for speed, the first iteration on the pillow example took about 15 seconds. A second iteration (though unnecessary IMHO) took over 10 minutes due to the large number of faces. Hopefully, Whaat has some speed advantages to go with the jazzy interface πŸ˜„

      RickW
      [www.smustard.com](http://www.smustard.com)

      1 Reply Last reply Reply Quote 0
      • J Offline
        justry
        last edited by 30 Mar 2008, 23:35

        Yeah I know a second iteration wasn't necessary, I just wanted to test the performance of the script on a high-poly model.

        The first one took you 15 seconds though??! My machine's gotta be real slow 😞 . Gotta get me a new one!

        Thanks for the quick reply Rick, and your script's great too man. All of them actually πŸ‘ .

        And waiting for that amazing script of yours whaat!

        1 Reply Last reply Reply Quote 0
        • R Offline
          RickW
          last edited by 31 Mar 2008, 16:01

          I think our machines are comparable processor speed, so maybe it's a memory issue (running 4GB RAM here). Regardless, my script is slow compared to Whaat's, since I didn't really get past the proof-of-concept stage into optimizing.

          RickW
          [www.smustard.com](http://www.smustard.com)

          1 Reply Last reply Reply Quote 0
          • W Offline
            Whaat
            last edited by 31 Mar 2008, 18:36

            Subdivide and Smooth version 1.0 Final Features List

            • Low-poly proxy subdivision modeling
            • Automatic updating of subdivision surfaces while editing a proxy (optional)
            • Material inheritance of proxy model to subdivision surface (optional)
            • Creasing tool - allows toggling of fully creased edges or vertices
            • Up to 4 subdivision and smooth iterations
            • Unlimited proxy subdivision models can exist in the same file
            • Subdivision and smoothing of a single isolated face
            • Robust subdivision algorithm that can handle almost any geometry
            • Subdivision without smoothing (linear subdivision) - also triangulates all meshes and maintains material assignment
            • Mesh smoothing (vertex averaging) without subdivision - maintains material assignment
            • Extrude tool - useful for modeling clean geometry that subdivides well
            • Knife subdivide tool (aka 'Zorro')

            Testing begins this week! (sorry, invitation only). I will keep you all posted on the release date!

            Whaat

            SketchUp Plugins for Professionals

            1 Reply Last reply Reply Quote 0
            • R Offline
              remus
              last edited by 31 Mar 2008, 18:39

              Mmmmmm, exciting stuff, i look forward to it whaat, thanks again for all the hard work πŸ‘

              http://remusrendering.wordpress.com/

              1 Reply Last reply Reply Quote 0
              • K Offline
                kwistenbiebel
                last edited by 31 Mar 2008, 19:54

                I am not sure what all the features exactly mean, but it does sound really cool πŸ˜‰.

                1 Reply Last reply Reply Quote 0
                • A Offline
                  a4chitect
                  last edited by 31 Mar 2008, 20:21

                  whaat you rock! I can't wait for this release! you are one of those for whome the human cloning was meant in the first place πŸ˜„ its interesting that you mention mesh smoothing (without subdivision), does it mean we will be able to smooth contour generated surfaces so they will be more natural in shape? good luck with testing

                  1 Reply Last reply Reply Quote 0
                  • F Offline
                    Fletch
                    last edited by 2 Apr 2008, 20:33

                    😲 can't wait to see it, Whaat...
                    (on the 'invite' list, on the 'invite' list, on the 'invite' list)
                    http://www.kerkythea.net/phpBB2/images/smiles/eusa_pray.gif

                    Fletch
                    Twilight Render Cross-platform Plugin for SketchUp on PC or Mac

                    1 Reply Last reply Reply Quote 0
                    • S Offline
                      solo
                      last edited by 2 Apr 2008, 20:37

                      By the look and feel of it I think the name should be 'Organix' as it does give one the abllity to model organically.

                      http://www.solos-art.com

                      If you see a toilet in your dreams do not use it.

                      1 Reply Last reply Reply Quote 0
                      • W Offline
                        Whaat
                        last edited by 2 Apr 2008, 20:53

                        @a4chitect said:

                        does it mean we will be able to smooth contour generated surfaces so they will be more natural in shape? good luck with testing

                        Can someone post a complicated contour generated surface? I would like to test this. Thanks.

                        SketchUp Plugins for Professionals

                        1 Reply Last reply Reply Quote 0
                        • R Offline
                          remus
                          last edited by 2 Apr 2008, 21:27

                          Is this any good whaat? might be a bit simple for your purposes, but it was good fun to make πŸ˜›


                          whaat contours.skp

                          http://remusrendering.wordpress.com/

                          1 Reply Last reply Reply Quote 0
                          • W Offline
                            Whaat
                            last edited by 2 Apr 2008, 21:57

                            @remus said:

                            Is this any good whaat? might be a bit simple for your purposes, but it was good fun to make πŸ˜›

                            Thanks remus,

                            Here are the results:

                            First image is the original surface generated from contours
                            Second image is the same surface after performing vertex averaging (same number of polys)
                            Third image is the surface after performing two subdivision and smooth iterations

                            It seems like vertex averaging will be very useful to generate more realistic landscape surfaces without increasing poly-count. The only problem is that the the resulting surface will no longer coincide with the contours, so real-world accuracy is lost. There is no easy way to change this so don't ask πŸ˜„


                            original surface


                            Mesh smoothing (vertex averaging without subdivision)


                            after two subdivision and smooth iterations

                            SketchUp Plugins for Professionals

                            1 Reply Last reply Reply Quote 0
                            • T Offline
                              todd burch
                              last edited by 2 Apr 2008, 23:02

                              @whaat said:

                              There is no easy way to change this so don't ask πŸ˜„

                              Just tell them it's an erosion feature thrown in for no charge.

                              1 Reply Last reply Reply Quote 0
                              • M Offline
                                Mike Lucey
                                last edited by 3 Apr 2008, 00:58

                                @unknownuser said:

                                @whaat said:

                                There is no easy way to change this so don't ask πŸ˜„

                                Just tell them it's an erosion feature thrown in for no charge.

                                πŸ˜†

                                Support us so we can support you! Upgrade to Premium Membership!

                                1 Reply Last reply Reply Quote 0
                                • A Offline
                                  a4chitect
                                  last edited by 3 Apr 2008, 13:07

                                  brilliant whaat - exactly as expected - the surface is much more natural, as for the accuracy - I guess the the vertex-averaged surface could meet the controur lines by simply moving it along the Z axis a bit, and even if they can't touch everywhere - the result is better for its smoothness, you can't take the contours for benchmarking since their accuracy is fairly limited too πŸ˜‰

                                  maybe performing a test could prove my point>

                                  1. create a curved surface with the Smoove tool

                                  2. generate contours either by the dedicated script, or by intersecting with equidistant planes

                                  3. group contour lines and create a surface by using the sandbox tools

                                  4. paint this surface a different color from the original

                                  5. make a copy (change the color) of this new surface and apply your script

                                  6. compare original surface with both new surfaces

                                  whaat thanks for making sketchup better, can't wait for you to release.

                                  1 Reply Last reply Reply Quote 0
                                  • G Offline
                                    GUNAWAN W
                                    last edited by 3 Apr 2008, 23:19

                                    oh dear God, please give this guy more power to made this script available to everyone soon. β˜€

                                    1 Reply Last reply Reply Quote 0
                                    • K Offline
                                      kwistenbiebel
                                      last edited by 3 Apr 2008, 23:45

                                      Yummy !
                                      Terrific results as far as I see.

                                      This together with a 'wrap texture around object' feature could possibly make other 3d party organic model software trash can material.

                                      Good stuff Whaat!

                                      1 Reply Last reply Reply Quote 0
                                      • W Offline
                                        wikii
                                        last edited by 3 Apr 2008, 23:57

                                        I wrote script below to simulate whaat's.It works,but not perfect

                                        
                                        class Smooth_contours
                                           attr_reader ;author,;date,;ver
                                           def initialize
                                              @author="Wikii"
                                              @date="20080402"
                                              @ver="0.01"
                                              @mm=Sketchup.active_model
                                              @fs=@mm.selection.to_a.delete_if{|x| x.class!=Sketchup;;Face}
                                              do_Smooth_contours if @fs.length>0
                                           end
                                           def center_point point3ds
                                              re=Geom;;Point3d.new(0,0,0)
                                              num=0
                                              0.upto( point3ds.length-1){|x|
                                                 if point3ds[x].class==Geom;;Point3d
                                                    re.x+=point3ds[x].x
                                                    re.y+=point3ds[x].y
                                                    re.z+=point3ds[x].z
                                                    num+=1.0
                                                 else #weighted
                                                    re.x+=point3ds[x][0].x*point3ds[x][1]
                                                    re.y+=point3ds[x][0].y*point3ds[x][1]
                                                    re.z+=point3ds[x][0].z*point3ds[x][1]
                                                    num+=point3ds[x][1]
                                                 end
                                              }
                                              re.x/=num
                                              re.y/=num
                                              re.z/=num
                                              re
                                           end
                                           def open_vertex? v
                                              v.edges.each{|x|
                                                 return true if x.faces.to_a.delete_if{|y| !@fs.include?(y)}.length<2
                                              }
                                              return nil
                                           end
                                           def face_center fc
                                              Geom;;Point3d.new center_point(fc.vertices.to_a.collect{|xx| xx.position})
                                           end
                                           def do_Smooth_contours
                                              group_entities=@mm.active_entities.add_group.entities
                                              vertices=[]
                                              vertices_info={}
                                              @mm.start_operation "123"
                                              n=0
                                              @fs.each{|x|
                                                 n+=1.0
                                                 Sketchup;;set_status_text "Finished #{(n/@fs.length*1000).to_i/10.0}%"
                                                 cen=face_center(x)
                                                 x.vertices.each{|y|
                                                    if !vertices.include?(y) and !open_vertex?(y)
                                                       vertices<<y
                                                       #~ tmp0=y.position
                                                       #~ tmp=center_point(y.faces.to_a.collect{|z| [face_center(z),z.area]})
                                                       tmp=center_point(y.faces.to_a.collect{|z| face_center(z)})
                                                       #~ tmp0.z=(tmp0.z+tmp.z)/2.0
                                                       #~ tmp0.z=(tmp0.z+tmp.z)/2.0
                                                       #~ vertices_info[y]=center_point([tmp,tmp0]           )
                                                       vertices_info[y]=tmp
                                                    end
                                                 }
                                              }
                                              @ee=Sketchup.active_model.active_entities
                                              puts @ee
                                              vertices.each{|x|
                                                 t=Geom;;Transformation.new(vertices_info[x]-x.position)
                                                 @ee.transform_entities(t, x)
                                              }
                                              @mm.commit_operation
                                           end
                                        end
                                        Smooth_contours.new
                                        
                                        
                                        1 Reply Last reply Reply Quote 0
                                        • A Offline
                                          a4chitect
                                          last edited by 4 Apr 2008, 12:00

                                          thanks wikii, nice script you've put together so quickly! here is a resulting surface for illustration. and your script with a plugins menu entry added to just place in the plugins folder


                                          http://img255.imageshack.us/img255/8932/smoothscripteo5.th.jpg


                                          wikii's smooth surface script


                                          illustration comparing surface accuracy after smooth

                                          1 Reply Last reply Reply Quote 0
                                          • 1
                                          • 2
                                          • 5
                                          • 6
                                          • 7
                                          • 8
                                          • 9
                                          • 13
                                          • 14
                                          • 7 / 14
                                          7 / 14
                                          • First post
                                            125/262
                                            Last post
                                          Buy SketchPlus
                                          Buy SUbD
                                          Buy WrapR
                                          Buy eBook
                                          Buy Modelur
                                          Buy Vertex Tools
                                          Buy SketchCuisine
                                          Buy FormFonts

                                          Advertisement