diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-06-26 23:56:39 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-06-26 23:56:39 +0300 |
commit | a61480c27103fbf449fd14ea8061b65c29f19eae (patch) | |
tree | 8d626b465ebe17936b7551aa91cc5b9d3b192607 /doc/python_api/examples/bmesh.ops.1.py | |
parent | a3cd57ea8c57c10d4c65ddd51faa6cce14c98e10 (diff) | |
parent | 532c8ac58384309e77791e32ab78f448ad2a76a6 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'doc/python_api/examples/bmesh.ops.1.py')
-rw-r--r-- | doc/python_api/examples/bmesh.ops.1.py | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/doc/python_api/examples/bmesh.ops.1.py b/doc/python_api/examples/bmesh.ops.1.py index b307624467f..d6a5b1222d8 100644 --- a/doc/python_api/examples/bmesh.ops.1.py +++ b/doc/python_api/examples/bmesh.ops.1.py @@ -10,22 +10,22 @@ bm = bmesh.new() # Add a circle XXX, should return all geometry created, not just verts. bmesh.ops.create_circle( - bm, - cap_ends=False, - radius=0.2, - segments=8) + bm, + cap_ends=False, + radius=0.2, + segments=8) # Spin and deal with geometry on side 'a' edges_start_a = bm.edges[:] geom_start_a = bm.verts[:] + edges_start_a ret = bmesh.ops.spin( - bm, - geom=geom_start_a, - angle=math.radians(180.0), - steps=8, - axis=(1.0, 0.0, 0.0), - cent=(0.0, 1.0, 0.0)) + bm, + geom=geom_start_a, + angle=math.radians(180.0), + steps=8, + axis=(1.0, 0.0, 0.0), + cent=(0.0, 1.0, 0.0)) edges_end_a = [ele for ele in ret["geom_last"] if isinstance(ele, bmesh.types.BMEdge)] del ret @@ -33,8 +33,8 @@ del ret # Extrude and create geometry on side 'b' ret = bmesh.ops.extrude_edge_only( - bm, - edges=edges_start_a) + bm, + edges=edges_start_a) geom_extrude_mid = ret["geom"] del ret @@ -45,19 +45,19 @@ verts_extrude_b = [ele for ele in geom_extrude_mid edges_extrude_b = [ele for ele in geom_extrude_mid if isinstance(ele, bmesh.types.BMEdge) and ele.is_boundary] bmesh.ops.translate( - bm, - verts=verts_extrude_b, - vec=(0.0, 0.0, 1.0)) + bm, + verts=verts_extrude_b, + vec=(0.0, 0.0, 1.0)) # Create the circle on side 'b' ret = bmesh.ops.spin( - bm, - geom=verts_extrude_b + edges_extrude_b, - angle=-math.radians(180.0), - steps=8, - axis=(1.0, 0.0, 0.0), - cent=(0.0, 1.0, 1.0)) + bm, + geom=verts_extrude_b + edges_extrude_b, + angle=-math.radians(180.0), + steps=8, + axis=(1.0, 0.0, 0.0), + cent=(0.0, 1.0, 1.0)) edges_end_b = [ele for ele in ret["geom_last"] if isinstance(ele, bmesh.types.BMEdge)] del ret @@ -65,30 +65,30 @@ del ret # Bridge the resulting edge loops of both spins 'a & b' bmesh.ops.bridge_loops( - bm, - edges=edges_end_a + edges_end_b) + bm, + edges=edges_end_a + edges_end_b) # Now we have made a links of the chain, make a copy and rotate it # (so this looks something like a chain) ret = bmesh.ops.duplicate( - bm, - geom=bm.verts[:] + bm.edges[:] + bm.faces[:]) + bm, + geom=bm.verts[:] + bm.edges[:] + bm.faces[:]) geom_dupe = ret["geom"] verts_dupe = [ele for ele in geom_dupe if isinstance(ele, bmesh.types.BMVert)] del ret # position the new link bmesh.ops.translate( - bm, - verts=verts_dupe, - vec=(0.0, 0.0, 2.0)) + bm, + verts=verts_dupe, + vec=(0.0, 0.0, 2.0)) bmesh.ops.rotate( - bm, - verts=verts_dupe, - cent=(0.0, 1.0, 0.0), - matrix=mathutils.Matrix.Rotation(math.radians(90.0), 3, 'Z')) + bm, + verts=verts_dupe, + cent=(0.0, 1.0, 0.0), + matrix=mathutils.Matrix.Rotation(math.radians(90.0), 3, 'Z')) # Done with creating the mesh, simply link it into the scene so we can see it |