0
$\begingroup$

I want to extrude a face in the direction of the face normal, here is the code so far:

r = bmesh.ops.extrude_face_region(bm, geom=bm.faces[:])
verts = [e for e in r['geom'] if isinstance(e, bmesh.types.BMVert)]
bmesh.ops.translate(bm, vec=dir, verts=verts)

The problem is how to get the direction of the face that I translate? The bm.faces[0].normal is Vector(0,0,0)

Any ideas? Thx!

$\endgroup$
1
$\begingroup$

Update the normals

Either update normals on a whole bmesh

bm.normal_update()

or on a per face basis

for f in bm.faces:
    if sometest:
        f.normal_update()
$\endgroup$
  • $\begingroup$ Yeah, thx, I also found it, I use the normal_update on the frist face, cause I am sure that there is at least one. $\endgroup$ – Jayanam Jan 5 at 18:37

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.