Announcement

Collapse
No announcement yet.

Attaching imported CAD objects breaks normals

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Attaching imported CAD objects breaks normals

    I've got a bunch of CAD objects (IGS format) that I need to attach into a single Editable Mesh object but as soon as I do this the normals break and I get seams in places where there shouldn't be. I already tried using the Collapse utility as per recommendations on the internet which attaches and preserves the normals BUT some objects get inverted normals that I can't seem to flip no matter what I try. Any suggestions?
    Aleksandar Mitov
    www.renarvisuals.com
    office@renarvisuals.com

    3ds Max 2023.2.2 + Vray 6 Update 2.1
    AMD Ryzen 9 9950X 16-core
    64GB DDR5
    GeForce RTX 3090 24GB + GPU Driver 551.86

  • #2
    Put a Edit Normal modifier on top and reset the normals (if the handles are green, they are wrong, if they are blue = correct).
    A.

    ---------------------
    www.digitaltwins.be

    Comment


    • #3
      Do you have to attach them, can you just group them instead ?

      Comment


      • #4
        I unfortunately can't supply a direct solution since we use inhouse tools for those sort of problems. Are you familiar with maxscript? In that case this might help:

        Most of those problems are based on the fact that imported CAD data tends to use explicit normals (green) that are set at fixed values, rather than being derived from smoothing groups. As soon as objects are attached, IDs (of vertices, edges, normals) of the attached object are offset by the highest ID of the mesh you are attaching to, which leads to those IDs no longer having access to explicit normal data. One way of dealing with that is to write your own attach script, which would need to do the following:

        - collect normals from "ObjA" (apply EditNormals modifier, collect normals)
        - collect normals from "ObjB" (optionally converting them if "ObjA" and "ObjB" don't use the same transform)
        - join those two normal arrays
        - attach "ObjB" to "ObjA"
        - apply EditNormals modifier, cycle through normals (1 to number of normals) and apply corresponding normal value from the joined normal array

        Comment


        • #5
          This is a known limitation since the beginning of 3dsmax. The only way to keep normals is to use the Collapse command instead, found in the Utility Tab > Collapse.
          Keep in mind that other commands like Detach will also break normals. If you need to 'detach' elements without breaking normals, a workaround it to copy your original object and delete the part to be 'detached' from one object while deleting the inverted selection from the other one. This operation can be scripted.

          Comment


          • #6
            I always use this script: never had any problems with the normals when I used this, but then again I only do archviz. http://www.scriptspot.com/3ds-max/scripts/quick-attach Reset the normals after attaching them with the same script.
            A.

            ---------------------
            www.digitaltwins.be

            Comment


            • #7
              Collapse utility in single object mode always worked, never failed on our end.
              Normals break on CAD geometry on many kinds of operations. Even throwing an edit poly onto the geometry breaks normals. Maybe a list of do's and dont's with CAD geometry would help.
              https://www.behance.net/Oliver_Kossatz

              Comment


              • #8
                Originally posted by Alex_M View Post
                BUT some objects get inverted normals that I can't seem to flip no matter what I try.
                Can you share some simple parts that illustrate the issue? Max has several ways to fix any kind of flipped normal problem.

                https://www.behance.net/Oliver_Kossatz

                Comment


                • #9
                  Here's what happens when I use the Collapse utility (attached). I tried the script Vizioen suggested and followed the steps (Attach then Reset) but the smoothing groups still break.

                  Originally posted by Vizioen View Post
                  Put a Edit Normal modifier on top and reset the normals (if the handles are green, they are wrong, if they are blue = correct).
                  I just trued this and the normals were green. When I click "Reset" they become blue but the smoothing groups break.

                  I've attached the CAD object if anyone is willing to help - CAD.zip (Max 2016 and up).
                  Attached Files
                  Last edited by Alex_M; 05-11-2018, 07:58 AM.
                  Aleksandar Mitov
                  www.renarvisuals.com
                  office@renarvisuals.com

                  3ds Max 2023.2.2 + Vray 6 Update 2.1
                  AMD Ryzen 9 9950X 16-core
                  64GB DDR5
                  GeForce RTX 3090 24GB + GPU Driver 551.86

                  Comment


                  • #10
                    Strange. Is the object showing inverted normals mirrored or scaled negatively?
                    To flip explicit normals, don't use the modifier as this one can't handle explicit normals, use the Flip command in E-Mesh/E-Poly instead. This has been fixed to keep normals intact in Max 2014 or 2016, not sure (before that, the Flip command would garble explicit normals just like the modifier).
                    Unfortunately, Max has a lot of tools and modifiers that will clean normal data. Only a few of the commands will keep them so you have to be extra careful and only use those that keep them.

                    Comment


                    • #11
                      No, the objects are not scaled in any way. They're left as is after importing. I tried to flip the normals in Ediable Mesh but that didn't help. I've attached the Max file with the CAD geometry in my previous message so you can try yourself.
                      Aleksandar Mitov
                      www.renarvisuals.com
                      office@renarvisuals.com

                      3ds Max 2023.2.2 + Vray 6 Update 2.1
                      AMD Ryzen 9 9950X 16-core
                      64GB DDR5
                      GeForce RTX 3090 24GB + GPU Driver 551.86

                      Comment


                      • #12
                        Why didn't you try attaching on body level and then convert to mesh ? Works flawlessly...
                        I just can't seem to trust myself
                        So what chance does that leave, for anyone else?
                        ---------------------------------------------------------
                        CG Artist

                        Comment


                        • #13
                          Most of the time I need parts of the object at different mesh density for optimization reasons. If I attach them in one object they all have the same mesh quality preset.
                          Aleksandar Mitov
                          www.renarvisuals.com
                          office@renarvisuals.com

                          3ds Max 2023.2.2 + Vray 6 Update 2.1
                          AMD Ryzen 9 9950X 16-core
                          64GB DDR5
                          GeForce RTX 3090 24GB + GPU Driver 551.86

                          Comment


                          • #14
                            Ah, I've seen this before. For some reason, normals get transformed differently in one axis. What's the original CAD package? I've seen similar issues with data from Catia, but it could be anything, exporters, importers or the file format used.

                            I just tried your file - it works correctly when you ResetXForm the object before. Usually, this will garble normals but for some reason it doesn't here and they stay intact. Heck, explicit normals are a mystery in Max and it's amazing how inconsistent they can be.

                            Or, as Paul pointed out, attach on Body Object level, but keep in mind that Body Objects have no undo and tend to be instable, sometimes make objects disappear etc. It's a big mess, unfortunately.

                            Comment


                            • #15
                              Indeed, attaching the body objects and then converting works as expected.
                              Personally, I decided not to use the body objects, because they are ancient. The implementation is not up to date. I prefer the tesselated method on IGES/STEP import. This might not be necessary with these two parts. However, if you have to deal with 1000 parts imported as body objects, Max will simply stall.
                              https://www.behance.net/Oliver_Kossatz

                              Comment

                              Working...
                              X