[Plugin] Surface Plotter

[Plugin] Surface Plotter

Postby jzer7 » Thu Jan 01, 2009 1:12 am

A few days ago, another poster asked a question of how to model an organic material. It seemed to follow a mathematical equation.

I modified a plugin from Jim Foltz (eq_grapher.rb) to plot curves in 3 dimensions, and later expanded it to create surfaces with the right normals. This is an example generated by the new script:


I prepared this as an exercise to become familiar with Ruby and Sketchup's API (and for fun), so I haven't thought much about what others might want to see here. So comments are welcomed.

To try it:
1. Install script

2. Menu is: Plugins -> Plot surface
3. Enter an equation (say "x.abs + 3*x") in Ruby's format.
4. The script will then iterate for values of x between -10 and 10 and y between -10 and 10 and compute a value for z.
5. If the value for z is greater than 100 or less than 100 it will be ignored
6. A surface composed by triangles between those points will be generated around (0,0,0)
7. All entities (lines and faces) will be inside a group (called "surface")

Also, this is my first attempt at writing a plugin, so let me know if I broke any common practice regarding posting of scripts in this forum.




Re: [Plugin] Surface Plotter

Postby Phil Rader, AIA » Thu Jan 01, 2009 2:47 am

looks cool

Phil Rader, AIA 
Premium Member
Premium Member

Re: [Plugin] Surface Plotter

Postby bianhai » Thu Jan 01, 2009 3:09 am

Happy New Year!


Re: [Plugin] Surface Plotter

Postby MALAISE » Thu Jan 01, 2009 9:40 am

Happy new year and thanks too.

La Connaissance n'a de valeur que partagée
User avatar

Re: [Plugin] Surface Plotter

Postby GUNAWAN W » Sun Jan 04, 2009 10:32 am

truly idon't know how to use equation :lol:,
any example how to make helix stair? :bounce:

thank's Jzer7 just downloaded.


Re: [Plugin] Surface Plotter

Postby Fletch » Tue Jan 06, 2009 9:09 pm

Thanks, jzer7... :thumb:

can you help give a little tut for us idiots? I'm specifically interested in using your tool to create a geometrically/mathematically accurate mirror lens for creating a work SketchUp/Kerkythea telescope.

so if you could show how to find an equation, and apply it to creating a lens for instance, that would help me much.


Twilight Render

Re: [Plugin] Surface Plotter

Postby tomot » Wed Jan 21, 2009 1:15 am

jzer7 thanks for this, I almost missed this SU surface grapher.

I was interested in finding out why the Z direction is so much greater that X and Y for example: A Hyperbolic Paraboloid is supposed to look as per the site below http://www.archimy.com/ while the results in SU look like the blue image in this attachment, while the small back image at the btm has the correct proportion. I have not been able to adjust the code, to reflect the proportion.

Can you make it possible to enter specific x, y, and z ranges, in order to generate isosurfaces as per the 2nd attachment?

PluginStore Author
PluginStore Author

Re: [Plugin] Surface Plotter

Postby plot-paris » Wed Jan 21, 2009 1:28 pm

cool plugin, jzer7.

you asked for comments, so here you go (of course I know that you only just started writing plugins, but one should always have dreams :) ):

- as tomot mentioned, it would be cool to define the range of X and Y for the grid. would make the plugin a lot more versatile.
- it would be cool to add a drop down list with example equations for noobs like me, who have no idea about maths :oops:
- at the moment, once you pressed the 'OK' button there is a short period of shocked silence, when nothing happens (SU works frantically to get the surface done. but it doesn't tell us). therefore it would be great to introduce some sort of status report, like progress.rb

- and now to get entirely carried away: imagine the following scenario: you have a little window, where to type in the equation (together with some drop-down-examples), as well as the grid dimensions (X and Y values).
if you hit the 'Generate' button without typing in any equation, the surface will turn out flat. now you can enter your equation and then hit the 'Update' button, whereupon the surface is being updated - either with showing a status bar to indicate the progress... Or, and that would be absolutely ingenious, you would see the surface being updated in real-time, as it is done with the 'Soap Skin & Bubble' plugin!!! :berserk:
just imagine how cool that would be; changing one figure in you equation and seeing the surface change before your eyes - would make comprehending equations a lot easier (and would therefore be a fantastic tool for school teachers.)
User avatar

Re: [Plugin] Surface Plotter

Postby kwistenbiebel » Wed Jan 21, 2009 1:38 pm

plot-paris wrote:just imagine how cool that would be; changing one figure in you equation and seeing the surface change before your eyes - would make comprehending equations a lot easier (and would therefore be a fantastic tool for school teachers.)

That is exactly how the Grasshopper plugin for Rhino works. It is fabulous.
you can for instance use some algorythm to define the array and form of your windows in a curved building.
By changing a parameter in the algorythm, the whole positioning and dimensions will change automatically. Very cool stuff and definitely the future.
If the algorythms could be translated to comprehensible forms or definitions, this is a superb design tool.
This design method is referred to as 'parametric modeling'. (not to confuse with parametric design a la Revit and Archicad which is not at the same level).


Re: [Plugin] Surface Plotter

Postby pilou » Wed Jan 21, 2009 2:16 pm

Take a look at the free K3DSurf ;)
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
Top SketchUcator

Re: [Plugin] Surface Plotter

Postby hankyolin » Thu Aug 26, 2010 8:09 am

Good and powerful!


SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago

Ad Machine 


Return to Plugins

Who is online

Users browsing this forum: aniruthan, naq and 16 guests