@@ -100,7 +100,7 @@ def mesh_subdivide(mesh, scheme='catmullclark', **options):
100100 ----------
101101 mesh : Mesh
102102 A mesh object.
103- scheme : {'tri', 'quad', 'corner', 'catmullclark', 'doosabin'}, optional
103+ scheme : {'tri', 'quad', 'corner', 'catmullclark', 'doosabin', 'frames', 'loop' }, optional
104104 The scheme according to which the mesh should be subdivided.
105105 Default is ``'catmullclark'``.
106106 options : dict
@@ -127,6 +127,10 @@ def mesh_subdivide(mesh, scheme='catmullclark', **options):
127127 return mesh_subdivide_catmullclark (mesh , ** options )
128128 if scheme == 'doosabin' :
129129 return mesh_subdivide_doosabin (mesh , ** options )
130+ if scheme == 'frames' :
131+ return mesh_subdivide_frames (mesh , ** options )
132+ if scheme == 'loop' :
133+ return trimesh_subdivide_loop (mesh , ** options )
130134
131135 raise ValueError ('Scheme is not supported' )
132136
@@ -584,6 +588,7 @@ def mesh_subdivide_frames(mesh, offset, add_windows=False):
584588 >>>
585589
586590 """
591+ cls = type (mesh )
587592
588593 subd = SubdMesh ()
589594
@@ -626,7 +631,7 @@ def mesh_subdivide_frames(mesh, offset, add_windows=False):
626631 if add_windows :
627632 subd .add_face (window )
628633
629- return subd
634+ return cls . from_data ( subd . data )
630635
631636
632637def trimesh_subdivide_loop (mesh , k = 1 , fixed = None ):
@@ -761,8 +766,7 @@ def trimesh_subdivide_loop(mesh, k=1, fixed=None):
761766
762767 del subd .face [fkey ]
763768
764- subd2 = cls .from_data (subd .data )
765- return subd2
769+ return cls .from_data (subd .data )
766770
767771
768772# ==============================================================================
0 commit comments