sketchucation logo sketchucation
    • Login
    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!
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download

    [Plugin] Function Plotter

    Scheduled Pinned Locked Moved Plugins
    2 Posts 2 Posters 4.4k Views 2 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.
    • R Offline
      remus
      last edited by remus

      def f(x,y)
      
      (Math.sin(x*y))
      
      end
      
      n= -30
      m= 30
      
      pts = []
      
      for x in n..m
      
        for y in n..m
      
          x2 = x.to_f/10
      
          y2 = y.to_f/10
      
          z = f(x2,y2)
      
          pts.push([x2,y2,z])
      
        end
      Sketchup.active_model.entities.add_curve(pts)
      
      pts.clear
      
      end
      
      #Sketchup.active_model.entities.add_curve(pts)
      
      #pts.each {|x| Sketchup.active_model.entities.add_cpoint(x)}
      

      quite optimistic to call it a plugin, but its good fun.

      Just plug a function of x and y in to the top def, put your range in to n and m and run the whole lot through jims webconsole.

      Makes lots of pretty patterns πŸ˜„


      fn1.jpg


      fn2.jpg


      fn3.jpg

      http://remusrendering.wordpress.com/

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

        Now just 'mesh' it πŸ˜„

        Very good...

        See also 'K_tools.rb' for similar ideas...

        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