1
$\begingroup$

I am building, with Python scripting, a sculpture by creating many plane meshes and joining them together. I have full control of the planes' surface normals, but I'm confused how to set them. As of now, I'm setting them arbitrarily, and the render seems fine.

My intuitions about surface normals are that neighboring faces should have smoothly varying surface normals so that there's no shading discontinuity. Also, when a surface's normal points away from the camera, it appears dark. Are my intuitions correct?

In my case, it's a 3D sculpture that's supposed to be ready for view from all angles, so I can't really set the surface normals w.r.t. a fixed camera. Can I then just set them arbitrarily?

Also, what is an easy of ensuring "neighboring surface normals are smooth" with Python? Maybe some post processing that smoothes over the mesh?


Here is my model.

$\endgroup$
4
  • $\begingroup$ Can you post a picture of your model? $\endgroup$ Commented Mar 31, 2017 at 3:02
  • $\begingroup$ @ScottMilner Even better: model uploaded. :-D $\endgroup$ Commented Mar 31, 2017 at 3:04
  • $\begingroup$ I don't get the point. Blender calculates the normal automatically once geometry (vertices, polygons) are associated to a mesh. If you want to calculate normals another way, this may be for some special reasons/effects... which ones? Or is there something I've not understood in your question? $\endgroup$
    – lemon
    Commented Apr 5, 2017 at 10:12
  • $\begingroup$ @lemon I am creating many polygons using Python and then joining all of them into one single mesh. Depending on the order in which I create vertices for each polygon, the final mesh, formed by joining the individual polygons, may not have "correct/proper normals" across the surface. I am trying to understand how I can construct the polygons properly such that when they are joined into a mesh, the mesh has "correct normals" across the surface. $\endgroup$ Commented Apr 5, 2017 at 16:30

2 Answers 2

3
$\begingroup$

In Edit Mode, you can display normals, to see exactly which dir they are facing (N > Mesh Display).

Normals

You might be able to simply call normals_make_consistent() operator:

bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all()
bpy.ops.mesh.normals_make_consistent()

Some models don't always import with consistent normals, because they weren't consistent with the order of their vertex arrangement (clockwise sometimes, counter-clockwise elsewhere, within the same model)

$\endgroup$
1
  • $\begingroup$ +1. Thanks! I actually did bpy.ops.mesh.normals_make_consistent() already, but I don't really trust this automatic operation, because in this case, even humans may not be able to define what is "consistent" and what is not. So I wish to understand how I should set them. $\endgroup$ Commented Mar 29, 2017 at 3:10
1
+50
$\begingroup$

If I interpret your geometry correctly, then there is no right normal. It should be seen from both sides, because it represents a thin layer of fabric. Maybe you want the faces to be double sided? There's a couple of ways to do it, depending on where and how you render it. Cycles does render them double sided by default.

For any other renderer you could dupliacte them and flip normals, so that you have one face for each normal direction.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .