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

    [Plugin] CenterPointAll.rb

    Scheduled Pinned Locked Moved Plugins
    34 Posts 18 Posters 40.9k Views 18 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.
    • david_hD Offline
      david_h
      last edited by

      Oui! C'est Ca! Where are these RUBY GURUS when you need them? (jk) 😳

      Im sure they don't have anything else to do but respond to my whining. πŸ˜„

      If I make it look easy...It is probably easy

      1 Reply Last reply Reply Quote 0
      • JClementsJ Offline
        JClements
        last edited by

        When I have time, I often draw over "apparent" arcs and circles because I can then use Entity Info to verify radii of piping and to facilitate the extrusion of smoothed-surfaces and improve exporting .SKP's to other formats.

        I think the bottom line is you'd need a basic script (using the model context or selection) to find series of contiguous segments, then analyze them to determine if they have the characteristics of an arc.

        For instance: are all segments of equal length and are all of their common angles equal (there may be more conditions that I haven't thought of)? If all segments touch one another, then are they a polygon or a circle?

        If such a script can be developed, then it could be used as a common routine called by other scripts such as pipe-along-path or used on intersected geometry. Once the script qualifies the segments, it could then automatically redraw them, make centerpoint guides, etc.

        John | Illustrator | Beaverton, Oregon

        1 Reply Last reply Reply Quote 0
        • david_hD Offline
          david_h
          last edited by

          Yeah. . .what he just said. .. uh Huh. I think

          Anyway. .. I just want to find the Radius point of any curve be it arc or no. anything else, above that . . ..Gravy.

          If I make it look easy...It is probably easy

          1 Reply Last reply Reply Quote 0
          • plot-parisP Offline
            plot-paris
            last edited by

            JClements, that would be a damn handy tool and a wonderful addition to the weld-script...

            1 Reply Last reply Reply Quote 0
            • W Offline
              watkins
              last edited by

              Dear David_H

              You can use the protractor to find the centre of an arc or circle. Snap the tool to the mid-point of a segment and then click on the end of that segment (you have a choice of two points). Rotate the protractor 90 degrees to create a construction line along the segment's normal (located at mid-point). Repeat for a second segment. The centre point is marked by the crossing of the construction lines.

              A ruby script might work in the same way.

              Activate the tool, and moving either clockwise or anticlockwise (but not both):

              Click first end point, segment 1
              Click second end point, segment 1
              Click third end point, segment 2
              Click fourth end point of segment 2
              Ruby computes equations of normals at mid-points of segments 1 and 2
              Ruby computes coincident point to yield x,y,z value of centre point

              Variations:

              Segments 1 and 2 are start and end segments of arc = redraw arc (input = number of segments)
              Segments 1 and 2 are connected = redraw circle (input = number of segments)

              I am not a script writer, but the above would seem do-able.

              1 Reply Last reply Reply Quote 0
              • david_hD Offline
                david_h
                last edited by

                Watkins. Yeah, I had been doing that. I was just hoping for a one-click solution. Cuz I ain't no Ruby Writer Neither. . .sigh! πŸ˜’ But thanks for the input.

                If I make it look easy...It is probably easy

                1 Reply Last reply Reply Quote 0
                • J Offline
                  Jim
                  last edited by

                  @unknownuser said:

                  Watkins. Yeah, I had been doing that. I was just hoping for a one-click solution. Cuz I ain't no Ruby Writer Neither. . .sigh! πŸ˜’ But thanks for the input.

                  Dave,

                  You might have more luck if you start a new request thread in the Ruby forum.

                  Hi

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

                    Thanks.. Now more easier to make center point

                    1 Reply Last reply Reply Quote 0
                    • S Offline
                      ship69
                      last edited by

                      Does this video have sound? It's coming out silent on my PC.

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

                        @ship69 said:

                        Does this video have sound? It's coming out silent on my PC.

                        No. It's a silent video.

                        Etaoin Shrdlu

                        %

                        (THERE'S NO PLACE LIKE)

                        G28 X0.0 Y0.0 Z0.0

                        M30

                        %

                        1 Reply Last reply Reply Quote 0
                        • E Offline
                          Einstein
                          last edited by

                          Thanks TIG πŸ˜„

                          This simple tool helps me rotating components around their centerpoints which is quite complicated in SU.

                          It would be even more handy if a created centerpoint was interactive, I mean: changed with scaling and moving component or group it's based on. But I realise that would be also much more complicated code.

                          1 Reply Last reply Reply Quote 0
                          • BoxB Offline
                            Box
                            last edited by

                            @einstein said:

                            rotating components around their centerpoints which is quite complicated in SU.

                            To rotate about the midpoint of a group or component, use the rotation handles that appear when you use the Move tool.


                            RotCen.gif

                            1 Reply Last reply Reply Quote 0
                            • S Offline
                              sarkarshomit
                              last edited by

                              Can't get it working in sketchup 2018.working fine in skup16, but not in 18...any help if i am doing something wrong!!

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

                                @sarkarshomit said:

                                Can't get it working in sketchup 2018.working fine in skup16, but not in 18...any help if i am doing something wrong!!

                                Evidently you are doing something wrong. I just installed it in SU2018 and ran it. It works fine. How did you install it? Where did you install it? Do you have Guides set to show in the View menu?
                                Result of CenterPointAll

                                Etaoin Shrdlu

                                %

                                (THERE'S NO PLACE LIKE)

                                G28 X0.0 Y0.0 Z0.0

                                M30

                                %

                                1 Reply Last reply Reply Quote 0
                                • S Offline
                                  sarkarshomit
                                  last edited by

                                  @dave r said:

                                  @sarkarshomit said:

                                  Can't get it working in sketchup 2018.working fine in skup16, but not in 18...any help if i am doing something wrong!!

                                  Evidently you are doing something wrong. I just installed it in SU2018 and ran it. It works fine. How did you install it? Where did you install it? Do you have Guides set to show in the View menu?
                                  [attachment=0:9qktjmkx]<!-- ia0 -->Screenshot - 5_16_2018 , 5_31_16 AM.png<!-- ia0 -->[/attachment:9qktjmkx]

                                  Thanks for the help.

                                  Strangely in skup16, the plugin shows up in plugins menu named as "set centerpoint".
                                  And in skup18 it shows up in extensions menu as "Add centerpoint".

                                  So finally its working for me. Thanks again.

                                  1 Reply Last reply Reply Quote 0
                                  • BoxB Offline
                                    Box
                                    last edited by

                                    Sounds like you may have had a different extension installed in 2016. There is one called Set Centerpoint.
                                    Tig's shows for me in 2016 as Add Centerpoint.

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

                                      Hate to appear thick but I can't install CenterPointAll in 2018 (vs 8.0.1...). Where do I need to place the plugin?
                                      Thanks!!

                                      1 Reply Last reply Reply Quote 0
                                      • TIGT Offline
                                        TIG Moderator
                                        last edited by

                                        Look here
                                        https://sketchucation.com/pluginstore?pln=CenterPointAll
                                        which gives you an RBZ which can be installed in v2018 using Window > Extension Manager > Install... [red-button]

                                        No need to find the Plugins folder etc...

                                        Almost all Plugins which include an old RB file in their thread will have an entry in the PluginStore, giving an easily installed RBZ for use in all current versions of SketchUp...
                                        Even the now often unsupported v8 had these RBZ capabilities in later MRs,,,

                                        TIG

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

                                          Thanks!
                                          Been a while since I've used Sketchup. You made an invaluable plugin!

                                          1 Reply Last reply Reply Quote 0
                                          • kachuppK Offline
                                            kachupp
                                            last edited by

                                            For those who dislike using the plugin (Extensions) menu I've modified TIGs version to use
                                            the context menu. I find it much faster than moving the mouse all the way too
                                            the top menu bar click and click.

                                            pick, right click, click "Point at Center" done.

                                            UI.add_context_menu_handler {|menu|
                                            	menu.add_item("Point at Center") {
                                              	model=Sketchup.active_model
                                              	entities=model.active_entities
                                              	selection=model.selection
                                              	model.start_operation("Add Centerpoint")
                                              	selection.to_a.each{|e|entities.add_cpoint(e.bounds.center)}
                                              	model.commit_operation
                                             }
                                            }
                                            
                                            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