sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Finding the center of circles

    Scheduled Pinned Locked Moved SketchUp Discussions
    sketchup
    8 Posts 5 Posters 750 Views 5 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.
    • R Offline
      revelever
      last edited by

      Hi All-

      I imported a rhino model, but as a sketchup file. https://www.dropbox.com/s/9o6u1e0fy6qd82z/Screenshot%202015-10-03%2016.44.07.png?dl=0
      I intersected it with a plane to get this file (attached).

      I need to find the center of all these circles so I can make squares based on that reference.

      How do I find the center of these circles ?

      Thank you,

      -Revel


      circle spiral.skp

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

        Those imported shapes aren't actually circles/arcs - although they look like it.
        They are actually a collection of short edges, approximating to a circle.

        There is a tool in the PluginStore which you can use to find the center of such forms...
        Download its RBZ from here:
        http://sketchucation.com/pluginstore?pln=clf_arc_centerpoint_finder
        Read about it here:
        http://sketchucation.com/forums/viewtopic.php?p=155504#p155504

        TIG

        1 Reply Last reply Reply Quote 0
        • Wo3DanW Offline
          Wo3Dan
          last edited by

          @revelever said:

          ...... I need to find the center of all these circles so I can make squares based on that reference.

          How do I find the center of these circles ? ......

          The nomber of segments in your circles varies from 117 to 186. And per segmented "circle" the segment lengths arent all the same.

          In general (and per circle) you can draw two lines perpendicular to two segments, running from their respective midpoints. Where these lines intersect is the circle center.

          In your case you'll only get an appriximation of the center. probably due to the way shapes were imported, i.e. not as segmented circles but deformated segmented circles. Who knows?

          Oops, TIG beat me to it.

          1 Reply Last reply Reply Quote 0
          • sdmitchS Offline
            sdmitch
            last edited by

            @revelever said:

            Hi All-

            I imported a rhino model, but as a sketchup file. https://www.dropbox.com/s/9o6u1e0fy6qd82z/Screenshot%202015-10-03%2016.44.07.png?dl=0
            I intersected it with a plane to get this file (attached).

            I need to find the center of all these circles so I can make squares based on that reference.

            How do I find the center of these circles ?

            Thank you,

            -Revel

            Since the "circle" edges define a face, they must be closed and co-planar. Perhaps the easiest way would be just to use the center of the faces bounds.

            m=Sketchup.active_model;e=m.entities;s=m.selection;s.grep(Sketchup;;Face).each{|f|p=f.bounds.center;e.add_cpoint(p)}
            

            find center.gif

            Nothing is worthless, it can always be used as a bad example.

            http://sdmitch.blogspot.com/

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

              Thank you all for the excellent solutions.

              @sdmitch wow, um thats amazing. can you elaborate on how you did that a tad? ruby console from within sketchup?

              1 Reply Last reply Reply Quote 0
              • sdmitchS Offline
                sdmitch
                last edited by

                @revelever said:

                Thank you all for the excellent solutions.

                @sdmitch wow, um thats amazing. can you elaborate on how you did that a tad? ruby console from within sketchup?

                Yes, After selecting the faces, you can copy and paste the code into the Ruby Console to execute it.

                Nothing is worthless, it can always be used as a bad example.

                http://sdmitch.blogspot.com/

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

                  I don't know Ruby, but these steps should be possible with it...

                  • create center point for each selected face (see above)
                  • loop all center points
                    • calculate radius from face area
                    • delete edges
                    • create new circle with centerpoint at cpoint and calculated radius

                  my SketchUp gallery

                  1 Reply Last reply Reply Quote 0
                  • sdmitchS Offline
                    sdmitch
                    last edited by

                    @jim4366 said:

                    Very good, thank you so much. I run into this exact situation all the time converting imported .stl files. Circles usually come in broken with hundreds of segments. Now hoping it's not too much to ask, but would it be possible that, having the center point, could those segments that made up the circle be deleted and replaced with a real sketchup circle? In one swoop? Just a standard 24 segment circle would be fine. A circle un-exploder? 😄

                    Modified code

                    m=Sketchup.active_model;e=m.entities;s=m.selection;s.grep(Sketchup;;Face).each{|f|p=f.bounds.center;e.add_cpoint(p);n=f.normal;r=p.distance(f.vertices[0].position);e.erase_entities(f.edges);e.add_circle(p,n,r)}
                    

                    Or,copy attached plugin to Plugins folder. You will need to supply your own icons for the toolbar created.


                    Remake Circle.rb

                    Nothing is worthless, it can always be used as a bad example.

                    http://sdmitch.blogspot.com/

                    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