
########
MeshData
########

.. js:class:: wv.MeshData

   Object which represents geometry data which will be inserted into the scene at run time. For performance reasons, it is not recommended to create meshes with large amounts of data on the client side as certain optimizations are not available to geometry inserted this way.
   
   More information can be found `here <https://docs.techsoft3d.com/hoops/visualize-web/latest/prog_guide/viewing/geometry/meshes.html>`__\ .
   
   
   Index
   =====
   
   .. rubric:: Constructors
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:func:`~wv.MeshData.constructor`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~wv.MeshData.addFaces`
   * :js:meth:`~wv.MeshData.addPoints`
   * :js:meth:`~wv.MeshData.addPolyline`
   * :js:meth:`~wv.MeshData.clear`
   * :js:meth:`~wv.MeshData.getBackfacesEnabled`
   * :js:meth:`~wv.MeshData.getFaceWinding`
   * :js:meth:`~wv.MeshData.isManifold`
   * :js:meth:`~wv.MeshData.setBackfacesEnabled`
   * :js:meth:`~wv.MeshData.setFaceWinding`
   * :js:meth:`~wv.MeshData.setManifold`
   
   



.. rst-class:: kind-group kind-constructors

.. rubric:: Constructors
   :class: kind-group-title


.. js:method:: wv.MeshData.constructor

      .. rst-class:: sig-pretty-signature
      
         | MeshData(): :js:class:`MeshData <wv.MeshData>`
      
      **Returns**\ : :js:class:`MeshData <wv.MeshData>`
      



.. rst-class:: kind-group kind-methods

.. rubric:: Methods
   :class: kind-group-title


.. js:method:: wv.MeshData.addFaces

      .. rst-class:: sig-pretty-signature
      
         | addFaces(**vertexData**\ : (*number*\ [] | *Float32Array*\ ), **normalData**\ : (*number*\ [] | *Float32Array*\ ), **rgba32data**\ : (*number*\ [] | *Uint8Array*\ ), **uvs**\ : (*number*\ [] | *Float32Array*\ ), **bits**\ : *number*\ ?): *void*
      
      Adds face data to the mesh. Note that the arrays passed into this function are not copied and should remain unchanged until the mesh has been created. When adding vertex data into the mesh using this method, it is important to note that the data is interpreted as triangles in which each vertex must be explicitly enumerated.
      
      **Parameters**
      
      
         **vertexData**\ : (*number*\ [] \| *Float32Array*\ )
      
      
            floating point data describing the points in space for the faces to be added to the mesh
      
      
         **normalData**\ : (*number*\ [] \| *Float32Array*\ )
      
      
            normals for the corresponding vertex data points.
      
      
         **rgba32data**\ : (*number*\ [] \| *Uint8Array*\ )
      
      
            colors for the corresponding vertex data points (four bytes per rbga).
      
      
         **uvs**\ : (*number*\ [] \| *Float32Array*\ )
      
      
            texture parameters for the corresponding vertex data points.
      
      
         **bits**\ : *number* = 0
      
      
            bitmask associated with the face.
      
      
      
      **Returns**\ : *void*
      



.. js:method:: wv.MeshData.addPoints

      .. rst-class:: sig-pretty-signature
      
         | addPoints(**pointData**\ : (*number*\ [] | *Float32Array*\ ), **rgba32data**\ : (*number*\ [] | *Uint8Array*\ ), **bits**\ : *number*\ ?): *void*
      
      Adds point data to the mesh. Note that the arrays passed into this function are not copied and should remain unchanged until the mesh has been created.
      
      **Parameters**
      
      
         **pointData**\ : (*number*\ [] \| *Float32Array*\ )
      
      
            floating point data describing the points to be added to the mesh
      
      
         **rgba32data**\ : (*number*\ [] \| *Uint8Array*\ )
      
      
            colors for the corresponding vertex data points (four bytes per rbga).
      
      
         **bits**\ : *number* = 0
      
      
            bitmask associated with the point.
      
      
      
      **Returns**\ : *void*
      



.. js:method:: wv.MeshData.addPolyline

      .. rst-class:: sig-pretty-signature
      
         | addPolyline(**polylineData**\ : (*number*\ [] | *Float32Array*\ ), **rgba32data**\ : (*number*\ [] | *Uint8Array*\ ), **bits**\ : *number*\ ?): *void*
      
      Adds polyline data to the mesh.Note that the arrays passed into this function are not copied and should remain unchanged until the mesh has been created.
      
      **Parameters**
      
      
         **polylineData**\ : (*number*\ [] \| *Float32Array*\ )
      
      
            floating point data describing the polyline to be added to the mesh
      
      
         **rgba32data**\ : (*number*\ [] \| *Uint8Array*\ )
      
      
            colors for the corresponding vertex data points (four bytes per rbga).
      
      
         **bits**\ : *number* = 0
      
      
            bitmask associated with the line.
      
      
      
      **Returns**\ : *void*
      



.. js:method:: wv.MeshData.clear

      .. rst-class:: sig-pretty-signature
      
         | clear(): *void*
      
      Removes all data from the object.
      
      **Returns**\ : *void*
      



.. js:method:: wv.MeshData.getBackfacesEnabled

      .. rst-class:: sig-pretty-signature
      
         | getBackfacesEnabled(): *boolean*
      
      Gets whether backfaces are enabled for this geometry
      
      **Returns**\ : *boolean*
      
      
         value indicting whether backfaces are enabled for this geometry.
      
      



.. js:method:: wv.MeshData.getFaceWinding

      .. rst-class:: sig-pretty-signature
      
         | getFaceWinding(): :js:data:`FaceWinding <wv.FaceWinding>`
      
      Gets the face winding used for this mesh.
      
      **Returns**\ : :js:data:`FaceWinding <wv.FaceWinding>`
      



.. js:method:: wv.MeshData.isManifold

      .. rst-class:: sig-pretty-signature
      
         | isManifold(): *boolean*
      
      Gets if the mesh is set as manifold.
      
      **Returns**\ : *boolean*
      
      
         value indicating whether or not it's a manifold mesh.
      
      



.. js:method:: wv.MeshData.setBackfacesEnabled

      .. rst-class:: sig-pretty-signature
      
         | setBackfacesEnabled(**backfacesEnabled**\ : *boolean*\ ): *void*
      
      Sets whether backfaces should be enabled for this geometry. The default value is false. Setting this to true for geometry with a large amount of faces may affect performance.
      
      **Parameters**
      
      
         **backfacesEnabled**\ : *boolean*
      
      
            indicated whether backfaces should be enabled for this geometry.
      
      
      
      **Returns**\ : *void*
      



.. js:method:: wv.MeshData.setFaceWinding

      .. rst-class:: sig-pretty-signature
      
         | setFaceWinding(**faceWinding**\ : :js:data:`FaceWinding <wv.FaceWinding>`\ ): *void*
      
      Sets the face winding to be used for this mesh. The default value is CounterClockwise.
      
      **Parameters**
      
      
         **faceWinding**\ : :js:data:`FaceWinding <wv.FaceWinding>`
      
      
            the face winding to use for mesh geometry.
      
      
      
      **Returns**\ : *void*
      



.. js:method:: wv.MeshData.setManifold

      .. rst-class:: sig-pretty-signature
      
         | setManifold(**isManifold**\ : *boolean*\ ): *void*
      
      Sets whether the mesh is a manifold one or not (if the mesh is not set as manifold, then capping won't happen while cutting).
      
      **Parameters**
      
      
         **isManifold**\ : *boolean*
      
      
            indicated whether or not it's a manifold mesh.
      
      
      
      **Returns**\ : *void*
      




