Reversed Normals When Importing DAE & OBJ from Rhino

6556
11
Jump to solution
05-05-2015 11:33 AM
VeronicaAnderson
New Contributor II

What can I do to make sure that I don't have reversed normals before exporting/importing a bunch of geometry into CityEngine from Rhino? All the surfaces I created were basically done the same way and I'm not sure why they are coming into CityEngine all randomly backwards. Actually, I'm sure it's not random, but it's frustrating and a waste of time and I'd like to understand why this happens and what I can do about it. I've attached the offending files in DAE, OBJ and Rhino format, for your convenience.

0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

I use the same process, from Rhino to CE - both 2D surfaces, and 3D models with textures - and I get the same problems.

Usually I'm bringing in 2D surfaces drawn from plan view. When I see many facing down and many facing up, then I write a rule like this:

Shape --> extrude(100)

Applied to those shapes the extrusion will either go down or up, then I select the down facing shapes from the side view so as to only select the shapes with reversed normals. You might have to cut and paste those shapes to another layer depending on which CE version you are on (and then select them by layer). Main idea is after you have all of those shapes selected, then in shapes menu do "Reverse Normals" ( and then put them back on correct layer if you had to change their layer). For small imports (<20 objects reversed maybe), then just hold shift while selecting each shape.

For 3D models, I just go back to the original Rhino model, and use Flip to reverseNormals, then export again replacing the current model (be sure to refresh the folder in CE containing the model). I think that Rhino's Dir is also for that, but gives more options. Try both and see which is best.

Also, to see which faces on your models have normal problems, use the gear icon above the viewport, and turn on "Backface Culling" this will show the faces as transparent if you are behind them. This is how the WebScene view displays models, so if you are exporting to web scene, then it is best to turn this on and check over your model before exporting.

Chris

View solution in original post

0 Kudos
11 Replies
by Anonymous User
Not applicable

I use the same process, from Rhino to CE - both 2D surfaces, and 3D models with textures - and I get the same problems.

Usually I'm bringing in 2D surfaces drawn from plan view. When I see many facing down and many facing up, then I write a rule like this:

Shape --> extrude(100)

Applied to those shapes the extrusion will either go down or up, then I select the down facing shapes from the side view so as to only select the shapes with reversed normals. You might have to cut and paste those shapes to another layer depending on which CE version you are on (and then select them by layer). Main idea is after you have all of those shapes selected, then in shapes menu do "Reverse Normals" ( and then put them back on correct layer if you had to change their layer). For small imports (<20 objects reversed maybe), then just hold shift while selecting each shape.

For 3D models, I just go back to the original Rhino model, and use Flip to reverseNormals, then export again replacing the current model (be sure to refresh the folder in CE containing the model). I think that Rhino's Dir is also for that, but gives more options. Try both and see which is best.

Also, to see which faces on your models have normal problems, use the gear icon above the viewport, and turn on "Backface Culling" this will show the faces as transparent if you are behind them. This is how the WebScene view displays models, so if you are exporting to web scene, then it is best to turn this on and check over your model before exporting.

Chris

0 Kudos
VeronicaAnderson
New Contributor II

Yay, Chris!

I'll use Dir before exporting from Rhino from now on to check my geometries and eliminate some unnecessary back and forth. Thanks for saving the day!

Cheers,
V

0 Kudos
by Anonymous User
Not applicable

No problem. I like using Rhino with CityEngine.

Chris

0 Kudos
VeronicaAnderson
New Contributor II

Me too. I've never used 3dsMax so I'm not 100% informed on this, but to me CE & Rhino are like the power couple of the 3d modeling world. If only Rhino could get some geolocation capabilities going then life would be perfect.

0 Kudos
BenLeslie1
Occasional Contributor III

Sounds like you have a solution so just a thought:- I wonder if the orietation of the faces is linked to the direction the polygons were originally drawn

e.g. clockwise polygons face-up

       anti-clockwise polygons face-down...... or visa versa

.......just a thought..........

0 Kudos
MatthiasBuehler
Occasional Contributor III

Hey,

Yes, the vertex order drives the normal direction.

Btw. you can write a rule that automatically fixes the orientation if needed.

Let me know if yo need the code.

Matt

Matthias Buehler

Head of 3D Technologies

twitter: @MattB3D

-------------------------------------

Garsdale Design Limited

matthias.buehler@garsdaledesign.co.uk

www.garsdaledesign.co.uk

0 Kudos
VeronicaAnderson
New Contributor II

Hey Matt,

That would be a good code to have if you are willing to share please post!

-V

0 Kudos
MatthiasBuehler
Occasional Contributor III

There we go ..

normalYComponent = convert(y, scope, world, orient, 0, 1, 0) - convert(y, scope, world, orient, 0, 0, 0) # calc scope normal's y component in world coords

Shape -->

    alignScopeToAxes(y)

    ShapeAligned

ShapeAligned -->

    case normalYComponent >= 0: # if positive: ok, otherwise reverse normals !

        TestMove

    else:

        reverseNormals

        TestMove

TestMove -->

    t(0,1,0)

Matthias Buehler

Head of 3D Technologies

twitter: @MattB3D

--------------------------------------

Garsdale Design Limited

matthias.buehler@garsdaledesign.co.uk

www.garsdaledesign.co.uk

chandrasekhar_reddyguda
New Contributor III

Matthias Buehler

i am also having the same problem, normals problems getting when importing drawing file, please share a code of .net

0 Kudos