Author Topic: CAD / NURBS surfaces vs clean topology  (Read 11268 times)

2017-12-06, 17:12:20

lacilaci

  • Active Users
  • **
  • Posts: 749
    • View Profile
Hi guys,

I'm curious how you think about CAD-exported type of 3D models.

Let's say Rhino or Alias etc, pre-tesselated models. Not messy and overlapping geometry but no subD and clean topology.

Do you use these type of models in your viz or other type of renderings or do you avoid it and prefer clean subD topology?

2017-12-06, 18:37:18
Reply #1

pokoy

  • Active Users
  • **
  • Posts: 1866
    • View Profile
If you get CAD data from a client you probably don't have time and resources to remodel but that certainly depends on the amount of work. Remodeling can be beneficial (more organic appearance, less problems when unwrapping) but some things are just super hard or impossible to model with polys/subDs alone. Tris aren't a problem unless you happen to use tools in Max that invalidate explicit normals, in that case you are going to either have to live with shading problems or remodel... or fix normals manually, super cumbersome if too many.
However, current Max versions handle NURBS meshes well most of the time - it was much worse with max 2012 for example - and there are workarounds that help you keep the normals intact.

We are using a lot of CAD data here but the quality varies a lot, some models have all the details but are constructed sloppily, for example when surface patches aren't sewed and you get tiny holes between them. This is actually a common problem since CAD programs may tesselate on the fly and always display perfect meshes, CAD people usually aren't really aware of the fact that this may causes headaches for other folks down the road.

Some datasets are really great and clean but may not have sufficient detail or don't reflect the final product. CAM data used for production is very detailed and has all the final changes in it but many of the last second changes aren't back-ported into the CAD model once the data is handed out to the manufacturer to save cost.

Depending on the desired level of detail, we either add small stuff and details as separate poly objects, keep everything as is if it's good enough or remodel if it solves a lot of problems in one go and is manageable in regards to the budget and deadline. Sometimes I'll use MoI3d (an inexpensive NURBS modeling app, however not as powerful as the full-fledged packages) to sew patches, clean out garbage data, cut holes, add chamfers etc. IF possible.

One thing I'm grateful for is that importers are now included in Max, this makes it a lot easier, though both importers (Body Objects vs ATF) have their issues.

But CAD data is such a broad topic - what info exactly are you after? :D

2017-12-06, 19:17:06
Reply #2

lacilaci

  • Active Users
  • **
  • Posts: 749
    • View Profile
Thanks for that answer.

I'm trying to figure out best way to tesselate my cad models and want to know what other people find important in cad-exported data, or even if they would use such if there was an option to go for clean topology instead of controlled surface.

One important thing you mentioned was sewing/welding vertices. But what if tesselation was good enough that the elements touch and possible gap between meshes would be under a 0.01mm? Would it still be a problem?

I was working with cad data for long time and never cared about such things as long as client got what they wanted. But now i have a chance to work with rhino/alias and if i end up sharing my models i want to make sure the data is readable for someone else and also good enough quality.

2017-12-06, 20:20:07
Reply #3

pokoy

  • Active Users
  • **
  • Posts: 1866
    • View Profile
I see. Yes, the sewing part is important because it's something that can't be fixed in Max once it's tesselated, and the Body Object will often fail to sew open edges properly... and it has no undo. So working with problematic NURBS geometry in Max is quite a painful and fruitless endeavor. In addition, if you happen to discard explicit normals, be it intentionally or accidentally, Max' smoothing will not be able to build smoothing groups correctly across patches. It will produce artifacts in all cases, but if patches aren't sewed, edges will not line up between adjacent surfaces and it's likely to produce even more artifacts.

If you want to sell/hand out tesselated models, I really like how you can evenly divide the surfaces with Body Objects. Usually, NURBS packages will export meshes where some tris may end up being reeeeally long and thin, and if you'd like to deform or bend the object in Max you're screwed and end up having to remodel those objects.

One thing I haven't mentioned that's quite important is accuracy in NURBS. I have seen quite a few models that suffer from trim leftovers that NURBS internally use for chamfers and subsequent booleans, where spheres or cylinders will be visible in places that were chamfered. The more accurately the models are constructed the better are the tesselated results. Your CAD app may not display any problems but you never know what the exporters and importers do.

Best way to test the quality of CAD models - for Max, can't speak for other use cases - is to import as Body Object and go through a few of the tesselation options and see if/when they break. For example, do you get open edges that never close regardless of the level of detail? Are the geometries coming in as solids or do you always get open edges? This is often a side effect of low accuracy that works fine in the CAD app but not in the vertex world.

Yet another thing to keep in mind though is that the current Body Object library in Max is outdated. It's licensed from NPower but apparently they don't use NPower's most recent libraries. I've come across a considerable number of STEP and IGES files that will have issues when imported as Body Object but import perfectly fine when using current plugin versions from NPower. Maybe newer Max versions use newer version of their tech, but for Max 2016 it's not the case, and I doubt it since they focused on their own ATF importers with Max 2017 and up. It's a bit of a black box, unfortunately.

2017-12-06, 20:45:47
Reply #4

lacilaci

  • Active Users
  • **
  • Posts: 749
    • View Profile
Yeah i used default max importer and also npower translators in past. However the more complex objects the more deffective import seemed to be. From missing parts to ineffectively tesselating some areas while over - tesselating others. Body object options help here and there especialy from rhino and siemens nx exports from what i've seen. However so far the best results I've seen were direct object exports from alias(optimal polycount, no defects, basicaly you can get nice result as seen in viewport ) Still connections not welded but so far I haven't seen rendering defects...

Will probably share here some excercise models, but need to finish them first.

