
#################
QuerySurfaceGroup
#################

.. js:class:: cee.ug.QuerySurfaceGroup

   Query for retrieving triangulated geometry of surface groups.
   
   Each surface group is a collection of element faces that originate from the same surface. The main source of surface groups is CAD files (e.g. HOOPS Exchange plugin), so they are sometimes referred to as CAD surface groups. Use this query to obtain the surface group IDs present in the model, and to obtain an indexed triangle mesh (vertices + triangle indices) for the surface group with a given surface group ID.
   
   
   Index
   =====
   
   .. rubric:: Constructors
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:func:`~cee.ug.QuerySurfaceGroup.constructor`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~cee.ug.QuerySurfaceGroup.executeAvailableSurfaceGroupIdsQuery`
   * :js:meth:`~cee.ug.QuerySurfaceGroup.executeSurfaceGroupIdForElementQuery`
   * :js:meth:`~cee.ug.QuerySurfaceGroup.executeTriangulationQuery`
   
   



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

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


.. js:method:: cee.ug.QuerySurfaceGroup.constructor

      .. rst-class:: sig-pretty-signature
      
         | QuerySurfaceGroup(**model**\ : :js:class:`RemoteModel <cee.ug.RemoteModel>`\ ): :js:class:`QuerySurfaceGroup <cee.ug.QuerySurfaceGroup>`
      
      **Parameters**
      
      
         **model**\ : :js:class:`RemoteModel <cee.ug.RemoteModel>`
      
      
      **Returns**\ : :js:class:`QuerySurfaceGroup <cee.ug.QuerySurfaceGroup>`
      



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

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


.. js:method:: cee.ug.QuerySurfaceGroup.executeAvailableSurfaceGroupIdsQuery

      .. rst-class:: sig-pretty-signature
      
         | executeAvailableSurfaceGroupIdsQuery(**frameIndex**\ : *number*\ , **callback**\ : :js:class:`QuerySurfaceGroupAvailableSurfaceGroupIdsCallback <cee.ug.QuerySurfaceGroupAvailableSurfaceGroupIdsCallback>`\ ): *void*
      
      Executes a query that returns the surface group IDs that are present in the model.
      
      **Parameters**
      
      
         **frameIndex**\ : *number*
      
         **callback**\ : :js:class:`QuerySurfaceGroupAvailableSurfaceGroupIdsCallback <cee.ug.QuerySurfaceGroupAvailableSurfaceGroupIdsCallback>`
      
      
      **Returns**\ : *void*
      



.. js:method:: cee.ug.QuerySurfaceGroup.executeSurfaceGroupIdForElementQuery

      .. rst-class:: sig-pretty-signature
      
         | executeSurfaceGroupIdForElementQuery(**frameIndex**\ : *number*\ , **geometryIndex**\ : *number*\ , **partId**\ : *number*\ , **elementIndex**\ : *number*\ , **elementFaceIndex**\ : *number*\ , **callback**\ : :js:class:`QuerySurfaceGroupIdForElementCallback <cee.ug.QuerySurfaceGroupIdForElementCallback>`\ ): *void*
      
      Executes a query that returns the surface group ID of the surface group that a given element face belongs to.
      
      This is typically used together with picking: pass the identifiers from a ``ug.HitItem`` to find out which surface group was hit, and then use :js:meth:`executeTriangulationQuery <cee.ug.QuerySurfaceGroup.executeTriangulationQuery>` to retrieve and visualize the geometry of that group.
      
      The ``callback`` receives the surface group ID of the surface group the element face belongs to, or -1 if the element face is not part of any surface group.
      
      **Parameters**
      
      
         **frameIndex**\ : *number*
      
         **geometryIndex**\ : *number*
      
         **partId**\ : *number*
      
         **elementIndex**\ : *number*
      
         **elementFaceIndex**\ : *number*
      
         **callback**\ : :js:class:`QuerySurfaceGroupIdForElementCallback <cee.ug.QuerySurfaceGroupIdForElementCallback>`
      
      
      **Returns**\ : *void*
      



.. js:method:: cee.ug.QuerySurfaceGroup.executeTriangulationQuery

      .. rst-class:: sig-pretty-signature
      
         | executeTriangulationQuery(**frameIndex**\ : *number*\ , **surfaceGroupId**\ : *number*\ , **callback**\ : :js:class:`QuerySurfaceGroupTriangulationCallback <cee.ug.QuerySurfaceGroupTriangulationCallback>`\ ): *void*
      
      Executes a query that returns the triangulated geometry of the surface group with the given surface group ID.
      
      The result is an indexed triangle mesh (deduplicated vertices + triangle indices). If no surface group with the given surface group ID exists, the callback is invoked with an error.
      
      Vertices are returned in world coordinates using the currently active node positions of the part (i.e. including displacements when applicable). Vertices are deduplicated, so each shared mesh node appears only once in the output ``vertices`` array, and triangles reference vertices via the indices in ``triangleIndices`` (three indices per triangle).
      
      **Parameters**
      
      
         **frameIndex**\ : *number*
      
         **surfaceGroupId**\ : *number*
      
         **callback**\ : :js:class:`QuerySurfaceGroupTriangulationCallback <cee.ug.QuerySurfaceGroupTriangulationCallback>`
      
      
      **Returns**\ : *void*
      




