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

    Reverse faces to match... ruby.

    Scheduled Pinned Locked Moved Developers' Forum
    14 Posts 7 Posters 1.8k Views 7 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.
    • boofredlayB Offline
      boofredlay
      last edited by

      Is there a ruby that will automatically reverse faces to match a selected face? For example, select a face in a view and run a script that reverses all the faces in view to match.

      Or, reverse faces away from origin? For example, place a model with the center most point at the origin and have all the faces orient away from the origin.

      The reason I ask is sometimes I bring in a Revit file to do a quick geometry study (much easier in SU). The resulting import has no rhyme or reason as far as I can tell regarding face orientation.
      See example here:
      RS2.jpg
      This was exported from Revit to dwg then imported into SU. The geometry is spot on however the faces... not so much. Also, the import is mostly exploded which is a big bummer.

      Anyway, thanks in advance for any info.

      http://www.coroflot.com/boofredlay

      1 Reply Last reply Reply Quote 0
      • A Offline
        azuby
        last edited by

        One idea: If none of the faces has material applied, select all faces, go to Window > Element information, click on the material (the square), chose a material. So you will have all your faces with material on the "white side" Than use the FFlipper tool, than remove the material on all faces.

        azuby

        *error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT

        Bad English? PM me, correct me. :smile:**

        1 Reply Last reply Reply Quote 0
        • jujuJ Offline
          juju
          last edited by

          Not AFAIK. You'll probably need a workaround.

          Does it matter much though? Rendering apps like Kerky have been 'fixed' so that it wouldn't matter which way the face is showing. I suppose it depends on your workflow...

          +++ EDIT +++
          I was thinking along the lines of the workaround azuby mentioned above.

          Save the Earth, it's the only planet with chocolate.

          1 Reply Last reply Reply Quote 0
          • J Offline
            Jim
            last edited by

            One technique I remember from here is to assign a shortcut to Reverse Faces, then select the PushPull tool because it does auto-select on hover. Then, hover the PushPull tool over each face and hit the shortcut key - it makes quick work of it.

            Hi

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

              Hi,
              Maybe I'll try to write a little ruby that will reverse the faces which are not pointing in the same direction than the camera. Then you'll have to walk around your model and quickly reverse most of the wrong faces. The problem (for me) will be to select only the visible faces in the view...

              DB

              1 Reply Last reply Reply Quote 0
              • boofredlayB Offline
                boofredlay
                last edited by

                Thanks everyone for the info.

                Azuby, as I don't understand German I am having difficulty finding your script.
                Thanks for looking into writing a ruby Didier.
                Jim, that is a slick trick, thanks 👍

                http://www.coroflot.com/boofredlay

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

                  Hi Boofredlay,
                  I think I've got it 😍 . Could you send the skp so I can test on a real case ?
                  The script actually reverses 100% of the wrong oriented faces of the model, seen from a perspective camera. It takes 1 second on a 1000 faces model 😄, casting 1000 rays through the screen.
                  Next step: do a virtual camera turn around the model n times to examine all faces in a single process, and dig into groups.

                  DB

                  1 Reply Last reply Reply Quote 0
                  • boofredlayB Offline
                    boofredlay
                    last edited by

                    Check your PM. 🤓

                    http://www.coroflot.com/boofredlay

                    1 Reply Last reply Reply Quote 0
                    • A Offline
                      azuby
                      last edited by

                      Well, click the "Software" link on my website and there you will have it all in German AND English.

                      azuby

                      *error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT

                      Bad English? PM me, correct me. :smile:**

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

                        If it's all one 'big lump' of geometry 'align faces' might work off the context-menu (pick one 'good' face first). I have also written an 'align_faces.rb' [that on Didier's site] that mimics this in Ruby scripts...

                        TIG

                        1 Reply Last reply Reply Quote 0
                        • boofredlayB Offline
                          boofredlay
                          last edited by

                          @azuby said:

                          Well, click the "Software" link on my website and there you will have it all in German AND English.

                          azuby

                          Thanks.
                          I get an error loading however.
                          Error.jpg

                          http://www.coroflot.com/boofredlay

                          1 Reply Last reply Reply Quote 0
                          • A Offline
                            azuby
                            last edited by

                            I see ... I haven't used the tool since two or three Sketchup versions. Google modified the code for language things, that causes the error. I go into it the next days.

                            azuby

                            *error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT

                            Bad English? PM me, correct me. :smile:**

                            1 Reply Last reply Reply Quote 0
                            • boofredlayB Offline
                              boofredlay
                              last edited by

                              @unknownuser said:

                              Right-click and choose Orient Faces. If everything is then backfaced triple-click the mesh and right-click again and choose Reverse Faces.

                              That does not work. Some faces reverse, others do not. It actually makes it worse in this case.

                              http://www.coroflot.com/boofredlay

                              1 Reply Last reply Reply Quote 0
                              • GaieusG Offline
                                Gaieus
                                last edited by

                                When geometry reaches a certain complexity, the Orient faces command starts behaving weirdly ; some faces aree reversed some not - but the bigger problem is that it reverses front faces also (as if SU could find out what should be outside and what inside).

                                As I remember Ross posted a +nice" example a while ago when he got stumped with this (it's in the "lost topics" I think).

                                Gai...

                                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