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

    Reverse faces

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 4 Posters 794 Views 4 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.
    • L Offline
      lekonna
      last edited by

      Before i start to climb this particular hill i'd like to ask if you know of such a script already.

      The point is that i have some acad models that include a staggering amount of faces which for some reason are facing in random directions. However the model should be always solid so it would be enough for me to just check the normals of the faces and compare those to the camera and if they are not opposite i could just reverse the face.

      Can you spot a fatal flaw in the reasoning or provide a good starting point for this work ?
      I guess it would involve selecting all faces in the FOV and doing some vector-magic on them?

      Br,
      Janne Kotka

      1 Reply Last reply Reply Quote 0
      • H Offline
        Howard leslie
        last edited by

        Janne,
        Reversed Faces...
        Zoom out and select all faces that need turning around, then
        Right Click - Reverse Faces
        Do the bulk of your problem areas like this.
        ...
        To reverse the remaining faces that are mixed in with "correct" faces (and therefore have to be selected individually):
        Download
        http://www.smustard.com/script/ReverseFaces
        (Thank you Todd)
        This Script Speeds things up considerably
        A one click tool to reverse faces - really useful
        ...
        Hope this helps
        Howard L'

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

          Could be done automatically:

          Don't know whether you can add material to the faces in the other program. If it is possible, do it. If the import in Sketchup also includes the materials on the faces AND the material is only on one side (i.e. outside of a cube), you can use the FFlipper plugin (see my website).

          OR

          It is possible to write an extension for doing it automatically. How to program?

          • Ask the user to select a face which is in right direction.
          • Get the normal of this face.
          • Recursively get all faces which are connected to the chosen face and check their normals against the normal of the chosen face.
          • (some more investigation on the "if" for flipping the face - YES, my knowledge in mathematics is a bit rusty)

          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
          • L Offline
            lekonna
            last edited by

            ok thanks guys, i have to start looking into this.

            i would transfer these faces manually but since the models are not originating from
            sketchup it means that they are pretty high on polycount (30k-100k) and flipping even 1000 faces manually is bit, well, horrible 😄

            1 Reply Last reply Reply Quote 0
            • Al HartA Offline
              Al Hart
              last edited by

              @lekonna said:

              However the model should be always solid so it would be enough for me to just check the normals of the faces and compare those to the camera and if they are not opposite i could just reverse the face.

              If you imagine a box with 6 faces which are all aligned correctly, the 3 faces which are visible would have their normals match the camera and the three faces which are invisible would have their normals the opposite of the camera. So the "trick" is to determine which faces are visible, and which faces are obstructed by other faces.

              Todd Burch was working of a script to solve this problem, but I never heard if he got it finished.

              I don't know any easy way to determine if a face is visible or obscured in a particular view.

              Al Hart

              http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
              IRender nXt from Render Plus

              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