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

    [Plugin] Facewarp

    Scheduled Pinned Locked Moved Plugins
    6 Posts 4 Posters 10.3k Views 4 Watching
    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.
    • B Offline
      Builder Boy
      last edited by

      My original post was here. I still got tired of dividing edges(by the way, does anyone know how to do this with ruby?), then welding them back together, then filling out a lot of dialog boxes. So, I made my own plugin to do this. I give you:

      Facewarp.rb

      All my plugins

      1 Reply Last reply Reply Quote 0
      • Rich O BrienR Offline
        Rich O Brien Moderator
        last edited by

        Lots of vanishing lines when drawing? And not all faces created?

        FaceWarp_Error.png

        Download the free D'oh Book for SketchUp πŸ“–

        1 Reply Last reply Reply Quote 0
        • TIGT Offline
          TIG Moderator
          last edited by

          http://code.google.com/apis/sketchup/docs/ourdoc/edge.html#split ???

          TIG

          1 Reply Last reply Reply Quote 0
          • B Offline
            Builder Boy
            last edited by

            @unknownuser said:

            Lots of vanishing lines when drawing? And not all faces created?

            This plugin does not always work when 2 points have the same location. Also, may give unexpected results when 3 points are collinear.

            @tig said:

            http://code.google.com/apis/sketchup/docs/ourdoc/edge.html#split ???

            This will only split a line into 2 segments with controllable proportions, I am looking for something more like this:
            edge.divide(5) # for 5 equal-length segments

            All my plugins

            1 Reply Last reply Reply Quote 0
            • Didier BurD Offline
              Didier Bur
              last edited by

              @unknownuser said:

              I am looking for something more like this:
              edge.divide(5) # for 5 equal-length segments

              You can do that with edge.split, just create a loop 0.upto(4) for instance to divide in 5 segments...

              DB

              1 Reply Last reply Reply Quote 0
              • TIGT Offline
                TIG Moderator
                last edited by

                @builder boy said:

                @tig said:

                http://code.google.com/apis/sketchup/docs/ourdoc/edge.html#split ???

                This will only split a line into 2 segments with controllable proportions, I am looking for something more like this:
                edge.divide(5) # for 5 equal-length segments

                It'd be easily enough to make a custom 'divide' method that works as you want - you know the edge's starting length and therefore the length of one divided part. So simply iterate through the edge the number of divisions-1 nibbling off the appropriate proportion as another edge until you are done. I don't recommend extending the Edge class but more like this...
                self.divide(edge,5)
                calling this

                def divide(edge=nil, num=nil)
                  return nil if not edge or edge.class!=Sketchup;;Edge
                  return nil if not num or not num.class==Fixnum or num<=1
                  len=edge.length
                  bit=len/num.to_f
                  num.times{
                    begin
                      nedge=edge.split(bit/len)
                      if nedge
                        edge=nedge 
                        len=edge.length
                      end#if
                    rescue
                      puts 'Divide Error'
                    end
                  }
                end
                

                Which splits the specified edge into the specified parts...

                TIG

                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