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

[REQUEST] Reverse Curve Direction (Start and End)

Scheduled Pinned Locked Moved Plugins
18 Posts 7 Posters 3.8k Views
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.
  • J Offline
    JClements
    last edited by 30 Jan 2010, 22:36

    I was wondering if there is a standalone script that can reverse the "direction" (the start and end points) of an existing curve (similar to what Chris Fullmer's stringer curve has built in it).

    It would come in a handy for a curve which needs to be reversed in order to match the "direction" of other curves.

    John | Illustrator | Beaverton, Oregon

    1 Reply Last reply Reply Quote 0
    • M Offline
      mitcorb
      last edited by 30 Jan 2010, 23:24

      I do not know of a script or plugin for this. I suppose that it would be a rather simple one.
      Some of the members here may have already packaged it. Some others I suspect run SU with the ruby console open and do some things directly in there to affect what they are modeling, right ThomThom?, TIG?, Chris?

      I take the slow, deliberate approach in my aimless wandering.

      1 Reply Last reply Reply Quote 0
      • P Offline
        Pixero
        last edited by 31 Jan 2010, 12:30

        There is also this script made by Thomthom: http://forums.sketchucation.com/download/file.php?id=29675

        1 Reply Last reply Reply Quote 0
        • T Offline
          thomthom
          last edited by 31 Jan 2010, 16:56

          @pixero said:

          There is also this script made by Thomthom: http://forums.sketchucation.com/download/file.php?id=29675

          hm... I have no recollection of that. πŸ˜• But it is signed by me... I'm too young for my mind to be slipping...

          Thomas Thomassen β€” SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • J Offline
            JClements
            last edited by 31 Jan 2010, 17:08

            But it works πŸ˜„

            You might want to have it show up you list of scripts.

            Thanks to the both of you for your scripts.

            John | Illustrator | Beaverton, Oregon

            1 Reply Last reply Reply Quote 0
            • P Offline
              Pixero
              last edited by 31 Jan 2010, 19:29

              @thomthom said:

              @pixero said:

              There is also this script made by Thomthom: http://forums.sketchucation.com/download/file.php?id=29675

              hm... I have no recollection of that. πŸ˜• But it is signed by me... I'm too young for my mind to be slipping...

              You posted the code in the forum thread and I put it together as a script.
              (It was when I was experimenting with animation and curves.)

              Heres that thread: http://forums.sketchucation.com/viewtopic.php?f=81&p=164025

              And the one where I posted the script: http://forums.sketchucation.com/viewtopic.php?f=180&t=20173

              1 Reply Last reply Reply Quote 0
              • T Offline
                thomthom
                last edited by 31 Jan 2010, 20:28

                😳 πŸ˜’

                Thomas Thomassen β€” SketchUp Monkey & Coding addict
                List of my plugins and link to the CookieWare fund

                1 Reply Last reply Reply Quote 0
                • M Offline
                  mitcorb
                  last edited by 31 Jan 2010, 20:52

                  Gentlemen;
                  First, let me apologize to Fredo for not using his name in vain in my earlier reply. I think I mentioned the others because of recent ruby discussions I have seen. You all have my respect and admiration for your contributions and generosity.
                  I am happy to see I was wrong about reverse curve.

                  I take the slow, deliberate approach in my aimless wandering.

                  1 Reply Last reply Reply Quote 0
                  • F Offline
                    fredo6
                    last edited by 31 Jan 2010, 21:40

                    @mitcorb said:

                    Gentlemen;
                    First, let me apologize to Fredo for not using his name in vain in my earlier reply. I think I mentioned the others because of recent ruby discussions I have seen. You all have my respect and admiration for your contributions and generosity.
                    I am happy to see I was wrong about reverse curve.

                    Actually this function should be provided natively by SU, because the non-destructive solution can only be done based on the intimate structure of the model.
                    However, in most plugin, script writers would arrange to manage the right result whatever is the orientation of the curve or explicitly ask for begin and start regardless. So this is why the function was not absolutely needed before.

                    Fredo

                    1 Reply Last reply Reply Quote 0
                    • T Offline
                      TIG Moderator
                      last edited by 31 Jan 2010, 22:03

                      To reverse a curve non-destructively you could reform it 'in place', inside of a group.
                      Then you explode the original curve and immediately explode the group over the top of it... the new curve should them replace the old one - a curve exploded on top of edges seems to take precedence ?
                      ❓

                      TIG

                      1 Reply Last reply Reply Quote 0
                      • F Offline
                        fredo6
                        last edited by 31 Jan 2010, 22:09

                        @tig said:

                        To reverse a curve non-destructively you could reform it 'in place', inside of a group.
                        Then you explode the original curve and immediately explode the group over the top of it... the new curve should them replace the old one - a curve exploded on top of edges seems to take precedence ?
                        ❓

                        TIG,

                        Of course, that was my first idea. Unfortunately, SU does not replace edges from an explosion if it already exists, regardless of its orientation (and its property, soft, smooth or even hidden). The only thing I did not try is to see if by putting the edges on another layer and then explode the group.

                        I think we should all try to explore more the secrets of the Group explode operation to understand what it does and what it does not. On my side, I am still trying to find out what are the rules, why it can be slow or fast, etc....

                        Any lights on this would be useful

                        Fredo

                        1 Reply Last reply Reply Quote 0
                        • T Offline
                          TIG Moderator
                          last edited by 31 Jan 2010, 22:24

                          You can of course get the hidden/soft/smooth/material/attributes[even] properties of each of the curve's edges and reapply them to the new edges in the reversed-curve, but in the correct order ?

                          Also if you explode a curve into its edges and then immediately explode a group containing an equivalent curve over the top of it, then that curve should replace those edges - I've used this successfully before in copying curves into groups etc - see EEbyVector ?

                          You could of course get 'all_connected geometry' that comes with the curve that you want reversing: recreating it all in a group with exactly the same properties [all as listed above and more] for each and every face, edge, line, curve, arc etc - EXCEPT for the curve you want to be reversed [which you make 'backwards'] - then you erase the original 'all_connected geometry' and then explode the group to replace it with no risk of 'clashes'...

                          However, this seems a lot to do do reverse a single curve !!! πŸ˜’

                          TIG

                          1 Reply Last reply Reply Quote 0
                          • T Offline
                            thomthom
                            last edited by 31 Jan 2010, 22:28

                            @unknownuser said:

                            On my side, I am still trying to find out what are the rules, why it can be slow or fast, etc....

                            I think explode's speed will depend on the amount of geometry in the Entities collection the group/component/image is parent to. I think it relates to SU's slowness when adding geometry - gets slower the more entities in the Entities collection you add to.

                            Thomas Thomassen β€” SketchUp Monkey & Coding addict
                            List of my plugins and link to the CookieWare fund

                            1 Reply Last reply Reply Quote 0
                            • F Offline
                              fredo6
                              last edited by 31 Jan 2010, 22:34

                              @tig said:

                              Also if you explode a curve into its edges and then immediately explode a group containing an equivalent curve over the top of it, then that curve should replace those edges - I've used this successfully before in copying curves into groups etc - see EEbyVector ?

                              Yes it does, and this is how you do Welding.
                              The issue here is that it seems to keep the order of edges of the underlying edges to create the curve.
                              If you have time, give it a try, because I may be wrong and may have missed something.

                              Fredo

                              1 Reply Last reply Reply Quote 0
                              • T Offline
                                thomthom
                                last edited by 31 Jan 2010, 22:43

                                Can't help but think: the user should not need to be concerned about the direction of a curve internally in SU. A script can easily rearrange the points internally.

                                Thomas Thomassen β€” SketchUp Monkey & Coding addict
                                List of my plugins and link to the CookieWare fund

                                1 Reply Last reply Reply Quote 0
                                • T Offline
                                  TIG Moderator
                                  last edited by 31 Jan 2010, 22:55

                                  @unknownuser said:

                                  @tig said:

                                  Also if you explode a curve into its edges and then immediately explode a group containing an equivalent curve over the top of it, then that curve should replace those edges - I've used this successfully before in copying curves into groups etc - see EEbyVector ?

                                  Yes it does, and this is how you do Welding.
                                  The issue here is that it seems to keep the order of edges of the underlying edges to create the curve.
                                  If you have time, give it a try, because I may be wrong and may have missed something.
                                  Fredo

                                  I only really use it top replace edges with curves [a la weld where the 'direct' is unimportant] so I am unclear about this reported invulnerable vertex order - BUT if what you say is true and the original edge directions mess up the new curve's direction - can't we fix the original curve's exploded edges - by reversing each edge in turn - using add_line to re-draw it to make the start the end and vice versa ? Adding properties back to match ? Perhaps replacing the original edges first with the reversed edges and then those reversed edges with the reversed curve from the explosion of a group or two ? πŸ˜•

                                  TIG

                                  1 Reply Last reply Reply Quote 0
                                  • Chris FullmerC Offline
                                    Chris Fullmer
                                    last edited by 1 Feb 2010, 01:48

                                    I've written quite a few scripts where I have to sort the edge directions on my own. I always think its tedious. I would love it if SU allowed control of that through the Ruby API.

                                    Chris

                                    Lately you've been tan, suspicious for the winter.
                                    All my Plugins I've written

                                    1 Reply Last reply Reply Quote 0
                                    • F Offline
                                      fredo6
                                      last edited by 1 Feb 2010, 23:01

                                      Here is one script ("Revert Curve" in the contextual menu).
                                      Actually, there is no simple method, because changing the order of segments impacts the whole model structure for Sketchup.

                                      The attached script works fine on isolated curves.
                                      On curves which are linked to faces and other edges or curve, the scripts has to erase the edges and reconstruct the faces. So you'll loose the material and other properties of these faces.

                                      EDIT 01 Feb 10: Attachment removed. See this post to get the plugin
                                      http://forums.sketchucation.com/viewtopic.php?f=323&t=25710#p221170

                                      Fredo

                                      PS:

                                      1. The contextual menu item appears on a selection which contains one or more curves. Elements in the selection which are not curves are simply ignored.

                                      2. You do NOT need LibFredo6.

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

                                      Advertisement