• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ 30% Off | Artisan 2 on sale until April 30th 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.
  • 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
      • R Offline
        RayOchoa
        last edited by 4 Apr 2008, 21:58

        It would be great if you could do a script that could make high poly models low poly. It would be awsome.

        CaR DeSiGnS bY mE
        http://ray-ochoa.com

        1 Reply Last reply Reply Quote 0
        • J Offline
          jenujacob
          last edited by 6 Apr 2008, 17:00

          holy moly! this is simply terrrific!
          how long did the sub division take coen?

          1 Reply Last reply Reply Quote 0
          • E Offline
            erikB
            last edited by 7 Apr 2008, 15:10

            amazing 😲
            Coen, would it also be possible to leave the 'knife -like features' on the claw as they where ( I mean not subdivised (and rasor scharp πŸ˜„ ) or is the whole model always subdivised ?
            erikB

            1 Reply Last reply Reply Quote 0
            • S Offline
              sk.lion
              last edited by 8 Apr 2008, 06:36

              wow, i cant believe my eyes, this is going to be an awsome script to use!

              1 Reply Last reply Reply Quote 0
              • W Offline
                Whaat
                last edited by 8 Apr 2008, 19:46

                Hi all,

                I am looking for one more beta tester at the moment. I need someone with a lot of free time on their hands (anyone??) I am worried that the current testers are too busy to test and post bugs. Is there anyone out there who could commit to spending a LOT of time testing over the next week? First come first serve. Please respond right here.

                SketchUp Plugins for Professionals

                1 Reply Last reply Reply Quote 0
                • D Offline
                  Daniel S
                  last edited by 8 Apr 2008, 19:54

                  Here!

                  1 Reply Last reply Reply Quote 0
                  • C Offline
                    chippwalters
                    last edited by 8 Apr 2008, 20:02

                    I can help. I already sent you a private message yesterday about this. I'm currently doing a project which could benefit. Plus, I've experience in scripted solutions.
                    http://www.vuetoolbar.com/VueToolbarCover/default.htm

                    Currently working with Cross-Reality technologies

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

                      @daniel s said:

                      Here!

                      OK, you got the job! I expect a two page bug report on my desk tomorrow morning. πŸ˜›
                      Seriously, though, please give as much feedback as you have time for. I will send you a PM later today. Thanks.

                      SketchUp Plugins for Professionals

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

                        @chippwalters said:

                        I can help. I already sent you a private message yesterday about this. I'm currently doing a project which could benefit. Plus, I've experience in scripted solutions.
                        http://www.vuetoolbar.com/VueToolbarCover/default.htm

                        I'm sure a lot of people's projects could benefit. What I need is someone who has time to test and post bugs and feedback. If you are still interested I will send you a PM.

                        SketchUp Plugins for Professionals

                        1 Reply Last reply Reply Quote 0
                        • C Offline
                          chippwalters
                          last edited by 8 Apr 2008, 20:08

                          Yes. Still interested πŸ˜„

                          Currently working with Cross-Reality technologies

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

                            @chippwalters said:

                            Yes. Still interested πŸ˜„

                            OK thanks! I'll PM you later today.

                            SketchUp Plugins for Professionals

                            1 Reply Last reply Reply Quote 0
                            • G Offline
                              GUNAWAN W
                              last edited by 9 Apr 2008, 18:21

                              @whaat said:

                              Hi all,

                              I am looking for one more beta tester at the moment. I need someone with a lot of free time on their hands (anyone??) I am worried that the current testers are too busy to test and post bugs. Is there anyone out there who could commit to spending a LOT of time testing over the next week? First come first serve. Please respond right here.

                              I'm in, i have free time.

                              1 Reply Last reply Reply Quote 0
                              • D Offline
                                dylan
                                last edited by 9 Apr 2008, 18:26

                                That is amazing to see what Coen has posted. This script is something special!

                                http://dmdarchitecture.co.uk/

                                1 Reply Last reply Reply Quote 0
                                • C Offline
                                  chippwalters
                                  last edited by 10 Apr 2008, 05:04

                                  A preview using the latest SubD Beta. This is my first 'playing around' model. Couple of interesting workflow techniques. You can set up SubD so you only work on half of a model, and the proxy components are updated as fast as possible. You can update them with a fast and low SubD setting, then when you're finished, you can update the proxies with a higher SubD setting, as this picture shows.

                                  Also, you can 'crease' edges and vertices, so you have more control over how tight the SubD patching is fitted. A very, very cool plugin which, after taking a bit of time to learn, will be most valuable in everyone's toolset!

                                  The rendering is Podium overlayed with a line render from SU.

                                  http://www.gadgetplugins.com/chippstuff/planesketch3.jpg

                                  Currently working with Cross-Reality technologies

                                  1 Reply Last reply Reply Quote 0
                                  • J Offline
                                    juju
                                    last edited by 10 Apr 2008, 06:44

                                    😲 All together now, SWEET! 😍

                                    Save the Earth, it's the only planet with chocolate.

                                    1 Reply Last reply Reply Quote 0
                                    • K Offline
                                      kwistenbiebel
                                      last edited by 10 Apr 2008, 11:21

                                      That's cool stuff...So if I understand well, you can keep on modeling the low poly proxy and it will automatically update the rounded object right?

                                      What would happen if the low poly object has textures applied?
                                      Do they hold ?

                                      @Whaat,
                                      Great job man !

                                      1 Reply Last reply Reply Quote 0
                                      • C Offline
                                        chippwalters
                                        last edited by 10 Apr 2008, 11:28

                                        @unknownuser said:

                                        So if I understand well, you can keep on modeling the low poly proxy and it will automatically update the rounded object right?

                                        Yup...that's the idea. IMO, Dale has done a darn good job with workflow. While you can auto apply textures, it does take longer. But, you can apply them at the end when you upscale your Sub-Divisions for your final model. For me, it's a pretty intuitive interface and workflow.

                                        Currently working with Cross-Reality technologies

                                        1 Reply Last reply Reply Quote 0
                                        • E Offline
                                          erikB
                                          last edited by 10 Apr 2008, 11:42

                                          Keeps looking fantastic !! 😍
                                          Come on Beta testers find those bugs (if there are any ?? πŸ˜„ )so we all can appriciate this amazing ruby !!

                                          Whaat, fantastic scripting,
                                          erikB

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

                                          Advertisement