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.
    • 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