sketchucation logo sketchucation
    • Login
    1. Home
    2. renderiza
    3. Posts
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    โš ๏ธ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 98
    • Posts 783
    • Groups 2

    Posts

    Recent Best Controversial
    • RE: [Plugin] FaceSplit v1.0.3

      Warning!
      The examples shown below are not features the current version support. These are ideas for possible future updates so please don't be confused by it. ๐Ÿ˜‰

      From vertices to centeroid (Current function of plugin)

      Currently the plugin has no problem when dealing with multiple faces because the existing edges are no sliced. We only add new vertex in center of geometry and reuse the existing face vertices after that.

      From medians to centeroid

      In this case we do split the existing edges in half and that cause effect we see in the 3rd row of the image. Each face will exponentially increase the number of edges in which the script will divide causing different results each time.

      The example in the 2nd row of the image was able to maintain the same amount of edges per face because each color represent a group. Notice none of the same color groups can touch each other.

      http://s9.postimg.org/4w3s8mc9r/post.png

      Conclusion
      Will have to figure out a way to reproduce the results in the 2nd row of image without having to make multiple groups. Not sure how at the moment but maybe if I open this to discussion in the development forum it can get solved quickly.

      When I saw the results on row number 3 of image I sort of like what I saw. Maybe this effect is what someone might want who knows. ๐Ÿ˜•


      glro: That would be ideal for the plugin to reach to that level but first I need to figure out simple stuff like the ones mentioned above. Thanks for your input really appreciate it! ๐Ÿ‘

      iichiversii: Hey long time no see!!! Glad you found a use for it. ๐Ÿ‘

      tomot: Yes above I tried demonstrated some of the issues to solve before adding the feature of splitting from medians to centroid.

      posted in Plugins
      renderizaR
      renderiza
    • RE: [Plugin] FaceSplit v1.0.3

      @mitcorb said:

      Something like: split by angles to centroid, split by medians to centroid, split by angles to medians, split by angles, medians through centroid?

      Correct! ๐Ÿ‘

      @mitcorb said:

      Or, split by bisect angles, bisect edges, ??

      Was not thinking of this option but, if I am not mistaken TIG's TriangulateAllFaces is accomplished this way.

      posted in Plugins
      renderizaR
      renderiza
    • RE: [Plugin] FaceSplit v1.0.3

      Thank you for giving a link to the Discussion that started it all. Also here is another that played a big part in optimizing the code.

      Apart from dividing the face like in the second row of the image, was thinking to add additional options like the ones below that. The trick here is to provide an easy to understand user interface where you can change the options.

      http://s24.postimg.org/pqyn23cv9/plans.png

      posted in Plugins
      renderizaR
      renderiza
    • RE: Triangulate triangles ?

      Here is the plugin main page... http://sketchucation.com/forums/viewtopic.php?p=495689#p495689

      I used FaceSplit as name but if you guys come up with better name that is short & catchy then it will be easy to change.'

      Cheers! ๐Ÿ‘

      posted in Plugins
      renderizaR
      renderiza
    • [Plugin] FaceSplit v1.0.3

      [pre:zunpmadi]Authors:: Anar | Dan Rathbun | Pilou | Renderiza | TIG
      Plugin Name:: FaceSplit
      Version:: 1.0.3
      Date:: 11/4/2013
      Cost:: Free[/pre:zunpmadi]
      FaceSplit

      %(#909090)[Split faces up a variety of ways. This only works as expected on convex faces.

      For plugin compatibility it is recommended to instal] Internet Explorer 9 or higher.

      http://s11.postimg.org/utsik66sz/Face_Split215.png

      Available at
      sketchUcation
      pluginStore
      click here

      ______________________________________________________________________

      Web-Dialog

      http://s18.postimg.org/6mnop92dl/split_dlg.png

      posted in Plugins
      renderizaR
      renderiza
    • RE: Triangulate triangles ?

      Here is the logo...

      Big:

      http://s8.postimg.org/f4mis2579/Face_Split.png

      Small:

      http://s14.postimg.org/4n72xxfrh/Face_Split54.png

      posted in Plugins
      renderizaR
      renderiza
    • RE: Triangulate triangles ?

      I am glad you liked "FaceSplit"! ๐Ÿคฃ

      posted in Plugins
      renderizaR
      renderiza
    • RE: Triangulate triangles ?

      Ok I will start working on that ASAP!!!

      By the way you like the name "FaceSplit"?

      posted in Plugins
      renderizaR
      renderiza
    • RE: Triangulate triangles ?

      With the help of Dan Rathbun the code was improved! Because string manipulation in Ruby can be slow he figured a way to do it without strings.

      Here is the new code...

        def csplit()
          #
          model = Sketchup.active_model
          ents = model.active_entities
          sel = model.selection
          faces = sel.grep(Sketchup;;Face)
          #
          model.start_operation('csplit')
            #
            faces.each do |face|
              #
              sum = Geom;;Point3d.new(0,0,0)
              #
              verts = face.vertices
              n = verts.size.to_f
              # use API Geom;;Point3d.+ instance method;
              verts.each {|v| sum += ORIGIN.vector_to(v.position) }
              #
              avg = Geom;;Point3d.new( sum.x/n, sum.y/n, sum.z/n )
              #
              verts.each {|v| ents.add_line( avg, v ) }
              #
            end # each face
            #
          model.commit_operation
          #
        rescue => e
          #
          puts "Error <#{e.class.name}; #{e.message} >"
          puts e.backtrace if $VERBOSE
          #
          model.abort_operation
          #
        else # when no errors;
          #
          sel.clear
          #
        end # csplit()
      
        csplit()
      
      

      If you have the time make sure to thank Dan...Cheers!

      posted in Plugins
      renderizaR
      renderiza
    • RE: From string to not a string

      Dan Rathbun I can't thank you enough you sir are brilliant!

      posted in Developers' Forum
      renderizaR
      renderiza
    • RE: From string to not a string

      @dan rathbun said:

      NO.. you are correct. They are just a string char at that point.

      So my mistake. (you got me) ๐Ÿ˜ฎ

      My life is complete!!! ๐Ÿคฃ

      @dan rathbun said:

      ... with this (remember that module Enumerable is mixed into class Array) :

          v = face.vertices
      >     v.each_with_index {|vert,i|
      >       @addx << " + v[#{i}].position.x"
      >       @addy << " + v[#{i}].position.y"
      >       @addz << " + v[#{i}].position.z"
      >     }
      

      That is great! With your suggestion I now don't need to start with an array that has a value!

      Here is updated code...

      model = Sketchup.active_model
      ents = model.active_entities
      sel = model.selection
      faces = sel.grep(Sketchup;;Face)
      @addx = []
      @addy = []
      @addz = []
      
      model.start_operation('csplit')
      
        faces.each do |face|
          @addx.clear
          @addy.clear
          @addz.clear
      
          v = face.vertices
          num = v.length
        
          v.each_with_index {|vert,i|
            @addx << " + v[#{i}].position.x"
            @addy << " + v[#{i}].position.y"
            @addz << " + v[#{i}].position.z"
          }
         
          ax = @addx * ","
          sumx = ax.delete ","
         
          ay = @addy * ","
          sumy = ay.delete ","
         
          az = @addz * ","
          sumz = az.delete ","
         
          cx = eval("#{sumx}")
          cy = eval("#{sumy}")
          cz = eval("#{sumz}")
         
          px = cx / num
          py = cy / num
          pz = cz / num
      
          v.each do |vertex|
            p1 = [px, py, pz]
            p2 = vertex
            line = ents.add_line p1,p2
          end
      
        end
        sel.clear
      model.commit_operation
      

      I appreciate your help as always Dan!!! ๐Ÿ’š

      posted in Developers' Forum
      renderizaR
      renderiza
    • RE: From string to not a string

      Will this cause problem even if v on lines 5,6,7,15,16 & 17 is part of a string and not a variable?

      Thanks!

      posted in Developers' Forum
      renderizaR
      renderiza
    • RE: Triangulate triangles ?

      The following code will work on all geometry types like triangle, square, ect...

      model = Sketchup.active_model
      ents = model.active_entities
      sel = model.selection
      faces = sel.grep(Sketchup;;Face)
      @addx = []
      @addy = []
      @addz = []
      
      model.start_operation('csplit')
        faces.each do |face|
          @addx.clear
          @addy.clear
          @addz.clear
      
          v = face.vertices
          num = v.length
      
          v.each_with_index {|vert,i|
            @addx << " + v[#{i}].position.x"
            @addy << " + v[#{i}].position.y"
            @addz << " + v[#{i}].position.z"
          }
      
          ax = @addx * ","
          sumx = ax.delete ","
      
          ay = @addy * ","
          sumy = ay.delete ","
      
          az = @addz * ","
          sumz = az.delete ","
      
          cx = eval("#{sumx}")
          cy = eval("#{sumy}")
          cz = eval("#{sumz}")
      
          px = cx / num
          py = cy / num
          pz = cz / num
      
          v.each do |vertex|
            p1 = [px, py, pz]
            p2 = vertex
            line = ents.add_line p1,p2
          end
      
        end
        sel.clear
      model.commit_operation
      
      

      Note: To test code above you can copy & paste it to one of this ruby consoles...
      http://renderizastudio.blogspot.com/2013/06/top-ruby-consoles-for-sketchup.html

      posted in Plugins
      renderizaR
      renderiza
    • RE: From string to not a string

      Yay! ๐Ÿ˜

      Here is updated code...

      model = Sketchup.active_model
      ents = model.active_entities
      sel = model.selection
      faces = sel.grep(Sketchup;;Face)
      @addx = ["v[0].position.x"]
      @addy = ["v[0].position.y"]
      @addz = ["v[0].position.z"]
      
      model.start_operation('csplit')
      
        faces.each do |face|
          @addx.clear
          @addy.clear
          @addz.clear
          @addx = ["v[0].position.x"]
          @addy = ["v[0].position.y"]
          @addz = ["v[0].position.z"]
       
          v = face.vertices
          num = v.length
          i = 1
         
          while i < num  do
            @addx << " + v[#{i}].position.x"
            @addy << " + v[#{i}].position.y"
            @addz << " + v[#{i}].position.z"
            i += 1
          end
         
          ax = @addx * ","
          sumx = ax.delete ","
         
          ay = @addy * ","
          sumy = ay.delete ","
         
          az = @addz * ","
          sumz = az.delete ","
         
          cx = eval("#{sumx}") # v[0].position.x + v[1].position.x + v[2].position.x
          cy = eval("#{sumy}") # v[0].position.y + v[1].position.y + v[2].position.y
          cz = eval("#{sumz}") # v[0].position.z + v[1].position.z + v[2].position.z
         
          px = cx / num
          py = cy / num
          pz = cz / num
      
          v.each do |vertex|
            p1 = [px, py, pz]
            p2 = vertex
            line = ents.add_line p1,p2
          end
      
        end
        sel.clear
      model.commit_operation
      

      If you think the code can improve please let me know! ๐Ÿ‘

      posted in Developers' Forum
      renderizaR
      renderiza
    • From string to not a string

      Hi,

      I have this problem where I have a string that I want to use as a line of code(not sure what to call it).

      Here is my example...

      sumx = "v[0].position.x + v[1].position.x + v[2].position.x"

      I want sumx to solve that math equation...Is this possible

      
      model = Sketchup.active_model
      ents = model.active_entities
      sel = model.selection
      faces = sel.grep(Sketchup;;Face)
      @addx = ["v[0].position.x"]
      @addy = ["v[0].position.y"]
      @addz = ["v[0].position.z"]
      
      model.start_operation('csplit')
      
        faces.each do |face|
          v = face.vertices
          num = v.length
          i = 1
          
          while i < num  do
            @addx << " + v[#{i}].position.x"
            @addy << " + v[#{i}].position.y"
            @addz << " + v[#{i}].position.z"
            i += 1
          end
          
          ax = @addx * ","
          sumx = ax.delete ","
          
          ay = @addy * ","
          sumy = ay.delete ","
          
          az = @addz * ","
          sumz = az.delete ","
      
          cx = sumx # v[0].position.x + v[1].position.x + v[2].position.x ... 
          cy = sumy # v[0].position.y + v[1].position.y + v[2].position.y ...
          cz = sumz # v[0].position.z + v[1].position.z + v[2].position.z ...
          
          px = cx / num
          py = cy / num
          pz = cz / num
      
          v.each do |vertex|
            p1 = [px, py, pz]
            p2 = vertex
            line = ents.add_line p1,p2
          end
         
        end
        sel.clear
      model.commit_operation
      

      Thanks!

      posted in Developers' Forum
      renderizaR
      renderiza
    • RE: Triangulate triangles ?

      It works! ๐Ÿ˜

      http://s9.postimg.org/3oou2krkf/yay.jpg

      Here is the code...

      
      model = Sketchup.active_model
      ents = model.active_entities
      sel = model.selection
      faces = sel.grep(Sketchup;;Face)
      
      model.start_operation('csplit')
        faces.each do |face|
          v = face.vertices
      
          cx = v[0].position.x + v[1].position.x + v[2].position.x
          cy = v[0].position.y + v[1].position.y + v[2].position.y   
          cz = v[0].position.z + v[1].position.z + v[2].position.z 
      
          px = cx / 3
          py = cy / 3 
          pz = cz / 3 
      
          v.each do |vertex|
            p1 = [px, py, pz]
            p2 = vertex
            line = ents.add_line p1,p2
          end
        end
        sel.clear
      model.commit_operation
      

      Note: At the moment the above code works with triangles only.

      For squares we can use the code bellow...

      
      model = Sketchup.active_model
      ents = model.active_entities
      sel = model.selection
      faces = sel.grep(Sketchup;;Face)
      
      model.start_operation('csplit')
        faces.each do |face|
          v = face.vertices
      
          cx = v[0].position.x + v[1].position.x + v[2].position.x + v[3].position.x
          cy = v[0].position.y + v[1].position.y + v[2].position.y + v[3].position.y  
          cz = v[0].position.z + v[1].position.z + v[2].position.z + v[3].position.z 
      
          px = cx / 4
          py = cy / 4 
          pz = cz / 4 
      
          v.each do |vertex|
            p1 = [px, py, pz]
            p2 = vertex
            line = ents.add_line p1,p2
          end
        end
        sel.clear
      model.commit_operation
      
      posted in Plugins
      renderizaR
      renderiza
    • RE: Triangulate triangles ?

      Thanks guys! Will definitely study your suggestions. ๐Ÿ‘

      posted in Plugins
      renderizaR
      renderiza
    • RE: [Extension][$] CompoScene v2.0.2 (Updated)

      @valerostudio said:

      A+++ This is fantastic. I can't tell you how many times I setup each of these passes on the fly.

      Glad you found it useful...Cheers!

      posted in Plugins
      renderizaR
      renderiza
    • RE: Triangulate triangles ?

      Wish you success or better yet brilliance in your designs! ๐Ÿ’š

      posted in Plugins
      renderizaR
      renderiza
    • RE: Triangulate triangles ?

      If the second time you apply script you do each face individually inside a group, then you get very pretty geometry. ๐Ÿ˜›

      http://s15.postimg.org/3zyfm7ayz/pp1.jpg

      posted in Plugins
      renderizaR
      renderiza
    • 1 / 1