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

    Yet another SphereTool

    Scheduled Pinned Locked Moved Developers' Forum
    20 Posts 3 Posters 402 Views 3 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.
    • D Offline
      driven
      last edited by driven

      hi all,
      before I go much further with my 'version' of a sphere tool, I was wondering if

      • does any other sphere plugin work 'off axes', i.e. between any two points, with it's own axis on 'line between points' ?

      • is context menu access to an options-box considered good practice?
        I use an arc because a circle crashes SU with 'followme'
        I got it to write it's own 'how I work' giff, the user only make the first two clicks, for each sphere, the points and workings will not normally be shown.
        john

      learn from the mistakes of others, you may not live long enough to make them all yourself...

      1 Reply Last reply Reply Quote 0
      • Rich O BrienR Offline
        Rich O Brien Moderator
        last edited by

        Hi John

        The only thing that comes close is the typical light insertion tools that various render apps provide.

        This looks cool. If you are looking for feature requests then I'd say having the ability to insert primitives in this manner would be a big plus.

        Right click > Insert... > Cube/Plane/Icosphere/UV Sphere/Circle/

        Torus/Cylinder/Cone/Grid

        Once choice is picked then direction (if circle, cylinder, sphere etc... then segment count would need an option also)

        Once direction is picked you can scale by dragging on the line

        Also, if geometry created obeyed Thomthom's QuadFace rule it'd be sweet

        Finally.....I'd pay for it.

        As it currently stands I'd have no real use for it as I've a component library that contains all of the above in various formats for quick insertion.

        Download the free D'oh Book for SketchUp πŸ“–

        1 Reply Last reply Reply Quote 0
        • D Offline
          driven
          last edited by

          @ Rich,
          I doubt it's worth paying for, it's just been my long term 'try and write a plugin' project because I thought a 'sphere between points' would be useful to me.

          I have thought of incorporating TT UV quads if I can understand it, but the basic parameters I'm looking at are.

          1. segments for path
          2. segments for arc
          3. tolerance/clearance i.e. a ball for a race, click race edges and it resizes with clearance. [handy for 3d printing]
            face material?

          Cylinder is easy if I keep it married to linetool.rb and I was accidentally making torus's yesterday , so maybe I could add those.
          I was also thinking of adding a grid plane, after second click, pausing while a profile is added on plane, then continuing to lathe that profile instead.

          for now, is the basic tool worth pursuing?
          you need 3 or more side as it is a lathe tool
          john

          learn from the mistakes of others, you may not live long enough to make them all yourself...

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            @driven said:

            is context menu access to an options-box considered good practice?

            Make it an option - as the context menu can quickly fill out when you have a few plugins installed. If my plugin doesn't have an options window I usually add a simple toggle menu in one of the top menus. (Like in QuadFace Tools)

            Let me know if you need clarification on how to implement quads compatible with QuadFace Tools.

            Thomas Thomassen β€” SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply Reply Quote 0
            • D Offline
              driven
              last edited by

              I think this will give me 'quad faces'

                      # quadify edges...
                      edges = gents.grep(Sketchup;;Edge)
                      edges.each{ |edge|  edge.soft = true; edge.smooth = true; edge.casts_shadows = false; }
              

              but does anyone know how to write the uv sphere-mapping to a newly formed sphere, I have all the faces, and edges in arrays from the making and also the centre, top and bottom
              john

              learn from the mistakes of others, you may not live long enough to make them all yourself...

              1 Reply Last reply Reply Quote 0
              • thomthomT Offline
                thomthom
                last edited by

                No, you set [ruby]edge.casts_shadows = false[ruby] only on the diagonal edge dividing the two triangles making up the quad.

                QuadFace.png

                The other edges can be soft,smooth, hidden whatever - but do not set Cast Shadow to false for these.

                Thomas Thomassen β€” SketchUp Monkey & Coding addict
                List of my plugins and link to the CookieWare fund

                1 Reply Last reply Reply Quote 0
                • D Offline
                  driven
                  last edited by

                  @thomthom said:

                  No, you set edge.casts_shadows = false only on the diagonal edge dividing the two triangles making up the quad.

                  The other edges can be soft,smooth, hidden whatever - but do not set Cast Shadow to false for these.

                  I couldn't see how hiding those others helped, which is why I asked, so thanks.

                  Can I expose the diagonals through code, then soften them?
                  would I need to collect faces.each face.edge_loop.verticies, add an edge between [1] and [-1] then hide those?
                  will that do it?

                  learn from the mistakes of others, you may not live long enough to make them all yourself...

                  1 Reply Last reply Reply Quote 0
                  • thomthomT Offline
                    thomthom
                    last edited by

                    Does your code currently generate true native quads? (planar)

                    Thomas Thomassen β€” SketchUp Monkey & Coding addict
                    List of my plugins and link to the CookieWare fund

                    1 Reply Last reply Reply Quote 0
                    • D Offline
                      driven
                      last edited by

                      It is just a 'followme' sphere, so I assume yes, I can only show the diagonals by distorting after completion.
                      john

                      learn from the mistakes of others, you may not live long enough to make them all yourself...

                      1 Reply Last reply Reply Quote 0
                      • thomthomT Offline
                        thomthom
                        last edited by

                        Basically, a QuadFace compatible quad is either:

                        1. a native quad (face with four vertices)

                        2. two triangles made to act as one unit (separated by an edges that is soft+smooth and cast_shadow: false)

                        The reason that cast_shadow needs to be false for the diagonal is that in case the whole mesh is made soft+smooth there needs to be a way to detect what is the diagonal - and since cast_shadow is on by default and it appear most people don't use this property I made that the "magic marker" for the diagonal. This allowed for non-planar quads in SketchUp.

                        Thomas Thomassen β€” SketchUp Monkey & Coding addict
                        List of my plugins and link to the CookieWare fund

                        1 Reply Last reply Reply Quote 0
                        • D Offline
                          driven
                          last edited by

                          @thomthom said:

                          Basically, a QuadFace compatible quad is either:

                          1. a native quad (face with four vertices)

                          So, it should be ok as is?

                          learn from the mistakes of others, you may not live long enough to make them all yourself...

                          1 Reply Last reply Reply Quote 0
                          • thomthomT Offline
                            thomthom
                            last edited by

                            It would work. But maybe Rich has hoped for a triangulated version so things can be manipulated without ending up with the edge that SU's AutoFold feature adds. But then again, QuadFace Tools had a function to add triangulation and there is my recent AutoSmooth plugin that both addresses this.

                            Thomas Thomassen β€” SketchUp Monkey & Coding addict
                            List of my plugins and link to the CookieWare fund

                            1 Reply Last reply Reply Quote 0
                            • D Offline
                              driven
                              last edited by

                              @Rich

                              is this what you mean?edges as per 'quadface tools' definition
                              @TT... does this look right, I applied to all edges, but could just do the diagonals if that's better.

                              learn from the mistakes of others, you may not live long enough to make them all yourself...

                              1 Reply Last reply Reply Quote 0
                              • Rich O BrienR Offline
                                Rich O Brien Moderator
                                last edited by

                                @John

                                Thomthom nailed it. I triangulate everything using the QuadFace tools.

                                It will make for a better exchange of data from on app to another.

                                Download the free D'oh Book for SketchUp πŸ“–

                                1 Reply Last reply Reply Quote 0
                                • D Offline
                                  driven
                                  last edited by

                                  @Rich
                                  would this do what you need
                                  just an off axes sphere, with tri's

                                  learn from the mistakes of others, you may not live long enough to make them all yourself...

                                  1 Reply Last reply Reply Quote 0
                                  • Rich O BrienR Offline
                                    Rich O Brien Moderator
                                    last edited by

                                    There's something funky with that because none of Thomthom Ring Select/Loop Select are finding the edges.

                                    Even trying to convert it doesn't work.

                                    Thom can help here more than me. I do understand the property needed but generation of that property through code is not my bag....

                                    Unless I am missing the obvious πŸ˜•

                                    Download the free D'oh Book for SketchUp πŸ“–

                                    1 Reply Last reply Reply Quote 0
                                    • thomthomT Offline
                                      thomthom
                                      last edited by

                                      @driven said:

                                      @TT... does this look right, I applied to all edges, but could just do the diagonals if that's better.

                                      No - just the diagonal should have cast_shadow set to false. Cast Shadows set to false is what marks an edge as separating the two triangles of a quad. The border edges should not have this set.

                                      Also, I see that lots of your edges are 1 segment Curve entities. Why is that?

                                      Thomas Thomassen β€” SketchUp Monkey & Coding addict
                                      List of my plugins and link to the CookieWare fund

                                      1 Reply Last reply Reply Quote 0
                                      • Rich O BrienR Offline
                                        Rich O Brien Moderator
                                        last edited by

                                        D'oh....

                                        missed the edges that parallel

                                        Download the free D'oh Book for SketchUp πŸ“–

                                        1 Reply Last reply Reply Quote 0
                                        • D Offline
                                          driven
                                          last edited by

                                          @thomthom said:

                                          No - just the diagonal should have cast_shadow set to false.

                                          I'll exclude the original edges...

                                          @unknownuser said:

                                          Also, I see that lots of your edges are 1 segment Curve entities. Why is that?

                                          It's a rotated arc so before I split them with the diagonals, you can scale using 'move-tool' on the cardinal points.

                                          for uv is it better if I explode the edge first?
                                          john

                                          learn from the mistakes of others, you may not live long enough to make them all yourself...

                                          1 Reply Last reply Reply Quote 0
                                          • thomthomT Offline
                                            thomthom
                                            last edited by

                                            For UVs I won't matter. It was just odd to see a one segment Curve. I noticed it because the Smooth and Sort property was gone in the Entity Info when I selected one of them.

                                            Thomas Thomassen β€” SketchUp Monkey & Coding addict
                                            List of my plugins and link to the CookieWare fund

                                            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