SketchUcation Premium Membership

 

 

[Plugin] Function Plotter

[Plugin] Function Plotter

Postby remus » Tue Oct 13, 2009 4:13 pm

Code: Select all
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 :)
Please, register (free) to access all the attachments on the forums.
Last edited by thomthom on Tue Dec 08, 2009 9:40 pm, edited 1 time in total.
Reason: Just cleaning up and organizing the Plugin forum. Correcting [Plugin] tag
remus
 
Posts: 8055
Joined: Fri Nov 30, 2007 8:48 am
Location: UK
Name: remus

Re: [plugin] Function Plotter

Postby TIG » Tue Oct 13, 2009 4:36 pm

Now just 'mesh' it :D

Very good...

See also 'K_tools.rb' for similar ideas...
TIG
User avatar
TIG
Global Moderator
 
Posts: 14308
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago

Artisan Organic Toolset - a set of powerful organic modeling tools.

Premium Members get 20% discount!

Ad Machine
Robot
 
Posts: 2012


Return to Plugins

Who is online

Users browsing this forum: edmart, Flippie123, Google Bot, jeanluc_16, mrpop, shape, vortel01 and 11 guests