sketchucation logo sketchucation
    • Login
    🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    'break_edges' behavior wrong when in a group context

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 2 Posters 38 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.
    • Didier BurD Offline
      Didier Bur
      last edited by

      Hi,

      As you know, Sketchup.break_edges is always set to true by defaut.
      My script generates several lines in a group context. As you will see in the animation, 2 lines crossing the face have been drawn but they are not break when the second one is drawn.
      The resulting number of faces within the group is 2 instead of 4.
      The resulting number of edges within the group is 10 instead of 12.
      Running the script in a component context does the same.
      Why that ?
      I didn't find a workaround. Any idea ?
      wrong_break_edges.gif

      DB

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        Collect all of the grouped edges, the use intersect to break the edges and faces...
        https://ruby.sketchup.com/Sketchup/Entities.html#intersect_with-instance_method

        If that doesn't work, then try adding a temporary short edge perpendicular to the faces' plane, at the non-splitting intersection which should break the crossing edges and separate the faces...
        Delete the short edge afterwards...

        TIG

        Didier BurD 1 Reply Last reply Reply Quote 0
        • Didier BurD Offline
          Didier Bur @TIG
          last edited by

          @TIG

          Thanks TIG.
          Unfortunately intersect_with_instance doesn't work. I tried to insert short edges at intersections that are an issue, but this doesn't solve the problem either.
          So next step is to compute everything 'virtually' (storing the inner edges (not as Sketchup::Edge)) in an array and drawing all edges at the end of the process.
          I wonder why the API works OK at the top level of the model but doesn't do the same job in a group or component context...

          wrong_break_edges 2.gif

          DB

          1 Reply Last reply Reply Quote 0
          • Didier BurD Offline
            Didier Bur
            last edited by

            Oh and iterating through the inner edges array and use edge.find_faces doesn't help...

            DB

            1 Reply Last reply Reply Quote 0
            • TIGT Offline
              TIG Moderator
              last edited by TIG

              Did you try deleting all faces and then using edge.fine_faces ?

              TIG

              1 Reply Last reply Reply Quote 0
              • Didier BurD Offline
                Didier Bur
                last edited by

                Yesssss ! Deleting all faces before using find_faces WORKS.
                Thanks a lot TIG

                DB

                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