sketchucation logo sketchucation
    • Login
    โ„น๏ธ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    [Plugin] TIG-Smart_offset

    Scheduled Pinned Locked Moved Plugins
    143 Posts 55 Posters 164.8k Views 54 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.
    • TIGT Offline
      TIG Moderator
      last edited by

      The problem is having a circle intersect a line squarely is that the distance between the two parallel segments [taken across the circle] are not the circle's diameter apart; because a circle is 'inscribed', so then its vertices are on the circumference, only an intersection through two opposite vertices return the diameter. Any intersection s through segments result in the measurable 'diameter' across the intersection is reduced by just a little more than 0 [when the intersect in very near to the circle's vertices] up to ((diameter/2) * Math.cos(360.degrees/numseg/2)), when the segments' mid-points are both intersected [diameter/2==radius].
      The more segments [numseg] there are then the nearer the two 'diameters' will get, but the square one will always be somewhat less that the true one, even with hundreds of segments... ๐Ÿ˜•

      TIG

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

        Yes, I realize that the flats aren't at the true radius of the arc. Very often for my use I wind up scaling the circle so when I dimension the arc, I am dimensioning to the midpoint of the edge parallel to the base. It isn't perfect but it gets the right information to the client and the difference isn't really apparent. I've developed a process that seems to work well enough manually so that I don't have to screw around with it for too long to get what I need.

        Etaoin Shrdlu

        %

        (THERE'S NO PLACE LIKE)

        G28 X0.0 Y0.0 Z0.0

        M30

        %

        1 Reply Last reply Reply Quote 0
        • jeff hammondJ Offline
          jeff hammond
          last edited by

          fwiw, i'm not trying to say this plugin doesn't work right etc..

          what i am trying to say is (and hey, i admit i'm not a very good lobbyist and i don't know the proper channels to use to get my complaints to the right people so i just always spew about this stuff in random threads at scf ๐Ÿ’š )

          ...is..
          sketchup itself is messed up.. this type of plugin (smart offset), imo, should never have to be written in the first place.. it's not a plugin that's speeding up the drawing time etc... it's a plugin that's attempting to fix the core app.. but the core should be good from the start then you guys build on top of that solid foundation..

          i mean, even if you did make a plugin that truly offsets properly then it's but a small small dent in the whole drawing experience.. all the other applicable plugins and native tools are still messed up (joint push pull, shape bender, follow-me, offset, round corner etc.. ).. but if sketchup itself was fixed then all of these tools/plugins would work properly/accurately..

          to me, this is the single most important thing the sketchup developers should work on.. and i realize its a whole lot of work for something they couldn't even say 'hey, check out our new feature' to.. and maybe a whole bunch of people wouldn't even notice anything is different (which i'm starting to believe as true.. i feel like a lone soldier in this battle ๐Ÿ˜‰ ... but i actually believe there are quite a few design/builders out there that know of this problem as well but they're just not vocal about it at scf.. they just cuss at it but the cussing goes no further than their workstation.. i mean, there has to be others that encounter this flaw..) but it does bum me out that i know the developers also realize this issue and they just keep quiet about it.. there's no way jbacus doesn't know of this problem so it's not like i'd be bringing anything new to his attention if i had the opportunity to discuss this with him..

          dotdotdot

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

            ๐Ÿ‘ Ditto. Fix the core! Can't even fix the Icon scramble, how hard can that be?

            1 Reply Last reply Reply Quote 0
            • jeff hammondJ Offline
              jeff hammond
              last edited by

              @dave r said:

              This angle frequently causes issues in Offset as well as other things like Follow Me.

              @tig said:

              The problem is having a circle intersect a line squarely is that the distance between the two parallel segments ...

              regarding that angle.. (which is proper as you guys know.. but in case anyone else is listening..)

              what irks me is that the developers have done some things regarding the way arcs work in a polygon modeler which are correct.. for instance..


              โ€ข if you use the arc tangent snap, (draw a straight line, choose the arc tool, click on one end of the line, find the light blue 'tangent at vertex' snap) then the first arc segment will not be inline with the straight line.. the first angle of the arc will be placed in the proper position.. it's accurate.. etc.

              โ€ข entity info gives correct length of arc as opposed to sum of segment length (granted, this is just a little math calculation they're doing but still...)

              โ€ข the arc's centerpoint is given accurately and it's not perpendicular to the end segments of the arc.. again, this is proper and accurate

              โ€ข using the arc tool's half-circle snap... you don't end up with the end segments being parallel.. they're bent inward.. in other words, sketchup is calculating the position of the arc's vertices and not the segments-- as it should... but then you try to offset an arc and it moves the segments instead of the vertices ?tf

              โ€ข when you're positioning an arc or circle (setting the bulge part of the arc), you're moving a vertex around.. not a segment

              โ€ข the cardinal points are on a vertex, not a segment


              so, they did do some things which are right and directly deal with the issues i have but why half-arse* it ?? follow through please and tidy up the rest of it.. thank you

              *my use of arse instead of ass was meant to be a way to make a more mellow/ less mad sounding statement.. not sure if it works right but that was the intent ๐Ÿ˜†

              dotdotdot

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

                Here's v1.9 http://sketchucation.com/forums/viewtopic.php?p=446462#p446462
                An obscure error in the code when the tool's method called from within another script has been fixed fixed [when the face.parent.entities!=model.active_entities !].
                Other users of the toolbar/menu options will find no difference in its operation with this update.

                TIG

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

                  may be it'd help in bug hunting.
                  Attachment: inner offset is not correct, no outer offset at all
                  (values: +-20)


                  tig2.skp

                  1 Reply Last reply Reply Quote 0
                  • Jean-FrancoJ Offline
                    Jean-Franco
                    last edited by

                    looking at your skp and welding part of the segments you'll see different results.
                    TIG-Smart_offset_example.jpg

                    Jean-Franco

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

                      @jean-franco said:

                      looking at your skp and welding part of the segments you'll see different results.
                      [attachment=0:2t1zi3eq]<!-- ia0 -->TIG-Smart_offset_example.jpg<!-- ia0 -->[/attachment:2t1zi3eq]

                      I exploded those arches and no offset get executed ๐Ÿ˜’

                      1 Reply Last reply Reply Quote 0
                      • Jean-FrancoJ Offline
                        Jean-Franco
                        last edited by

                        @rv1974 said:

                        @jean-franco said:

                        looking at your skp and welding part of the segments you'll see different results.
                        [attachment=0:3fig2342]<!-- ia0 -->TIG-Smart_offset_example.jpg<!-- ia0 -->[/attachment:3fig2342]

                        I exploded those arches and no offset get executed ๐Ÿ˜’

                        Yes, the same behavior for me.

                        Jean-Franco

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

                          I'm investigating...
                          ๐Ÿ˜•

                          TIG

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

                            Here's v2.0 http://sketchucation.com/forums/viewtopic.php?p=446462#p446462
                            Just ready for the New Year ๐Ÿ˜‰

                            It has further refinements and glitch trapping.
                            The recent reports of malformations were caused by the face having very 'sharp' spikes, which were returning a false negative when testing for their offset vertices for the new outline's points. This is now fixed, but it has meant that the point-on-face 'checking tolerance' has had to be increased to 0.5mm - so it could now fail on a face that has a 'finger' that is narrower than 0.5mm, when measured along adjacent vertices' internal-angle-bisectors - but that is very very unlikely anyway...
                            ๐Ÿ˜’

                            TIG

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

                              the last one is much better!
                              things to refine:
                              no outer offset in attached shape


                              tig4.skp

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

                                great job, as always TIG. Thank you and Good Year ๐Ÿ‘

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

                                  Here's v2.1 http://sketchucation.com/forums/viewtopic.php?p=446462#p446462
                                  This version now has the same vertex checking tolerances applied to curves' vertices as to plain edges... [I accidentally missed that code out in the previous version].
                                  Hopefully it now also works with the recent problem offset examples posted: mind you, these are getting somewhat 'extreme' ๐Ÿ˜ฎ
                                  Feedback please ๐Ÿ˜•

                                  TIG

                                  1 Reply Last reply Reply Quote 0
                                  • kenK Offline
                                    ken
                                    last edited by

                                    TIG

                                    I have been following the updates, and the plugin still has this output with my model. I am not sure this is correct or is a problem.

                                    Thanks for your work.

                                    Ken


                                    Image 1.png

                                    Fight like your the third monkey on Noah's Ark gangway.

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

                                      @unknownuser said:

                                      TIG

                                      I have been following the updates, and the plugin still has this output with my model. I am not sure this is correct or is a problem.

                                      Thanks for your work.

                                      Ken

                                      Ken, I'm curious. If you were to draw that out with paper and pencil, what would you expect that amount of offset to look like?

                                      Etaoin Shrdlu

                                      %

                                      (THERE'S NO PLACE LIKE)

                                      G28 X0.0 Y0.0 Z0.0

                                      M30

                                      %

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

                                        @Ken
                                        That's not right. ๐Ÿ˜•
                                        The offset is not maintained evenly - it's too near the 'spikes'.

                                        I can't get the effect... ๐Ÿ˜ž
                                        However, I do get the outline failing at some point sooner than it ought, when the inward facing 'spikes' get so large they cut through to the other side of the shape...
                                        I looking to see what's up with that...
                                        Outward offsets are also problematical on that shape...


                                        Capture.PNG

                                        TIG

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

                                          @tig said:

                                          Here's v2.1 http://sketchucation.com/forums/viewtopic.php?p=446462#p446462
                                          This version now has the same vertex checking tolerances applied to curves' vertices as to plain edges... [I accidentally missed that code out in the previous version].
                                          Hopefully it now also works with the recent problem offset examples posted: mind you, these are getting somewhat 'extreme' ๐Ÿ˜ฎ
                                          Feedback please ๐Ÿ˜•

                                          It starts to look like quest game ๐Ÿ˜Ž
                                          Step by step it's getting better.
                                          Inner ofsetting (value:-25) in my last attachment is not 100% correct.
                                          P.S. Thank you
                                          And Happy New Year!

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

                                            Maybe you just need to change the name of the plugin to TIG_Random _Shape_Generator.rb. ๐Ÿ˜„ ๐Ÿ˜„
                                            offset.png

                                            I also got something similar to your second one, TIG, when I used a larger offset distance.

                                            Etaoin Shrdlu

                                            %

                                            (THERE'S NO PLACE LIKE)

                                            G28 X0.0 Y0.0 Z0.0

                                            M30

                                            %

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

                                            Advertisement