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

    [Plugin] EP_Fasteners. Creates 3d printable threaded UPDATED

    Scheduled Pinned Locked Moved Plugins
    39 Posts 19 Posters 17.7k Views 19 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.
    • pagejaws2P Offline
      pagejaws2
      last edited by pagejaws2

      *** Updated 5/05/2015 Fixes for the items mentioned below, added quality settings and added the Safer_Observer code as asked.

      Hi, Attached is a plugin for making usable bolts, nuts, and washers, as well as threaded holes and drilled holes. The holes can glue to one or two faces and cut openings on both sides. I've tested it in 2014 and 2015. Looks nicer in 2015.

      A simple tutorial video is: https://youtu.be/YtZUDkUfg0M

      I would appreciate any feedback,

      Thanks! Jay Watson
      *** UPDATED ***
      4/29/2015 - Updated with fixes for most everything mentioned below. Thanks for your comments!
      Choose quality, faster, handles international numbers and sizes, handles very small
      triangle sizes by scaling...

      5/05/2015 - Added Safer_Observer code per Sketchup extension warehouse request.


      Version 1.0.4

      1 Reply Last reply Reply Quote 0
      • cottyC Offline
        cotty
        last edited by

        Nice video, will have a look at the plugin asap, thanks for sharing!

        my SketchUp gallery

        1 Reply Last reply Reply Quote 0
        • Bob JamesB Offline
          Bob James
          last edited by

          Does the fact that some of the results have reversed faces have any impact on printing?

          i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60

          1 Reply Last reply Reply Quote 0
          • Dave RD Offline
            Dave R
            last edited by

            Very interesting tool. I can see that being useful for a lot of things.

            Bob has a good point and question about reversed faces. In your video, when you made the Phillips head screw, there were reversed faces on the head. On the underside of the head it appears there's also multiple co-planar faces z-fighting.

            Is there a way to increase the number of sides in the circle to make smoother threads?

            Etaoin Shrdlu

            %

            (THERE'S NO PLACE LIKE)

            G28 X0.0 Y0.0 Z0.0

            M30

            %

            1 Reply Last reply Reply Quote 0
            • OxerO Offline
              Oxer
              last edited by

              Interesting plugin but in OS X & Sketchup 2015 64bit the EyePhysics Fastener Menu window is empty, nothing in Ruby Console.

              Empty window.jpg

              "The result is the end what is important is the process" by Oxer
              [http://www.oxervision.blogspot.com/(http://www.oxervision.blogspot.com/)]

              1 Reply Last reply Reply Quote 0
              • ntxdaveN Offline
                ntxdave
                last edited by

                I have not downloaded the plugin yet but looks like it could be very useful.

                Would like to see options for metal and wood screws.

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

                  hi Jay,

                  as Oxer points out none of your html will show on a mac...

                  The primary reason is you are using 'non' ruby, window only paths...

                  If I change for e.g. to

                   @@HTMLFile = File.join(__dir__,"HTML","EP_Fasteners.html")
                  

                  they do work on a mac...

                  Once running 'thru holes' work but the plugin fails at the build stage for any with thread detail...
                  It 'beachballs' i.e. 'freezes' at this step...
                  goes no further, SU must be 'force quit'
                  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
                  • pagejaws2P Offline
                    pagejaws2
                    last edited by

                    @bob james said:

                    Does the fact that some of the results have reversed faces have any impact on printing?

                    That was why I zoomed in on it in the video. That was not normal. The build process is careful to order the faces correctly. I believe I may have an error on the 1/2" coarse specification.

                    Thanks!

                    1 Reply Last reply Reply Quote 0
                    • pagejaws2P Offline
                      pagejaws2
                      last edited by

                      @driven said:

                      hi Jay,

                      as Oxer points out none of your html will show on a mac...

                      The primary reason is you are using 'non' ruby, window only paths...

                      If I change for e.g. to

                       @@HTMLFile = File.join(__dir__,"HTML","EP_Fasteners.html")
                      

                      they do work on a mac...

                      Once running 'thru holes' work but the plugin fails at the build stage for any with thread detail...
                      It 'beachballs' i.e. 'freezes' at this step...
                      [attachment=0:2zjahov9]<!-- ia0 -->hole_crash.png<!-- ia0 -->[/attachment:2zjahov9]
                      john

                      Hi John, Thanks! I haven't tested anything on Mac. I will modify the HTML entries and repost. Perhaps with all of the html correct, it will run for you. If not I would be very pleased if you could help me isolate the problems!

                      Thanks,
                      Jay

                      1 Reply Last reply Reply Quote 0
                      • pagejaws2P Offline
                        pagejaws2
                        last edited by

                        Here is an Updated Plugin **(v1.0.1)**with the phillips head faces corrected as noted by Bob and Dave, and the HTML paths updated as described by Driven, so they should work on Macs too...

                        Thanks! Jay


                        v1.0.1

                        1 Reply Last reply Reply Quote 0
                        • Dave RD Offline
                          Dave R
                          last edited by

                          Thanks for fixing the 1/2" bolt. It looks like the nuts could use some attention, too. Top faces are reversed at least on the 1/2 and 1/4 in. nuts.

                          nuts.png

                          What about making the threads smoother? Any chance for an option to adjust that?

                          Etaoin Shrdlu

                          %

                          (THERE'S NO PLACE LIKE)

                          G28 X0.0 Y0.0 Z0.0

                          M30

                          %

                          1 Reply Last reply Reply Quote 0
                          • OxerO Offline
                            Oxer
                            last edited by

                            The HTMLs work now on Mac but when you try to create some element it appears a error message in Ruby Console, here the error messages:

                            setStatus('Creating a METRIC DRILLEDHOLE');
                            continue DRILLEDHOLE in METRIC 
                            4.0
                            create_drilled_hole d=0,40cm  l=0,00cm
                            Error; #<ArgumentError; Cannot convert "0.0" to Length>
                            /Users/Oxer/Library/Application Support/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPFasteners.rb;56;in `to_l'
                            /Users/Oxer/Library/Application Support/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPFasteners.rb;56;in `onPlaceComponent'
                            setStatus('Creating a METRIC BOLT');
                            continue BOLT in METRIC 
                            create bolt  Hex d=-1.0 p=-1.0 l=3,00cm No
                            Error; #<ArgumentError; Cannot convert "0.0" to Length>
                            /Users/Oxer/Library/Application Support/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPFasteners.rb;56;in `to_l'
                            /Users/Oxer/Library/Application Support/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPFasteners.rb;56;in `onPlaceComponent'
                            setStatus('Creating a METRIC NUT');
                            continue NUT in METRIC 
                            Error; #<ArgumentError; Cannot convert "24.000mm" to Length>
                            /Users/Oxer/Library/Application Support/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPNut.rb;124;in `to_l'
                            /Users/Oxer/Library/Application Support/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPNut.rb;124;in `performOK'
                            /Users/Oxer/Library/Application Support/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPNut.rb;82;in `block in InitializeDialog'
                            SketchUp;1;in `call'
                            setStatus('Creating a METRIC WASHER');
                            continue WASHER in METRIC 
                            create_washer id=-2,54cm od=-2,54cm t=-2,54cm
                            Error; #<ArgumentError; Cannot convert "0.0" to Length>
                            /Users/Oxer/Library/Application Support/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPFasteners.rb;56;in `to_l'
                            /Users/Oxer/Library/Application Support/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPFasteners.rb;56;in `onPlaceComponent'
                            setMeasurementType('METRIC');
                            setStatus('Creating a METRIC TAPPEDHOLE');
                            continue TAPPEDHOLE in METRIC 
                            Error; #<ArgumentError; Cannot convert "0.0" to Length>
                            /Users/Oxer/Library/Application Support/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPTappedHole.rb;28;in `to_l'
                            /Users/Oxer/Library/Application Support/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPTappedHole.rb;28;in `create'
                            /Users/Oxer/Library/Application Support/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPFastenersMenu.rb;39;in `continue'
                            /Users/Oxer/Library/Application Support/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPFastenersMenu.rb;56;in `block in InitializeDialog'
                            SketchUp;1;in `call'
                            

                            And the EyePhisics Fastener Menu window isn't refreshed automatically when you reopen it, see the image below.

                            Fastener Menu window.jpg

                            "The result is the end what is important is the process" by Oxer
                            [http://www.oxervision.blogspot.com/(http://www.oxervision.blogspot.com/)]

                            1 Reply Last reply Reply Quote 0
                            • micioneM Offline
                              micione
                              last edited by

                              Ruby Console:
                              SU 2015
                              Windows 7

                              setMeasurementType('SAE');
                              setStatus('Creating a METRIC TAPPEDHOLE');
                              continue TAPPEDHOLE in METRIC
                              Error: #<ArgumentError: Cannot convert "0.0" to Length>
                              C:/Users/Utente/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPTappedHole.rb:28:in to_l' C:/Users/Utente/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPTappedHole.rb:28:in create'
                              C:/Users/Utente/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPFastenersMenu.rb:39:in continue' C:/Users/Utente/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPFastenersMenu.rb:56:in block in InitializeDialog'
                              C:/Users/Utente/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPFastenersMenu.rb:90:in call' C:/Users/Utente/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPFastenersMenu.rb:90:in execute_script'
                              C:/Users/Utente/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPFastenersMenu.rb:90:in performOK' C:/Users/Utente/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPFastenersMenu.rb:54:in block in InitializeDialog'
                              SketchUp:1:in call' setMeasurementType('METRIC'); setStatus('Creating a METRIC BOLT'); continue BOLT in METRIC create bolt Socket d=-1.0 p=-1.0 l=3,0cm No Error: #<ArgumentError: Cannot convert "0.0" to Length> C:/Users/Utente/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPFasteners.rb:56:in to_l'
                              C:/Users/Utente/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPFasteners.rb:56:in onPlaceComponent' attribute value not defined: img_width returning from add_context_menu_handler - nothing selected returning from add_context_menu_handler - nothing selected returning from add_context_menu_handler - nothing selected setMeasurementType('METRIC'); setStatus('Creating a METRIC WASHER'); continue WASHER in METRIC create_washer id=~ -2,5cm od=~ -2,5cm t=~ -2,5cm Error: #<ArgumentError: Cannot convert "0.0" to Length> C:/Users/Utente/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPFasteners.rb:56:in to_l'
                              C:/Users/Utente/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPFasteners.rb:56:in onPlaceComponent' setMeasurementType('METRIC'); setStatus('Creating a METRIC NUT'); continue NUT in METRIC Error: #<ArgumentError: Cannot convert "34.000mm" to Length> C:/Users/Utente/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPNut.rb:124:in to_l'
                              C:/Users/Utente/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPNut.rb:124:in performOK' C:/Users/Utente/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPNut.rb:82:in block in InitializeDialog'
                              SketchUp:1:in `call'

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

                                This will reset the dialog on a mac

                                      @@dialog.show()
                                      @@dialog.execute_script('location.reload(true);')
                                

                                The issue I have is with threaded thru holes, both breeds...
                                the first threaded thru hole takes minutes [many], a second of the same is instant...
                                a change in the params will revert to slow-mo...

                                BTW: what are the observers for, if possible it is best not to have them on mac SU...
                                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
                                • D Offline
                                  driven
                                  last edited by

                                  Jay,
                                  also, both the above error messages contain commas as decimal separators, so I assume your code isn't handling them...
                                  there are some posts in the developer forum on the topic...
                                  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
                                  • pagejaws2P Offline
                                    pagejaws2
                                    last edited by

                                    @driven said:

                                    This will reset the dialog on a mac

                                          @@dialog.show()
                                    >       @@dialog.execute_script('location.reload(true);')
                                    

                                    The issue I have is with threaded thru holes, both breeds...
                                    the first threaded thru hole takes minutes [many], a second of the same is instant...
                                    a change in the params will revert to slow-mo...

                                    BTW: what are the observers for, if possible it is best not to have them on mac SU...
                                    john

                                    Hi, the Observers are what let it create the 2nd component and glue it to the 2nd face. Otherwise
                                    I couldn't let you use component place to set the first hole location.

                                    Part of the speed issue is creating all of the geometry in one Geom::PolygonMesh. When I tried just calculating one threads worth and duplicating it offset by a thread, the results were not as good... but it was much faster! I expect that this can be faster, and if there is enough interest, i will try to make some time to work on it again.

                                    1 Reply Last reply Reply Quote 0
                                    • pagejaws2P Offline
                                      pagejaws2
                                      last edited by

                                      @oxer said:

                                      The HTMLs work now on Mac but when you try to create some element it appears a error message in Ruby Console, here the error messages:
                                      [code]setStatus('Creating a METRIC DRILLEDHOLE');
                                      continue DRILLEDHOLE in METRIC
                                      4.0
                                      create_drilled_hole d=0,40cm l=0,00cm
                                      Error: #<ArgumentError: Cannot convert "0.0" to Length>

                                      Ah, Thanks! Now I feel provincial.
                                      I am stuck in the U.S. mindset for decimal places. πŸ‘Š

                                      I will go back through the code and try and find all of the decimal place biases I've put in.
                                      Please accept my apologies! I will post another patch in a day or two, if you would be kind enough to test it again after that I would appreciate more feedback.

                                      Thanks again for spotting these errors for me!
                                      Jay

                                      1 Reply Last reply Reply Quote 0
                                      • pagejaws2P Offline
                                        pagejaws2
                                        last edited by

                                        @micione said:

                                        Ruby Console:
                                        SU 2015
                                        Windows 7
                                        setMeasurementType('SAE');
                                        setStatus('Creating a METRIC TAPPEDHOLE');
                                        continue TAPPEDHOLE in METRIC
                                        Error: #<ArgumentError: Cannot convert "0.0" to Length>
                                        C:/Users/Utente/AppData/Roaming/SketchUp/SketchUp 2015/SketchUp/Plugins/EP_Fasteners/EPTappedHole.rb:28:in `to_l'

                                        Weird! cannot convert "0.0" to length?
                                        "0.0".to_l should always work shouldn't it? (Um.... apparently not!)

                                        What were your model Measurement units?

                                        Oops... U.S. decimal places. Sorry. I will fix it and repost!
                                        Jay

                                        1 Reply Last reply Reply Quote 0
                                        • pagejaws2P Offline
                                          pagejaws2
                                          last edited by

                                          @dave r said:

                                          Thanks for fixing the 1/2" bolt. It looks like the nuts could use some attention, too. Top faces are reversed at least on the 1/2 and 1/4 in. nuts.

                                          [attachment=0:8cyjdv1l]<!-- ia0 -->nuts.png<!-- ia0 -->[/attachment:8cyjdv1l]

                                          What about making the threads smoother? Any chance for an option to adjust that?

                                          Hi! Thanks! I will check all of the faces again... I need to fix a preconception I built in about decimal places (oops) and at the very least I will put a variable in the constants file that will let you add more segments to the arcs. Long term I need to add a settings page for that and smoothing...

                                          Should be an updated post in a couple of days. if you could try it again after that, I would greatly appreciate your feedback.

                                          Thanks, Jay

                                          1 Reply Last reply Reply Quote 0
                                          • Dave RD Offline
                                            Dave R
                                            last edited by

                                            Jay, I will be happy to try again when you post the next update. It seems like it could be a useful plugin even if you don't want to 3D print the results.

                                            Etaoin Shrdlu

                                            %

                                            (THERE'S NO PLACE LIKE)

                                            G28 X0.0 Y0.0 Z0.0

                                            M30

                                            %

                                            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