• Login
sketchucation logo sketchucation
  • Login
๐Ÿ”Œ Quick Selection | Try Didier Bur's reworked classic extension that supercharges selections in SketchUp Download

Join lines

Scheduled Pinned Locked Moved SketchUp Discussions
sketchup
19 Posts 11 Posters 31.5k Views 11 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.
  • A Offline
    arail1
    last edited by arail1 6 May 2010, 14:24

    Is there a function in SketchUp or a plugin that will join line segments?

    Sometimes I'll have lines that should be a single line but are actually made up of several smaller segments. When I export as OBJ these segmented lines cause problems.

    I see in Extensions a plugin called Stray Lines but that seems to refer to lines that do not connect to any other entities.

    TIA


    splitlines.JPG

    1 Reply Last reply Reply Quote 0
    • J Offline
      Jim
      last edited by 6 May 2010, 14:27

      I think Thomthom is working on something, but here is a plugin named repair_broken_lines in the meantime:

      http://rhin.crai.archi.fr/RubyLibraryDepot/Ruby/repair_broken_lines.rb

      Hi

      1 Reply Last reply Reply Quote 0
      • T Offline
        thomthom
        last edited by 6 May 2010, 14:31

        yea, repair_broken_lines will let you repair split edges, but it only works in the local context.
        I'm adding the functionality to my CleanUp plugin so it can iterate the whole model, all the groups and comps etc. Should have a version out soon.

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

        1 Reply Last reply Reply Quote 0
        • A Offline
          arail1
          last edited by 6 May 2010, 14:46

          I look forward to your CleanUp plugin eagerly.

          This is one of the weak points in exporting from SketchUp to modo or other programs as an OBJ.

          The ends of broken lines are read as vertexes by modo and the polygon is then either split in two, reversed or not read.

          Repairing the individual lines locally in SketchUp wouldn't offer much advantage over dealing with the vertexes individually in modo. Being able to treat them globally would be great.

          1 Reply Last reply Reply Quote 0
          • J Offline
            jgb
            last edited by 8 May 2010, 20:52

            There are 2 ways to fix this.
            1- If the line segments form a straight but divided line, delete them and draw a single replacement line. Make sure you snap on the endpoints where the line started/stopped, and the face(s) should reform.
            2- There is a Ruby called WELD.rb It can (but not always) make the lines a single entity.


            jgb

            1 Reply Last reply Reply Quote 0
            • M Offline
              MeTaL125
              last edited by 28 May 2011, 16:02

              Here's my personnal tip for this one. That solution avoid face and texture loss.

              For the following exemple, let's suppose there's 4 segments A,B,C and D, hence 5 end points 1 to 5.
              .-.-.-.-.
              1A2B3C4D5

              1. Make sure the line is split in 3 or more segments.
                1.1 If not, simply use the Line tool to create one more, no matter where.
              2. Select all segments but the left and right most ones (segments B and C).
                3.1 Use the Move tool
                3.2 Click the left most selected end point (2) as the move source.
                3.3 Click the right most end point of the whole line (5) as the move target.
              3. All the middle segments will be moved outside of the original line. Simply delete the moved segmented. The remaining segment between end points 1 and 5 will be a single unsegmented line.
              1 Reply Last reply Reply Quote 0
              • T Offline
                TIG Moderator
                last edited by 28 May 2011, 20:29

                If it's only a few instances, then there's a simple manual fix...
                Use a Style showing end-points - so you can see them!
                Use the Move tool with nothing preselected.
                Pick the end of the split line and move it to the end of its cousin.
                You can move a vertex if nothing else is selected - otherwise the Move tool assumes you want to move the selected objects !
                You now have one line where there were two...
                Obviously if there are lots of split lines a script is more efficient... ๐Ÿ˜„

                TIG

                1 Reply Last reply Reply Quote 0
                • J Offline
                  jeff hammond
                  last edited by 28 May 2011, 21:33

                  another way to deal with it if you have fredo's bezier spline ruby installed..

                  select all the segments
                  right-click on one
                  BZ - convert to --> polyline
                  double-click on all the control points that you want to remove.

                  this will leave you with a su curve with two control points.. if you need it to be an edge for whatever reason, just right click it -> explode curve.

                  dotdotdot

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    arail1
                    last edited by 28 May 2011, 22:06

                    Thanks for the replies.
                    Most of the answers assume healing individual occurrences - I was hoping for some kind of global solution. Sometimes my SketchUp models will change dozens of times before they get to a final state and the result can be dozens and dozens of these broken lines. Finding them all and treating them individually would be tedious.

                    Fortunately I've figured out how to use the List panel in modo to find these vertexes that are associated with only two lines and delete them as a group.

                    But it would be nice to do it in SketchUp before the move over to modo.

                    1 Reply Last reply Reply Quote 0
                    • GaieusG Offline
                      Gaieus
                      last edited by 29 May 2011, 07:05

                      Have you looked at that "repair_broken_lines" plugin Jim linked to? Or as a matter of fact, TT's Cleanup plugin (which can do much more)?

                      Gai...

                      1 Reply Last reply Reply Quote 0
                      • B Offline
                        bjornkn
                        last edited by 29 May 2011, 07:37

                        I rarely end up with many of those broken lines, as SU usually heals any joints if I remove a line. But I suppose there are different modeling styles?
                        Dragging a vertex to a neighbour works fine for me.
                        Another way is to draw a line at the point, preferably "into the air", ie free.
                        Delete the line again, and SU will auto-heal the broken line.
                        For a lot of joints you may move/copy the line to all the joints and delete them all in one go.

                        BTW, drawing such temporary lines is also a great way to enable preselection of vertices in SU.

                        1 Reply Last reply Reply Quote 0
                        • J Offline
                          jgb
                          last edited by 29 May 2011, 18:25

                          One area where faces refuse to form after seemingly joining endpoints occurs especially when you are intersecting curved surfaces or faces forming an intersection curve, and the subsequent removal of unwanted surfaces. SU is not "perfect" doing this, particularly where very short lines are generated.

                          Part of that problem is your construction of the 2 intersecting surfaces, where the lines of either face do not coincide/intersect exactly to the lines of the other face. This is a drawing problem not an SU problem. In drawing fairings for my airplanes, I get this a lot, and especially when I need to "clean up" the resultant curve, which forms a mountaintop view or zig-zag edge. This again is normal, because SU only approximates a curve with short line segments and a smoothing algorithm to make it LOOK smooth. ๐Ÿ˜ฎ

                          So the faces refuse to form after what looks like a bonifide triangle. ๐Ÿ˜ข
                          There are 2 main reasons for this.

                          1- There is a very tiny gap at 1 or more vertexes, too big for WELD.rb to fix, but too small to see when zooming in before clipping occurs.
                          2- There are 1 or more very tiny line fragments at a vertex making the triangle a polygon and/or non-planar. When you selected the 3 lines to reform the face, you may have missed 1 tiny fragment, or more likely, when drawing a line between endpoints, 1 of the endpoints was on the end of the fragment and not the desired line.

                          The only simple fix is to delete a line (potentially all 3, but one at a time) and redraw it endpoint to endpoint. This usually fixes the gap problem, but not the fragment problem, especially when 1 or more verticies are part of the base surface you just intersected. You may end up redrawing a significant portion of the surface this way. ๐Ÿ˜ข

                          To quickly find and remove these tiny fragments is actually quite simple. Orient the model view such that the suspect vertex is clear of any model lines or verticies directly behind it. Then using a very small LEFT => RIGHT selection box over the vertex, check the Entity Info box. If it reports "nothing selected", there are no fragments, but don't rule out a gap. ๐Ÿ‘

                          Otherwise it will show you have 1 or more fragments of almost immeasurable size. In some cases I had as many as 7 tiny fragments attached to a vertex. Chances are they are still too small to see highlighted. No matter, just delete ALL of them. ๐Ÿ˜ฒ
                          There is simply no need to zoom in to see them, as anything under 1/64" or .5mm is getting too small for SU anyway.

                          One other point, if Entity Info reports an arc or curve, explode them before you delete them, as they may be part of a larger valid arc/curve.

                          That may un-face 1 or more existing faces, but all you need to do is delete 1 line (maybe 2) and redraw it, to the existing endpoints, then redraw the line to fix the original failed face. ๐Ÿ˜


                          jgb

                          1 Reply Last reply Reply Quote 0
                          • fredo6F Offline
                            fredo6
                            last edited by 29 May 2011, 21:54

                            Do you have a model that I can try.

                            I have actually a small plugin that remove lonely vertices.

                            Fredo

                            1 Reply Last reply Reply Quote 0
                            • A Offline
                              arail1
                              last edited by 29 May 2011, 22:05

                              @gaieus said:

                              Have you looked at that "repair_broken_lines" plugin Jim linked to? Or as a matter of fact, TT's Cleanup plugin (which can do much more)?

                              Yes, I tried repair_broken_lines and it seemed to heal some broken lines but definitely not all. I still had a healthy amount of cleanup to do on the other side of the export. I tried an early version of ThomThom's Cleanup plugin and that worked much better but not on the whole model. Some of my projects have 40 or 50 groups and opening each one was time consuming. I'm overdue to try out the most recent version with SU8.

                              A lot of the broken line problems I mention are a consequence of importing DWG files, especially files that have circles or ellipses with intersecting or tangent lines. The way that SketchUp converts a circle or ellipse to a faceted object often leaves small fragments of lines at the point that a line touches the curve. If you zoom in very, very close you'll see that a line that originally went to the perimeter of the curve, now extends beyond the faceted edge by a very small amount. That small line fragment will break the faceted edge into two line segments and often when I delete the fragment I still have two lines rather than one.

                              But, as I said above, I found that the List function in modo is any modo users best friend. It offers the global solution I was originally asking about.

                              Thanks again for all the replies.

                              1 Reply Last reply Reply Quote 0
                              • A Offline
                                arail1
                                last edited by 29 May 2011, 22:08

                                @unknownuser said:

                                Do you have a model that I can try.

                                I have actually a small plugin that remove lonely vertices.

                                Fredo

                                I'm away for the holiday weekend. When I'm back in NYC I'll post a model that exhibits some of the problems I mentioned.

                                1 Reply Last reply Reply Quote 0
                                • A Offline
                                  arail1
                                  last edited by 29 May 2011, 22:32

                                  I created a simple example that illustrates the problem and posted the SU file -

                                  I drew a circle in AutoCAD with a line intersecting the perimeter from the center.
                                  I Imported into SketchUp and deleted the line. That left a very small fragment outside the faceted edge. I deleted the fragment. Now I have a faceted edge with two lines, not one. repair_broken_lines doesn't see the problem because the line isn't 'broken' - it's two lines with no intersection. (see photo) brokenline.jpg

                                  The problem for me isn't with SketchUp - SketchUp completes the face, the problem is when I export as OBJ - the errant vertexes flip my polys or create unwanted triangles. I design stairs so I move back and forth from AutoCAD with lots of circles and ellipses so this occurs pretty regularly in my work.


                                  broken line.skp

                                  1 Reply Last reply Reply Quote 0
                                  • fredo6F Offline
                                    fredo6
                                    last edited by 29 May 2011, 22:51

                                    Arail,

                                    I tried the plugin and it seems to work.

                                    LonelyVertices on circle.gif

                                    I will publish it soon - see that post

                                    Fredo

                                    1 Reply Last reply Reply Quote 0
                                    • A Offline
                                      arail1
                                      last edited by 29 May 2011, 23:59

                                      Works great!
                                      I can't thank you enough!

                                      1 Reply Last reply Reply Quote 0
                                      • D Offline
                                        djh
                                        last edited by 27 Jul 2022, 16:22

                                        @tig said:

                                        If it's only a few instances, then there's a simple manual fix...
                                        Use a Style showing end-points - so you can see them!
                                        Use the Move tool with nothing preselected.
                                        Pick the end of the split line and move it to the end of its cousin.
                                        You can move a vertex if nothing else is selected - otherwise the Move tool assumes you want to move the selected objects !
                                        You now have one line where there were two...
                                        Obviously if there are lots of split lines a script is more efficient... ๐Ÿ˜„

                                        Thank you, TIG.

                                        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