@@ -18,6 +18,7 @@ import {
1818 FormatError ,
1919 info ,
2020 MathClamp ,
21+ MeshFigureType ,
2122 unreachable ,
2223 Util ,
2324 warn ,
@@ -582,7 +583,7 @@ class MeshShading extends BaseShading {
582583 reader . align ( ) ;
583584 }
584585 this . figures . push ( {
585- type : "triangles" ,
586+ type : MeshFigureType . TRIANGLES ,
586587 coords : new Int32Array ( ps ) ,
587588 colors : new Int32Array ( ps ) ,
588589 } ) ;
@@ -600,7 +601,7 @@ class MeshShading extends BaseShading {
600601 colors . push ( color ) ;
601602 }
602603 this . figures . push ( {
603- type : "lattice" ,
604+ type : MeshFigureType . LATTICE ,
604605 coords : new Int32Array ( ps ) ,
605606 colors : new Int32Array ( ps ) ,
606607 verticesPerRow,
@@ -732,7 +733,7 @@ class MeshShading extends BaseShading {
732733 9 ,
733734 ] ) ;
734735 this . figures . push ( {
735- type : "patch" ,
736+ type : MeshFigureType . PATCH ,
736737 coords : new Int32Array ( ps ) , // making copies of ps and cs
737738 colors : new Int32Array ( cs ) ,
738739 } ) ;
@@ -802,7 +803,7 @@ class MeshShading extends BaseShading {
802803 break ;
803804 }
804805 this . figures . push ( {
805- type : "patch" ,
806+ type : MeshFigureType . PATCH ,
806807 coords : new Int32Array ( ps ) , // making copies of ps and cs
807808 colors : new Int32Array ( cs ) ,
808809 } ) ;
@@ -811,7 +812,10 @@ class MeshShading extends BaseShading {
811812
812813 _buildFigureFromPatch ( index ) {
813814 const figure = this . figures [ index ] ;
814- assert ( figure . type === "patch" , "Unexpected patch mesh figure" ) ;
815+ assert (
816+ figure . type === MeshFigureType . PATCH ,
817+ "Unexpected patch mesh figure"
818+ ) ;
815819
816820 const coords = this . coords ,
817821 colors = this . colors ;
@@ -919,7 +923,7 @@ class MeshShading extends BaseShading {
919923 figureColors [ verticesPerRow * splitYBy + splitXBy ] = ci [ 3 ] ;
920924
921925 this . figures [ index ] = {
922- type : "lattice" ,
926+ type : MeshFigureType . LATTICE ,
923927 coords : figureCoords ,
924928 colors : figureColors ,
925929 verticesPerRow,
0 commit comments