@@ -49,6 +49,17 @@ function ExtrudeGeometry( shapes, options ) {
4949ExtrudeGeometry . prototype = Object . create ( Geometry . prototype ) ;
5050ExtrudeGeometry . prototype . constructor = ExtrudeGeometry ;
5151
52+ ExtrudeGeometry . prototype . toJSON = function ( ) {
53+
54+ var data = Geometry . prototype . toJSON . call ( this ) ;
55+
56+ var shapes = this . parameters . shapes ;
57+ var options = this . parameters . options ;
58+
59+ return toJSON ( shapes , options , data ) ;
60+
61+ } ;
62+
5263// ExtrudeBufferGeometry
5364
5465function ExtrudeBufferGeometry ( shapes , options ) {
@@ -717,6 +728,19 @@ function ExtrudeBufferGeometry( shapes, options ) {
717728ExtrudeBufferGeometry . prototype = Object . create ( BufferGeometry . prototype ) ;
718729ExtrudeBufferGeometry . prototype . constructor = ExtrudeBufferGeometry ;
719730
731+ ExtrudeBufferGeometry . prototype . toJSON = function ( ) {
732+
733+ var data = BufferGeometry . prototype . toJSON . call ( this ) ;
734+
735+ var shapes = this . parameters . shapes ;
736+ var options = this . parameters . options ;
737+
738+ return toJSON ( shapes , options , data ) ;
739+
740+ } ;
741+
742+ //
743+
720744var WorldUVGenerator = {
721745
722746 generateTopUV : function ( geometry , vertices , indexA , indexB , indexC ) {
@@ -774,5 +798,35 @@ var WorldUVGenerator = {
774798 }
775799} ;
776800
801+ function toJSON ( shapes , options , data ) {
802+
803+ //
804+
805+ data . shapes = [ ] ;
806+
807+ if ( Array . isArray ( shapes ) ) {
808+
809+ for ( var i = 0 , l = shapes . length ; i < l ; i ++ ) {
810+
811+ var shape = shapes [ i ] ;
812+
813+ data . shapes . push ( shape . uuid ) ;
814+
815+ }
816+
817+ } else {
818+
819+ data . shapes . push ( shapes . uuid ) ;
820+
821+ }
822+
823+ //
824+
825+ if ( options . extrudePath !== undefined ) data . options . extrudePath = options . extrudePath . toJSON ( ) ;
826+
827+ return data ;
828+
829+ }
830+
777831
778832export { ExtrudeGeometry , ExtrudeBufferGeometry } ;
0 commit comments