• Login
sketchucation logo sketchucation
  • Login
๐Ÿค‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

[Plugin] Surface Plotter

Scheduled Pinned Locked Moved Plugins
11 Posts 11 Posters 15.3k 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.
  • J Offline
    jzer7
    last edited by 1 Jan 2009, 00:12

    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:

    Sample plot (xy + xx - y*y/2)

    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
      Initial version
    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.

    Enjoy,


    Juan

    1 Reply Last reply Reply Quote 0
    • P Offline
      Phil Rader AIA
      last edited by 1 Jan 2009, 01:47

      looks cool

      http://www.philrader.com

      1 Reply Last reply Reply Quote 0
      • B Offline
        bianhai
        last edited by 1 Jan 2009, 02:09

        Happy New Year!
        Thanks!

        1 Reply Last reply Reply Quote 0
        • M Offline
          MALAISE
          last edited by 1 Jan 2009, 08:40

          Happy new year and thanks too.

          MALAISE

          La Connaissance n'a de valeur que partagรฉe

          1 Reply Last reply Reply Quote 0
          • G Offline
            GUNAWAN W
            last edited by 4 Jan 2009, 09:32

            truly idon't know how to use equation ๐Ÿ˜†,
            any example how to make helix stair? ๐ŸŽ‰

            thank's Jzer7 just downloaded.

            1 Reply Last reply Reply Quote 0
            • F Offline
              Fletch
              last edited by 6 Jan 2009, 20:09

              Thanks, jzer7... ๐Ÿ‘

              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.

              thanks.

              Fletch
              Twilight Render Cross-platform Plugin for SketchUp on PC or Mac

              1 Reply Last reply Reply Quote 0
              • T Offline
                tomot
                last edited by 21 Jan 2009, 00:15

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

                #1:
                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.

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


                Hyperbolic Paraboloid.png


                surface.png

                [my plugins](http://thingsvirtual.blogspot.ca/)
                tomot

                1 Reply Last reply Reply Quote 0
                • P Offline
                  plot-paris
                  last edited by 21 Jan 2009, 12:28

                  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 ๐Ÿ˜ณ

                  • 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!!!
                    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.)

                  1 Reply Last reply Reply Quote 0
                  • K Offline
                    kwistenbiebel
                    last edited by 21 Jan 2009, 12:38

                    @plot-paris said:

                    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).

                    1 Reply Last reply Reply Quote 0
                    • pilouP Offline
                      pilou
                      last edited by 21 Jan 2009, 13:16

                      Take a look at the free K3DSurf ๐Ÿ˜‰

                      Frenchy Pilou
                      Is beautiful that please without concept!
                      My Little site :)

                      1 Reply Last reply Reply Quote 0
                      • H Offline
                        hankyolin
                        last edited by 26 Aug 2010, 07:09

                        Good and powerful!

                        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