sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    [Plugin] Manifold v2.2

    Scheduled Pinned Locked Moved Plugins
    126 Posts 19 Posters 55.7k Views 19 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.
    • TIGT Offline
      TIG Moderator
      last edited by

      @thomthom said:

      How do you determine what an internal face is?

      See the code remove_inner_faces() - it seems to work... probably break when pressed ??? This is my first beta release...

      I had a complex method involving doing an MIR type scan slice in the Z and then the X [to catch flat internal faces] progressively through the group [though not needed at every 0.5mm since we can determine any 3-faced edges and just start a small amount into them to get the relevant faces] and then intersecting the slice with the group and finding any split surfaces made where an internal face intersected it etc and then finding a point on that split-line and testing it to see if it was on a face that's internal and then erasing it etc etc... BUT dough-nut shaped groups really screwed this up so I reverted to the simpler version you see here... πŸ˜’

      TIG

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        It sure seem to work at whatever I've thrown at it so far.
        Mind if I sample the code logic for an implementation in Cleanup?

        btw:

        
        Error; #<NoMethodError; undefined method `db' for #<Sketchup;;Face;0xf54e668>>
        C;/PROGRA~2/Google/GOOGLE~1/Plugins/manifold.rb;293;in `orient_manifold_faces'
        C;/PROGRA~2/Google/GOOGLE~1/Plugins/manifold.rb;332;in `orient_faces'
        C;/PROGRA~2/Google/GOOGLE~1/Plugins/manifold.rb;330;in `each'
        C;/PROGRA~2/Google/GOOGLE~1/Plugins/manifold.rb;330;in `orient_faces'
        C;/PROGRA~2/Google/GOOGLE~1/Plugins/manifold.rb;95;in `activate'
        C;/PROGRA~2/Google/GOOGLE~1/Plugins/manifold.rb;454;in `select_tool'
        C;/PROGRA~2/Google/GOOGLE~1/Plugins/manifold.rb;454;in `manifold'
        C;/PROGRA~2/Google/GOOGLE~1/Plugins/manifold.rb;470
        C;/PROGRA~2/Google/GOOGLE~1/Plugins/manifold.rb;470;in `call'
        
        

        though the script appear to complete...

        And why did you comment out the disable_ui argument? (line 85) @model.start_operation((db("Manifold")))#,true) ### ?

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

        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          On a sidenote: you can save some lines in your remove_inner_faces method by using more of Ruby's Enumerator and Array methods:

          
          def remove_inner_faces()
          	faces = @gents.select { |e| e.class==Sketchup;;Face }
          	faces_to_go = faces.select { |face| face.outer_loop.edges.any? { |e| e.faces.length > 2  } }
          	faces_to_go.each{|e|
          		if e.valid?
          			clone_removed_into_error_group([e]+e.edges)
          			e.erase! if e.valid? 
          		end#if
          	}
          end
          
          

          I just noticed them not too long ago while having another look at the Ruby docs, I realised I could cut down a number of lines in most my scripts.

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

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            Just noticed, when I reload your script, load 'manifold.rb' it keeps adding more menu items.

            Think it's because of the last line: file_loaded(__FILE__)
            Should it not be: file_loaded(File.basename(__FILE__)) ?

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

            1 Reply Last reply Reply Quote 0
            • thomthomT Offline
              thomthom
              last edited by

              Just realised the cause of the error I reported earlier:

              You're calling msg=(db("Manifold: Orienting Faces")) from within the class Sketchup::Face scope, while db() is defined within the Manifold class.

              Making db() into a Class method instead of Instance method def self.db(string) and changing

              msg=(db("Manifold: Orienting Faces")) to msg=(Manifold.db("Manifold: Orienting Faces")) (line 304)
              and
              puts(db("Manifold: orient faces aborted.")) to puts(Manifold.db("Manifold: orient faces aborted.")) (line 318)
              makes it work.

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

              1 Reply Last reply Reply Quote 0
              • thomthomT Offline
                thomthom
                last edited by

                The groups that it creates, is it suppose to be offset from the original group?

                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

                  @thomthom said:

                  Just noticed, when I reload your script, load 'manifold.rb' it keeps adding more menu items.

                  Think it's because of the last line: file_loaded(__FILE__)
                  Should it not be: file_loaded(File.basename(__FILE__)) ?

                  whopops ! update in the pipeline... 😳
                  I'll also fix the db() error...

                  TIG

                  1 Reply Last reply Reply Quote 0
                  • thomthomT Offline
                    thomthom
                    last edited by

                    @thomthom said:

                    On a sidenote: you can save some lines in your remove_inner_faces method by using more of Ruby's Enumerator and Array methods:

                    
                    > def remove_inner_faces()
                    > 	faces = @gents.select { |e| e.class==Sketchup;;Face }
                    > 	faces_to_go = faces.select { |face| face.outer_loop.edges.any? { |e| e.faces.length > 2  } }
                    > 	faces_to_go.each{|e|
                    > 		if e.valid?
                    > 			clone_removed_into_error_group([e]+e.edges)
                    > 			e.erase! if e.valid? 
                    > 		end#if
                    > 	}
                    > end
                    > 
                    

                    I just noticed them not too long ago while having another look at the Ruby docs, I realised I could cut down a number of lines in most my scripts.

                    Never mind this code. Seems to have a bug in it.

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

                    1 Reply Last reply Reply Quote 0
                    • thomthomT Offline
                      thomthom
                      last edited by

                      Got a case where the internal faces is removing too much. See attached file. Run the script on the large cube.


                      manifold tester.skp

                      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

                        Here's v1.1 with some glitch fixes http://forums.sketchucation.com/viewtopic.php?p=218691#p218691

                        TIG

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

                          @thomthom said:

                          Got a case where the internal faces is removing too much. See attached file. Run the script on the large cube.

                          I'll look into it...
                          EDIT: removes innermost groups of outer-faces [?] AND leaves internal-faces edges behind [that's an easy fix] ❓

                          TIG

                          1 Reply Last reply Reply Quote 0
                          • D Offline
                            driven
                            last edited by

                            fantastic,

                            go out on a family errand and come back to a whole new playing field, anything I can do to help?
                            a 'test' skp, if you need something more taxing,
                            or I'll try repairing it myself when you've got the next one up...
                            or need a tester... whatever you need...

                            this slow to hand stitch example of what I'm try to do with 3D printed stainless
                            about 25% of the poly count I would normally use for this sort of thing, and not triangulated.

                            john

                            learn from the mistakes of others, you may not live long enough to make them all yourself...

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

                              driven

                              I'll look at your problem - TT has already come up with one set of problems to fix !
                              With yours I get a non-planar points error - since there's only 3 of them it seems a bit strange... πŸ˜•
                              We're really at 'beta' testing now - I only outlined the ideas some hours ago and issued this as my first go - it WILL get better πŸ˜‰

                              TIG

                              1 Reply Last reply Reply Quote 0
                              • pilouP Offline
                                pilou
                                last edited by

                                Very useful for boats builders πŸ˜‰

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

                                1 Reply Last reply Reply Quote 0
                                • D Offline
                                  driven
                                  last edited by

                                  @unknownuser said:

                                  Very useful for boats builders πŸ˜‰

                                  and don't forget the humble Air Bed makers of the world...

                                  TIG,
                                  I did this simply to save you having to draw-up or look for something relevant to test on

                                  the last 3 letters in watertight might contain none planer points, one had to be over-drawn with a poly-line and two unsoftened with eraser on the bottoms, before I could JPP them, oh the bottom of that A I made a real hash of.. missed it out and went back... I was in a rush...

                                  I made the ring quite well, two joints (triangulated) near you name, I chose a ragged font in an attempt to create tiny voids and was surprised how well it came out. Fredo's Joint PushPull is remarkably clean, I have another test piece on file that is pilfered with bad seams if that's more useful.

                                  john

                                  I'll give anything a spin, it's great that your on the case...

                                  learn from the mistakes of others, you may not live long enough to make them all yourself...

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

                                    Here's v1.2 http://forums.sketchucation.com/viewtopic.php?p=218691#p218691
                                    Basic Ticker added. Better processing for inner faces.
                                    Three-faced-edged external-faces now usually kept. [fixed TT's ball-breaker boxy mess πŸ˜„ ]
                                    FR lingvo updated by Pilou. πŸ˜‰

                                    Still struggling with driven's monster...

                                    More feedback and ideas please... πŸ€“

                                    TIG

                                    1 Reply Last reply Reply Quote 0
                                    • D Offline
                                      driven
                                      last edited by

                                      @tig said:

                                      Here's v1.2 http://forums.sketchucation.com/viewtopic.php?p=218691#p218691
                                      Still struggling with driven's monster...

                                      More feedback and ideas please... :ugeek:

                                      that's the simple version, so far it's taken 2hrs 14 min and 49seconds just to explode all the groups so I can then re-group to test the plug on it (and it's only 600,000+ poly's)

                                      I just fired up the other computer so I'll do some simple tests on it, while I wait

                                      learn from the mistakes of others, you may not live long enough to make them all yourself...

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

                                        @driven said:

                                        @tig said:

                                        Here's v1.2 http://forums.sketchucation.com/viewtopic.php?p=218691#p218691
                                        Still struggling with driven's monster...
                                        More feedback and ideas please... πŸ€“

                                        that's the simple version, so far it's taken 2hrs 14 min and 49seconds just to explode all the groups so I can then re-group to test the plug on it (and it's only 600,000+ poly's)
                                        I just fired up the other computer so I'll do some simple tests on it, while I wait

                                        I've added some more error reporting in the console to my own version so I can at least see what these errors are - seems related almost exclusively now to healing very tiny holes ?
                                        I'm thinking perhaps to move these vertices to heal these tiny gaps rather than fail making edges that are too small inside a 'rescue' ? It would change the model's form, but so slightly you'd never notice...

                                        Watch this space πŸ€“

                                        TIG

                                        1 Reply Last reply Reply Quote 0
                                        • D Offline
                                          driven
                                          last edited by

                                          Did you scale it up even more?

                                          learn from the mistakes of others, you may not live long enough to make them all yourself...

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

                                            @driven said:

                                            Did you scale it up even more?

                                            Scaling it up x100 or so might make the tiny gaps 'face' - but I looking at pinching the nearly closed verices together so that the gap goes... without much success it has to be said ! 😞

                                            TIG

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

                                            Advertisement