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?
Announcement
Collapse
No announcement yet.
Attaching imported CAD objects breaks normals
Collapse
X
-
Attaching imported CAD objects breaks normals
Aleksandar Mitov
www.renarvisuals.com
office@renarvisuals.com
3ds Max 2023.2.2 + Vray 7 Hotfix 1
AMD Ryzen 9 9950X 16-core
96GB DDR5
GeForce RTX 3090 24GB + GPU Driver 566.14Tags: None
-
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 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
-
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
-
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.
Comment
-
Originally posted by Alex_M View PostBUT some objects get inverted normals that I can't seem to flip no matter what I try.
Comment
-
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 PostPut a Edit Normal modifier on top and reset the normals (if the handles are green, they are wrong, if they are blue = correct).
I've attached the CAD object if anyone is willing to help - CAD.zip (Max 2016 and up).Attached FilesLast edited by Alex_M; 05-11-2018, 07:58 AM.Aleksandar Mitov
www.renarvisuals.com
office@renarvisuals.com
3ds Max 2023.2.2 + Vray 7 Hotfix 1
AMD Ryzen 9 9950X 16-core
96GB DDR5
GeForce RTX 3090 24GB + GPU Driver 566.14
Comment
-
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
-
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 7 Hotfix 1
AMD Ryzen 9 9950X 16-core
96GB DDR5
GeForce RTX 3090 24GB + GPU Driver 566.14
Comment
-
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 7 Hotfix 1
AMD Ryzen 9 9950X 16-core
96GB DDR5
GeForce RTX 3090 24GB + GPU Driver 566.14
Comment
-
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
-
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.
Comment
Comment