• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

[Plugin] Function Plotter

Scheduled Pinned Locked Moved Plugins
2 Posts 2 Posters 4.4k 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.
  • R Offline
    remus
    last edited by remus 13 Oct 2009, 15:13

    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
    • T Offline
      TIG Moderator
      last edited by 13 Oct 2009, 15:36

      Now just 'mesh' it 😄

      Very good...

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

      TIG

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      1 / 1
      • First post
        2/2
        Last post
      Buy SketchPlus
      Buy SUbD
      Buy WrapR
      Buy eBook
      Buy Modelur
      Buy Vertex Tools
      Buy SketchCuisine
      Buy FormFonts

      Advertisement