• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

[Plugin] 2dBoolean ver1.3.1 beta UPDATE 20 dec 2013

Scheduled Pinned Locked Moved Plugins
88 Posts 8 Posters 48.8k Views 8 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.
  • P Offline
    pilou
    last edited by 26 Aug 2011, 11:08

    I obtain that with the V6, but I don't very well understood what must be inside the rectangle ? 😳
    An image, a texture, a color...? (here it's a texture)
    Result is on the right
    luddites.jpg

    Frenchy Pilou
    Is beautiful that please without concept!
    My Little site :)

    1 Reply Last reply Reply Quote 0
    • T Offline
      TIG Moderator
      last edited by 26 Aug 2011, 11:21

      In your example the 'face' is the blank top of the box, the 'group' is the face with the grouped 'image' material.
      Select both then run the tool
      The result is that the grouped 'image' is trimmed to fit on the select face
      If the grouped 'image' were smaller and arrayed like tiles then the whole lot would would be trimmed...like this Capture.PNG

      TIG

      1 Reply Last reply Reply Quote 0
      • J Offline
        jolran
        last edited by 26 Aug 2011, 12:56

        Ok. I should have made a better tutorial about this. Sorry 😳 .

        Tig has illustrated the whole purpose of the tool.

        It might not be clear WHY use this tool when you visually can get the same result from a material IN Sketchup. BUT when used with Layout to simulate vector color and edges, for printing you will get much more precision in quality.
        And edges can be used with styles. So some pretty nice sketchy effects can be made.

        This tool wasent originaly designed to use whole faces to texture and color things, it's an intersect tool for edgepatterns.
        From that perspective, modeling all those edge-patterns each time can be very tedious, so hence this tool..

        The main difference compared to Sketchups internal intersect tool is that the face materials are kept, by turning them into a cutting component.

        I'm experiencing a little inconsistency in the intersections(you can call it a bug), so I will have a look at that.
        Faces with holes dont get erased at times.

        1 Reply Last reply Reply Quote 0
        • P Offline
          pilou
          last edited by 26 Aug 2011, 13:20

          πŸ’š
          So I have made the exact inverse πŸ˜„
          Now all works like a charm in the V6! πŸ‘
          Bravo! 😎
          Except you have created a group (the initial group floating in the space with texture in my case now empty but always present! )
          that you must kill after the process!
          You can only kill it with the Outliner! 😲

          luddites_bis.jpg

          Frenchy Pilou
          Is beautiful that please without concept!
          My Little site :)

          1 Reply Last reply Reply Quote 0
          • J Offline
            jolran
            last edited by 26 Aug 2011, 15:10

            Nice Pilou. From judging at your pictures, that is the desired behavior of the plugin.

            What do you mean exactly? There is a group I have forgoten to delete? 😲 Or maybe that you cannot select the component, except then in the outliner? The second alternativ was corrected by defn.invalidate_bounds.
            But maybe that method doesent work on SU6. Do you have this problem on all su versions?

            If you doubleclick the component in the outliner (to enter the group) and then exit again, the boundingbox will be reset.
            But that is just a workaround if this method doesent work on older su versions.

            Thanks for the feedback Pilou πŸ‘
            Please test in on holes and such.. It should work on all standard axis(Su views), but sometimes it fails on "in between" angles. I'm working on a solution to resque if the calculation fails.

            1 Reply Last reply Reply Quote 0
            • T Offline
              TIG Moderator
              last edited by 26 Aug 2011, 15:31

              If you have an 'empty' group [or definition] that's been made or just emptied within a start/commit block, then it should be auto-deleted at the 'commit' [this is also a way to remove just one definition from the model - empty its entities...] πŸ€“

              TIG

              1 Reply Last reply Reply Quote 0
              • J Offline
                jolran
                last edited by 26 Aug 2011, 16:57

                I did not know that. Good info. Garbage collection? Well in this case all the groups and defs are made within the block, so all good? Of course the group or definition would have to empty..

                1 Reply Last reply Reply Quote 0
                • T Offline
                  TIG Moderator
                  last edited by 26 Aug 2011, 17:29

                  Of course if you have references to the groups etc then a simple group.erase! or inside a start/commit block the group.entities.erase_entities(group.entities.to_a) will both remove that one group [or instance OR definition when entities go!]... or groups[0]/parent.entities.erase_entities(groups) [where 'groups' is an array of all temporary groups]... will all work !

                  TIG

                  1 Reply Last reply Reply Quote 0
                  • J Offline
                    jolran
                    last edited by 26 Aug 2011, 18:47

                    Cool. So you can erase the group by erasing it's entities while inside a start/commit block? That could be useful, thanks.

                    1 Reply Last reply Reply Quote 0
                    • J Offline
                      jolran
                      last edited by 27 Aug 2011, 14:34

                      Small update. Now If you have a component that have gluing behavior you don't have to select a face to run the plugin. I noticed you run into situations quite often where that is needed. Like when the face is covered and you can not select it. πŸ˜„

                      This will not work with groups.

                      1 Reply Last reply Reply Quote 0
                      • J Offline
                        jolran
                        last edited by 27 Aug 2011, 18:53

                        I think I know why faces in holes don't get erased.

                        Face.classify point only deals with points/vertices. So if there is a face in a hole inside the face(inner edge loop). Erasing the vertices from face.classify point outside(holes included) does not erase the face in the hole at all times πŸ˜•

                        Don't know how to solve that one yet.. But at least I know what's wrong.

                        I reckon the plugin is kinda useless, unless I fix this. So it's got high priority now.

                        1 Reply Last reply Reply Quote 0
                        • J Offline
                          jolran
                          last edited by 28 Aug 2011, 09:27

                          I think I am close fixing this hole problem.

                          So I have made a collection of verticies(from face.clone) That binds the innerloops in faceclone(faces to go)

                          I want to use that collection to erase the faces in the boolean group.
                          This does not work 😞

                          (@verts=vertex collection) need to be instance variable or it will get deleted..

                          cents.to_a.each{|e| 
                          		       if e.class==Sketchup;;Face and e.outer.loop==@verts.loops
                          		          gp2faces2 << e
                          			  end
                          			}           
                          			
                          			cents.erase_entities(gp2faces2)
                          
                          1 Reply Last reply Reply Quote 0
                          • T Offline
                            TIG Moderator
                            last edited by 28 Aug 2011, 09:35

                            @verts is an array ?
                            e.outer.loop==@verts.loops won't work as an array doesn't have a '.loops' method ??
                            e.outer.loop==@verts[0].loops[0] might if there's only one loop ???
                            @verts[0].loops.include?(e.outer.loop) might otherwise ????
                            Not sure... as you posted 'clipped code'...

                            TIG

                            1 Reply Last reply Reply Quote 0
                            • J Offline
                              jolran
                              last edited by 28 Aug 2011, 13:04

                              Sorry my post was unclear and made in a hurry 😳

                              Yes it's an array of face.vertices. The one from face.clone, faces to go.

                              I suppose there are multiple ways of achieving what I want. But I have failed so far.
                              Will try some combination of @verts[0.loops.include?(e.outer.loop)] as you suggest, see what happends.
                              There could be scenarios where the faces has multiple "holes", so e.outer.loop==@verts[0.loops[0]] might not work.

                              Thank you TIG.
                              Off to try!

                              1 Reply Last reply Reply Quote 0
                              • E Offline
                                EarthMover
                                last edited by 28 Aug 2011, 16:36

                                Here's a video tutorial on using the plugin for stamping stone patterns into various shapes. So far I've had great results. Thanks again Joel and TIG!

                                [flash=800,600:1trov9v7]http://www.youtube.com/v/SNTQDBmKIro[/flash:1trov9v7]

                                3D Artist at Clearstory 3D Imaging
                                Guide Tool at Winning With Sketchup
                                Content Creator at Skapeup

                                1 Reply Last reply Reply Quote 0
                                • J Offline
                                  jolran
                                  last edited by 28 Aug 2011, 17:13

                                  Earthmover! β˜€

                                  That's quite a demonstration. Really! I can see here experienced modelers can find new workflows. Nice use of styles too.

                                  I know it's a bit slow when having a lot of geometry. It will be faster in Hatchfaces (tiled patterns without faces).

                                  Anyway, thank you for a nice video.

                                  1 Reply Last reply Reply Quote 0
                                  • J Offline
                                    jolran
                                    last edited by 29 Aug 2011, 08:54

                                    I'm wondering if the "hole" issue can be solved at all using face.classify method. πŸ˜•

                                    Watching Eartmover movie one can see he using a lot of detail in his meshes. Doing that, you will probably get faces and edges erased from holes, of the face it's glued to. Wich is the desired result!

                                    But if you are using less geometry for intersecting! For ex just a 2d square covering some holes. The face covering the hole will not be deleted cause there arent any vertices in the hole. The same if you have an edge crossing over the hole it will be assumed to be outside the hole, and therefore not deleted.

                                    Now, I have come so far to create a new group inside the colored group, that is a face_clone of the "holes".
                                    Don't know yet how I am going to use it as a reference for what to delete, since the faces are inside an individual group.
                                    Tried exploding it but the reference to the faces gets deleted.

                                    This could take a while to fix...


                                    dilemma.jpg

                                    1 Reply Last reply Reply Quote 0
                                    • T Offline
                                      TIG Moderator
                                      last edited by 29 Aug 2011, 10:56

                                      I think you need to take a step back on this face with holes issue...
                                      If the originally selected face has holes then your cloned face can too...
                                      You make a new group of the selected group/instance and explode it [recursively till it's all raw geometry].
                                      You replicate the edges from the cloned face, inside this new group.
                                      You .intersect_with() everything inside this new group so all edges get split etc.
                                      You then test every edge in this group and if it fails it's collected and later the collection is erased.
                                      The test for the edge needs to look at its start/end vertices positions and use face.classify_point(pt) - where the face tested is the originally selected face - you need to make several tests on each point as 'on face and not in hole', 'on edge', 'on vertex' etc might all count'... but 'off face' or 'in hole' won't.
                                      If an edge has one or two 'on face and not in hole' that edge passed.
                                      If an edge has one 'off face' or 'in hole' it fails.
                                      If an edge has two 'on edge' or 'on vertex' hits then it might be either on OR off the original face - it's on the perimeter of the original face - it could be spanning a convex corner and by 'on' but it could be spanning a concave corner and be 'off'... so to test for this you then offset the start point towards the end point to find the midpoint of the edge mid=edge.start.position.offset(edge.line[1],edge.length/2) - now test that 'mid' point and if theta point returns 'true' for 'on face and not in hole' or 'on edge' then we know that that edge passes as its either a perimeter edge OR spanning a convex corner so it's 'on-face', but if it fails it's across a concave corner and it's listed for erasing later...
                                      Set your tests up methodically and you should end up with a set of edges to go - the unwanted faces will go with them...

                                      TIG

                                      1 Reply Last reply Reply Quote 0
                                      • J Offline
                                        jolran
                                        last edited by 29 Aug 2011, 12:47

                                        @unknownuser said:

                                        If the originally selected face has holes then your cloned face can too...

                                        I hope the picture from last post did not make it look like I was having problem with the face.clone? It's the colored face(cutting comp) that is not getting holes, when totaly covering the holes. I provide another (more illustrating) picture.

                                        @unknownuser said:

                                        offset the start point towards the end point to find the midpoint of the edge mid=edge.start.position.offset(edge.line[1],edge.length/2) - now test that 'mid' point and if theta point returns 'true' for 'on face and not in hole' or 'on edge' then we know that that edge passes as its either a perimeter edge OR spanning a convex corner so it's 'on-face', but if it fails it's across a concave corner and it's listed for erasing later...

                                        That is pretty clever πŸ˜„ That will help to get rid of edges in holes.

                                        @unknownuser said:

                                        the unwanted faces will go with them...

                                        Probably not every time? Look at the picture, the big hole has no edges in it. Faces without edges in them will not get erased.

                                        Thank you for the help, TIG. I will try to get this working.


                                        separated result.jpg

                                        1 Reply Last reply Reply Quote 0
                                        • J Offline
                                          jolran
                                          last edited by 29 Aug 2011, 14:34

                                          Another question TIG, about start point offset to mid. I put you formula iterating through edges. And yes, I see the additional midpoints being counted(using puts).

                                          Question is. Can points be used for erasing edges that way? Must not there be a vertice on the edge at that position to be able to delete the edge? I'm using If edge used by?
                                          But the edge is not using that offset point, it's just a dot in space. Am I getting it wrong?

                                          I suppose I could use edge.split at that mid.point. But that would DOUBLE the vertices and have splits in the middle of every edge in the component! Could kill Sketchup, having patterns like Earthmover was showing?

                                          @unknownuser said:

                                          I think you need to take a step back on this face with holes issue...

                                          Yeah, getting crazy about it...

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

                                          Advertisement