• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

Select *Most* Collinear Edges

Scheduled Pinned Locked Moved Plugins
5 Posts 3 Posters 916 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.
  • M Offline
    M3DAmind
    last edited by 10 Mar 2019, 06:30

    Is there a plugin to do the following?

    Select Edge
    Operation: read connected edges at selected edge vertices, add to selection the most collinear (In-line with) edge attached to vertice and disregard the rest. Repeat until no edges fall under a custom angle parameter (i.e. X=30°).

    An operation that would start and end as shown on the attached.

    I often use ThomThom's "Select Loop" from QuadFace Tools. Which is fantastic but won't compute in more chaotic meshes.

    Would be a game changer for anyone working in complex meshes/ landscaping/ etc.

    Hopefully I've just been missing out this whole time and it exists somewhere. I need to learn Ruby! Thanks for the help.


    selectcollinearedges.JPG


    selectcollinearedges2.JPG

    1 Reply Last reply Reply Quote 0
    • C Offline
      cotty
      last edited by 10 Mar 2019, 08:08

      You can use the path select tool from SketchUV (no automatic angle, but more manual control for difficult meshes). Or a similar tool from ProfileBuilder 3, if you have bought this great plugin.

      my SketchUp gallery

      1 Reply Last reply Reply Quote 0
      • M Offline
        M3DAmind
        last edited by 10 Mar 2019, 09:36

        @cotty said:

        You can use the path select tool from SketchUV (no automatic angle, but more manual control for difficult meshes). Or a similar tool from ProfileBuilder 3, if you have bought this great plugin.

        Thanks! I've used SketchUV & PB2 in the past and completely avoided using the smart path selection tools. Helps, though it some conditions like an expansive sidewalk over hundreds of feet with changes in elevation, it'd be nice to have something instant like ThomThom's select loop with the properties in the OP. I'll have to learn Ruby. Thanks again.

        1 Reply Last reply Reply Quote 0
        • S Offline
          sdmitch
          last edited by 10 Mar 2019, 18:01

          @m3damind said:

          Is there a plugin to do the following?

          Select Edge
          Operation: read connected edges at selected edge vertices, add to selection the most collinear (In-line with) edge attached to vertice and disregard the rest. Repeat until no edges fall under a custom angle parameter (i.e. X=30°).

          An operation that would start and end as shown on the attached.

          Try this

          mod = Sketchup.active_model
          ent = mod.active_entities
          sel = mod.selection
          val = UI.inputbox(["Max Ang;"],[30.0],"Most Colinear")
          if val
            max_ang = val[0].degrees
            sel_edg = sel.first
            sel_edg.vertices.each{|start|
              found=true; nxt_edg = sel_edg
              while found
                found=false;
                if start.edges.length > 1
                  edges=start.edges-[nxt_edg];
                  vec = nxt_edg.line[1]
                  edg = edges.min_by{|e|vec.angle_between(e.line[1])}
                  ang = vec.angle_between(edg.line[1])
                  if  ang < max_ang || ang > Math;;PI-max_ang
                    sel.add edg;found=true;
                    start = edg.other_vertex(start)
                    nxt_edg = edg;
                  end
                end
              end
            }
          end
          
          

          Most Colinear.gif

          Nothing is worthless, it can always be used as a bad example.

          http://sdmitch.blogspot.com/

          1 Reply Last reply Reply Quote 0
          • M Offline
            M3DAmind
            last edited by 10 Mar 2019, 23:29

            Wow, thanks. I need to hang out here more.

            It looks like I'm still hitting snags. The X/30° param would have to apply to the obtuse conditions, not acute conditions. It doesn't appear to be culling the right edges in some circumstances, and it's terminating early.

            Regardless, thanks for giving me something to tinker with at some point.


            selectcollinearedges3.JPG

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

            Advertisement