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

    [REQUEST] Reverse Curve Direction (Start and End)

    Scheduled Pinned Locked Moved Plugins
    18 Posts 7 Posters 3.8k Views 7 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.
    • JClementsJ Offline
      JClements
      last edited by

      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
      • mitcorbM Offline
        mitcorb
        last edited by

        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
        • PixeroP Offline
          Pixero
          last edited by

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

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            @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
            • JClementsJ Offline
              JClements
              last edited by

              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
              • PixeroP Offline
                Pixero
                last edited by

                @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
                • thomthomT Offline
                  thomthom
                  last edited by

                  😳 😒

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

                  1 Reply Last reply Reply Quote 0
                  • mitcorbM Offline
                    mitcorb
                    last edited by

                    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
                    • fredo6F Offline
                      fredo6
                      last edited by

                      @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
                      • TIGT Offline
                        TIG Moderator
                        last edited by

                        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
                        • fredo6F Offline
                          fredo6
                          last edited by

                          @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
                          • TIGT Offline
                            TIG Moderator
                            last edited by

                            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
                            • thomthomT Offline
                              thomthom
                              last edited by

                              @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
                              • fredo6F Offline
                                fredo6
                                last edited by

                                @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
                                • thomthomT Offline
                                  thomthom
                                  last edited by

                                  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
                                  • TIGT Offline
                                    TIG Moderator
                                    last edited by

                                    @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

                                      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
                                      • fredo6F Offline
                                        fredo6
                                        last edited by

                                        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
                                        • First post
                                          Last post
                                        Buy SketchPlus
                                        Buy SUbD
                                        Buy WrapR
                                        Buy eBook
                                        Buy Modelur
                                        Buy Vertex Tools
                                        Buy SketchCuisine
                                        Buy FormFonts

                                        Advertisement