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

    Line length on circle scaled to ellipse is very wrong

    Scheduled Pinned Locked Moved SketchUp Discussions
    sketchup
    48 Posts 12 Posters 2.8k Views 12 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.
    • bazB Offline
      baz
      last edited by

      @ely862me said:

      This might be a bug..

      According to previous posters, it is a limitation of SU. But I can't see why a line shouldn't be a line, whether curved, stretched or otherwise abused.
      Shall I load the skp?

      1 Reply Last reply Reply Quote 0
      • G Offline
        Garry K
        last edited by

        Circle1 144s at 400 mm - scale by factor of 2
        Circle2 288s at 400 mm - scale by factor of 2

        entity information reports ~5026.5 mm for both - I don't know where this number comes from

        Then pushpull each ellipse into elliptical cylinder
        Select arc and explode
        entity information now reports ~3872.6 mm for Circle1
        entity information now reports ~3875.3 mm for Circle2

        Elliptical Circumference calculates out at 3875.38

        1 Reply Last reply Reply Quote 0
        • bazB Offline
          baz
          last edited by

          @garry k said:

          Circle1 144s at 400 mm - scale by factor of 2
          Circle2 288s at 400 mm - scale by factor of 2

          entity information reports ~5026.5 mm for both - I don't know where this number comes from

          Exactly! Or inexactly as it happens. Could you open that file again and see if the numbers have changed, they have on mine.

          1 Reply Last reply Reply Quote 0
          • ely862meE Offline
            ely862me
            last edited by

            Once you get to copy them around you get all kinds of lengths.

            Elisei (sketchupper)


            Before no life was done on Earth it was THE LIFE ITSELF...GOD
            Come and See EliseiDesign

            1 Reply Last reply Reply Quote 0
            • pbacotP Offline
              pbacot
              last edited by

              @baz said:

              @pbacot said:

              if you split the circles before the length of the two half curves remains the same when scaled regardless of sides...

              Sorry, not quite following you there.

              But to restate the question: If I draw a line at 100, Entity Info will tell me its 100.
              If I draw an arc and explode, I will get an accurate line length.
              However, if I scale a circle to make an ellipse, Entity Info gives me nonsense, and not even consistent nonsense. I just went back to my example model as shown at top and all the reported numbers are now different...

              It's to do with scaling, I reckon. It confuses SU's little brain.

              It doesn't make sense. Really CAD programs should have an ellipse tool.


              Screen Shot 2016-02-09 at 8.35.22 AM.png

              MacOSX MojaveSketchUp Pro v19 Twilight v2 Thea v3 PowerCADD

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

                I did some probing via Ruby, and it seems there is a chain of bugs causing this. First, when you scale a circle to make it an ellipse, SketchUp should drop the metadata defining it as a circle and treat it as just a closed loop of segments (a Curve). It does not do so, it continues to carry the center point, radius, and normal vector as if the loop is still a circle, and the edges still say they are part of an ArcCurve. This evidently triggers a second bug in the method that calculates the circumference of the loop. In some cases it still calculates the mathematical 2pir as if the circle hasn't been scaled. In other cases it calculates a strange value that has no evident relationship to anything. In no case does it return the sum of the lengths of the edges!

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

                  Lengths of (part of) an ellips do not show rigtht. This has been mentioned before.
                  I hope you can see this thread. See posts around 17/4/2008 and on.
                  https://groups.google.com/forum/#!searchin/sketchup3d/ellips$2Barea%7Csort:relevance/sketchup3d/z70T5xdUm_I/g-ChcSEcL2YJ

                  *"Taff, Google SU team,

                  Very nice approach Taff, almost precise. Here again there is the
                  lack of a precise ''snap to" with these rotations. But it's the best
                  you can do!

                  But I noticed an (important) bug in the "Entity Info" and "Text"
                  tool output.
                  The curve length shown is only half of what it should be.

                  Before you exploded the 1/4 ellipse curve the Entity Info reports
                  141.371669' as the curve length (also through Text tool)
                  It should however be: 282.743338'

                  16 segments out of the exploded curve add up to: 281.923143'
                  just a bit shorter which is obvious.
                  The more segments the more precise Taff's approach will be.
                  Even better when there were a "rotate snap" option to a curve.

                  Regards,
                  Wo3Dan "*

                  1 Reply Last reply Reply Quote 0
                  • bazB Offline
                    baz
                    last edited by

                    Pilou. The actual line length is 2155 +/- 5. measured in the real world.

                    This thread is starting to make my brain hurt...so, respected elders, is it a Bug or not?

                    1 Reply Last reply Reply Quote 0
                    • pilouP Offline
                      pilou
                      last edited by

                      @unknownuser said:

                      Using Approximation 2, the perimeter would be 2118.265712279433

                      A nurbs program 400 * 900 ellipse gives 2118,2799332 length line perimeter

                      Sketchup gives 2118,276442 with circle 1000 segments

                      Frenchy Pilou
                      Is beautiful that please without concept!
                      My Little site :)

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

                        I think it is a bug. I looked up the formula for perimeter of an ellipse and compared that with what SketchUp's entity info returns. For a 10x20 ellipse, the result should be 96.88. SketchUp variously returned 62.83 (20*pi), 111.3, and 113.27.

                        1 Reply Last reply Reply Quote 0
                        • ely862meE Offline
                          ely862me
                          last edited by

                          There was already a bug submitted for this, yes it is a bug. Also changing lengths when copying an ellipse is a bug. They are in the database and most likely sometime in the near future will be fixed.

                          Elisei (sketchupper)


                          Before no life was done on Earth it was THE LIFE ITSELF...GOD
                          Come and See EliseiDesign

                          1 Reply Last reply Reply Quote 0
                          • M Offline
                            mac1
                            last edited by

                            There is no closed form equation for perimeter of ellipse
                            it is approximated by p=2PIsqrt[[[ a^2+b^2]/2]^1/2]
                            The correct value p=4aE where E is the elliptic integral where k=1/a
                            sqrt[a^2-b^2]

                            1 Reply Last reply Reply Quote 0
                            • bazB Offline
                              baz
                              last edited by

                              @mac1 said:

                              There is no closed form equation for perimeter of ellipse
                              it is approximated by p=2PIsqrt[[[ a^2+b^2]/2]^1/2]
                              The correct value p=4aE where E is the elliptic integral where k=1/a
                              sqrt[a^2-b^2]

                              Yeah, what Mac said...

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

                                Mac is right, though there are several other approximate formulas that are better than the one he gave. Also, there are power-series that can be run to enough terms to get arbitrarily close. The point here is that even the sum of the lengths of the edges in the oval comes much closer than the strange values that SketchUp sometimes provides.i

                                1 Reply Last reply Reply Quote 0
                                • C Offline
                                  CAUL
                                  last edited by

                                  The best estimation of the circumference I've found is this:

                                  
                                    def self.circumference(major, minor)
                                      a = major / 2.0
                                      b = minor / 2.0 
                                      d = b / a
                                      
                                      x0 = d**0.5
                                      x1 = d
                                      x2 = d**1.5
                                      x3 = d**2
                                      x4 = d**2.5
                                      
                                      s0 = 3929 * x0 + 1639157 * x1 + 19407215 * x2 + 24302653 * x3 + 12892432 * x4
                                      s1 = 86251 + 1924742 * x0 + 6612384 * x1 + 7291509 * x2 + 6436977 * x3 + 3158719 * x4
                                      c = 4 * a + b * (s0 / s1)
                                      return c
                                    end
                                  
                                  

                                  It's extremely accurate, unfortunately I don't know where I found it so I can't give credits.

                                  1 Reply Last reply Reply Quote 0
                                  • pilouP Offline
                                    pilou
                                    last edited by

                                    And what is its result in this case ? (Ellipse 400*900)

                                    Frenchy Pilou
                                    Is beautiful that please without concept!
                                    My Little site :)

                                    1 Reply Last reply Reply Quote 0
                                    • C Offline
                                      CAUL
                                      last edited by

                                      @pilou said:

                                      And what is its result in this case ? (Ellipse 400*900)

                                      2118.2799288074484

                                      The result above is for major = 900, minor = 400, if your input refers to the semi axes multiply the result by 2.

                                      1 Reply Last reply Reply Quote 0
                                      • pilouP Offline
                                        pilou
                                        last edited by

                                        @ Caul
                                        So my result of Nurbs prog was not so bad! 😉
                                        2118,2799 332 against your theoric 2118.2799 288074484

                                        Sketchup gives 2118,27 6442 with circle 1000 segments! 😉

                                        But what think of this

                                        @unknownuser said:

                                        The actual line length is 2155 +/- 5. measured in the real world.

                                        Measured with ?

                                        http://www.filoche-et-ficelle.fr/314-831-thickbox/pelote-de-jute-ficelle-jute-75m.jpg
                                        or
                                        http://www.achatmat.com/mesure-courte/metre-ruban-ergonomique-bi-matiere-p-3000740-600x600.jpg
                                        or...?

                                        Frenchy Pilou
                                        Is beautiful that please without concept!
                                        My Little site :)

                                        1 Reply Last reply Reply Quote 0
                                        • M Offline
                                          mac1
                                          last edited by

                                          Attched is pic of ellipse drawn by the means of supplemental chords with no scaling. I included different seg counts just to show what can be done. If there is intersest I'll redo with more care.
                                          Su reports length of 48.364" for size shown.
                                          If you can run the polynomial curve fit equation shown I would appreciate. If this approach is useful for you I'll redo and show how to draw. It is a little more complicated than scaling but not much since you can draw 1/4 and then mirrow.
                                          Oops see one dimension got cropped it is 10"conjuate ellipse.jpg

                                          1 Reply Last reply Reply Quote 0
                                          • bazB Offline
                                            baz
                                            last edited by

                                            @pilou said:

                                            @ Caul
                                            So my result of Nurbs prog was not so bad! 😉
                                            2118,2799 332 against your theoric 2118.2799 288074484

                                            Sketchup gives 2118,27 6442 with circle 1000 segments! 😉

                                            But what think of this
                                            The actual line length is 2155 +/- 5. measured in the real world.

                                            Measured with ?

                                            A piece of string Pilou, sorry I cant recheck it, the job is done and dusted.

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

                                            Advertisement