2017-12-06, 21:36:09
Reply #5

pokoy

  • Active Users
  • **
  • Posts: 1866
    • View Profile
Great, if you share something I can have a look.

As you say, the ATF importer is too black-boxy for me, no control over the tesselation and inconsistent density. What it does really good, though, is that it'll manage to get perfectly closed solids without errors, and everything's welded correctly. But, too little control for my needs.

2017-12-07, 02:05:24
Reply #6

Shawn Astrom

  • Active Users
  • **
  • Posts: 244
    • View Profile
I use MOI for geometry conversion has an amazing capability for exporting. Still though Corona has issues reading the notmals correctly in C4D. Maybe someone could actually test MOI exports inside of 3ds Max to see how they look?

- Shawn

2017-12-07, 06:47:52
Reply #7

lacilaci

  • Active Users
  • **
  • Posts: 749
    • View Profile
Never used MOI but from experiences with alias, it's much easier to fix normals in there before export, than in max.

Usualy the surfacing software will need evaluation tool to show where are the surfaces facing.

If you checked normals in MOI and they turn during export it might be a bug though.

2017-12-07, 08:24:46
Reply #8

pokoy

  • Active Users
  • **
  • Posts: 1866
    • View Profile
I use MOI for geometry conversion has an amazing capability for exporting. Still though Corona has issues reading the notmals correctly in C4D. Maybe someone could actually test MOI exports inside of 3ds Max to see how they look?

- Shawn
Not sure if the shadow terminator fix made its way into C4d, but if this happens only with Corona try disabling it if the controls are exposed. In Max, it will produce artifacts in some cases when used on CAD meshes with explicit normals.

If you happen to have a CAD mesh that has problems, post an OBJ here and we can compare how it looks in Max.

2017-12-07, 17:18:18
Reply #9

Shawn Astrom

  • Active Users
  • **
  • Posts: 244
    • View Profile
Thanks so much pokoy! Below is a link to the .obj file and some reference renderings of the issue with Corona and Cinema 4D normals/vertex normals not being rendered correctly... This had been driving me crazy because every other render engine I use renders these CAD exports just fine :)

Let me know what you think. Here's a link to the .obj file I tested... https://we.tl/d10e1ltBDu

- Shawn


I use MOI for geometry conversion has an amazing capability for exporting. Still though Corona has issues reading the notmals correctly in C4D. Maybe someone could actually test MOI exports inside of 3ds Max to see how they look?

- Shawn
Not sure if the shadow terminator fix made its way into C4d, but if this happens only with Corona try disabling it if the controls are exposed. In Max, it will produce artifacts in some cases when used on CAD meshes with explicit normals.

If you happen to have a CAD mesh that has problems, post an OBJ here and we can compare how it looks in Max.

2017-12-07, 17:32:41
Reply #10

Shawn Astrom

  • Active Users
  • **
  • Posts: 244
    • View Profile
P.S. I still feel as if Corona is not reading Cinema's Vertext Normals (tag) correctly apart from the shadow terminator fix... I believe the latest C4D beta is using the 1.7.2 Corona core...

2017-12-07, 17:58:43
Reply #11

lacilaci

  • Active Users
  • **
  • Posts: 749
    • View Profile
I've looked at your obj and there are no problems in rendering until i try to remove smoothing groups and do an autosmooth inside max. Then it gets weird and shows those artifacts.

EDIT: I think one way of solving this would be to actually keep the fillets unwelded so that smoothing doesn't go from fillet to another surface. But if that obj is all you got to work with, that might be a problem.
« Last Edit: 2017-12-07, 18:11:51 by lacilaci »

2017-12-07, 18:18:46
Reply #12

lacilaci

  • Active Users
  • **
  • Posts: 749
    • View Profile
The way I think about it is, that one thing is tesselation tolerances and another welding tolerances.

If you have good tesselation tolerance set up connections between surfaces can stil create tiny gap that might not even be visible during rendering until you go super close.

But if you enforce welding, then some vertices might get moved and break surface continuity and also smoothing will be prone to artifacts. If the model is built to some class A standards bellow 0.003mm i guess, then a really good tesselation could be made even if you need super crazy close ups..

2017-12-07, 18:31:08
Reply #13

jasond

  • Active Users
  • **
  • Posts: 39
    • View Profile
The default cad format importer in Max is horribly outdated. If you work with IGES or Step files more often, take a look at PolyTrans, been using it for a few years now on all our CAD assemblies. You can fully customize your import options and mesh quality... You won't get perfect quads but you'll get good enough tesselation that might solve the problem with your current model. All the welding, etc. is done for you (unless the cad model is sketchy).

2017-12-07, 18:50:56
Reply #14

pokoy

  • Active Users
  • **
  • Posts: 1866
    • View Profile
Sorry but it's really the shadow terminator fix, at least in Max.

Have a look at the attched images (apparently we can't use attached images in the posts):

CAD_Geometry_Viewport.jpg - This is how it looks in Max. Actually, there's a problem with how Max reads the MoI object. It retriangulates n-gons and will mess up holes, at least for Max you should always export OBJ with tris&qads from MoI. But still, normals are perfect.

CAD_Geometry_Terminator_Fix_OFF.jpg - Rendered with Shadow Terminator set to OFF (value = 1, not 0 as one would assume)

CAD_Geometry_Terminator_Fix_ON.jpg - Rendered with Shadow Terminator set to ON. Say hello to normal artifacts.

In C4D though, it could be that explicit normals are recalculated, I think this would happen if Corona assumes the Phong tag automatically. To be sure, you should disable the Shadow Terminator fix and see if it helps. If it doesn't help you'll have to talk to the devs to see if they handle explicit normals correctly in C4D.