sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Clone PolygonMesh

    Scheduled Pinned Locked Moved Developers' Forum
    23 Posts 4 Posters 919 Views 4 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.
    • jiminy-billy-bobJ Offline
      jiminy-billy-bob
      last edited by

      Holy sheet!
      I wanna play with this!! πŸ˜„

      So how did you do the UI in the end? Is it a webdialog or external?

      25% off Skatter for SketchUcation Premium Members

      1 Reply Last reply Reply Quote 0
      • jolranJ Offline
        jolran
        last edited by

        Hi. Jiminy πŸ˜„ wasent expecting any response..

        It's a standard webdialog. Pure JS and HTML.
        The canvas and nodes are all SVG. Then the rest are plain html elements. like Tooltips, contextmenus etc.

        I switched to D3.js. Not a compability layer, but have some nice selectors and methods.
        It has such nice zooming and panning. Also very fast!
        You should check it out! People think one can only use it with SVG, but that is not true.

        It needed quite a bit of Javascript code to get the interaction working, since d3 is quite lowlevel. There are no solution for handling multiproperty nodes. There's layouts, but I'm basically only using the selectors and the zoom/pan functions.
        Everything is programmed from scratch. Connections, nodes etc.. So I am expecting hickups here and there..

        1 Reply Last reply Reply Quote 0
        • jiminy-billy-bobJ Offline
          jiminy-billy-bob
          last edited by

          Would you be willing to upload your project on github? I would love to take a look at how you did that. And maybe help if I can. πŸ˜„

          If that's ok with you of course.

          25% off Skatter for SketchUcation Premium Members

          1 Reply Last reply Reply Quote 0
          • jolranJ Offline
            jolran
            last edited by

            No sorry.

            I havent decided the future for this plugin yet. 😐

            Was thinking a free version and then if things progress well maybe a more advanced Pro version. That will keep everyone happy.

            That also means restrictions on the license, so Github will not fit.

            I hope you understand. 😳

            This may change. Plugin's status isent release ready anyway.
            I did not post the gif to show off. Just was so god damn happy it worked I needed to share my joy.

            BTW I appreciate you offering help. PM me for questions regarding code. No Problem.

            1 Reply Last reply Reply Quote 0
            • jiminy-billy-bobJ Offline
              jiminy-billy-bob
              last edited by

              @jolran said:

              I hope you understand. 😳

              I completely understand! If you're going to monetize your work, don't make it public πŸ˜‰

              I asked because I was thinking about a plugin using a similar node-based UI (A material editor for render engines). But I haven't found any convincing JS framework (You told me about JSplumb a while back, but it doesn't seem really strong and stable).
              I guess I'll have to make my own, like you did πŸ˜„

              As for the help I can provide, I'm curently working on a scattering plugin. So let me know if you have any question regarding this topic.

              25% off Skatter for SketchUcation Premium Members

              1 Reply Last reply Reply Quote 0
              • jolranJ Offline
                jolran
                last edited by

                πŸ˜„ Thanks for the understanding! It's a touchy subject.

                A material editor! Is it possible to hook up to thoose from within Sketchup ? I thought they kept their code closed. The Render-engines that is.

                Then, I shouldent rule out Jsplumb completely, if I was you.
                It wasent an easy decision to restart from scratch and change library.
                For the record I had no stability problems with Jsplumb. It was more a matter of performance in combination with JQ UI, and a few features I did not manage to implement.

                A few things have changed since then for Jsplumb. It's not dependent of Jquery UI draggable for one. = faster.
                It has Jquery style syntax, so you would feel at home directly, don't need to learn about SVG, if you don't know it already that is. Also more compatible with browsers than d3.
                Has inbuilt events for connections, so it's MUCH easier to set up. But it's quite a large library. 10K +

                So if you are not 100% dependent on zooming/multidragging go for jsplumb. At least give it a go. You will get going in a couple of days, Ive seen your layerspanel. No prob.

                That said. You would have a lot of fun learning d3, when you passed the init threshold.
                My goal was to learn as little as possible, cause it's easy to get stuck with experiments πŸ˜„ Amazing stuff they do..

                Scattering plugin, you say. Sounds very interesting indeed. Can be as complex as you like it, I presume.

                @unknownuser said:

                So let me know if you have any question regarding this topic.

                I sure will! And the same goes for you. Can PM snippets and shiat.. πŸ˜„

                1 Reply Last reply Reply Quote 0
                • jiminy-billy-bobJ Offline
                  jiminy-billy-bob
                  last edited by

                  @jolran said:

                  A material editor! Is it possible to hook up to thoose from within Sketchup ? I thought they kept their code closed. The Render-engines that is.

                  The data has to be stored somewhere. At least for Vray, the properties are stored as an XML structure in the material's attributes.

                  @jolran said:

                  So if you are not 100% dependent on zooming/multidragging go for jsplumb.

                  Well I think I would be. I mean, this king of UI without zooming is kind of cumbersome, don't you think?

                  Anyway, thanks a lot for all the tips πŸ˜‰

                  25% off Skatter for SketchUcation Premium Members

                  1 Reply Last reply Reply Quote 0
                  • jolranJ Offline
                    jolran
                    last edited by

                    @unknownuser said:

                    The data has to be stored somewhere. At least for Vray, the properties are stored as an XML structure in the material's attributes.

                    Allright!
                    Can't say I havent thought about the idea to include this functionality into the plugin,
                    to be honest.
                    But the risk of feature freenzy and bloat is to big, so I probably stick to only a design/modeling tool.

                    @unknownuser said:

                    Well I think I would be. I mean, this king of UI without zooming is kind of cumbersome, don't you think?

                    Yeah, I guess you are right. Come to think of it, you might be even more dependent of "special-nodes", displaying textures and stuff.

                    1 Reply Last reply Reply Quote 0
                    • tt_suT Offline
                      tt_su
                      last edited by

                      For fastest performance of "copying" a PolygonMesh use the number of points and polygons in the new argument. Then populate the points and finally add the polygons with indices.

                      I agree that it'd be nice to have .dup and .clone make a fresh copy.

                      1 Reply Last reply Reply Quote 0
                      • jolranJ Offline
                        jolran
                        last edited by

                        Yes, Thanks. I used that and noticed some increase in performance.
                        But I have kind of abandoned the PolygonMesh for now. At least during the previewing state.

                        I experimented building my own meshclass with indexing of points. Instead of using PolygonMesh class as a Point container.

                        Keep arrays of indexes and a Hash containing Points. And the Transformation only deals with the uniq points(Hash) then. Quite a lot of speed improvements!

                        The advantage here is that I can reuse the objects somewhat, while I can't purge/clear(?) a PolygonMesh. So the GC should work a little less.

                        I'm sure you guys have/are doing something similar or more advanced...

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

                        Advertisement