.. role:: ts-api-decorator

##################
ParticleTraceUtils
##################

.. js:module:: cee.ug
   :noindex:

.. container:: ts-api-section

   .. js:class:: ParticleTraceUtils

      Helper functions for particle traces



.. container:: api-index-section

   .. rubric:: Constructors

   .. rst-class:: api-index-list-item api-kind-constructor api-parent-kind-class

   * :js:meth:`~cee.ug.ParticleTraceUtils.constructor`



.. container:: api-index-section

   .. rubric:: Methods

   .. rst-class:: api-index-list-item api-kind-method api-parent-kind-class

   * :js:meth:`~cee.ug.ParticleTraceUtils.computeGridPoints`
   * :js:meth:`~cee.ug.ParticleTraceUtils.seedPointsFromPointsAndNormals`





------------

Constructors
============

.. container:: ts-api-section

   .. js:function:: ParticleTraceUtils.constructor()



      :rtype: ParticleTraceUtils



Methods
=======

.. rst-class:: ts-api-section

:ts-api-decorator:`static` computeGridPoints
--------------------------------------------

.. js:method:: ParticleTraceUtils.computeGridPoints( center, normal, numU, numV, groupSpacing)

   :param center: The center of the grid of generated points
   :type center: Vec3Like
   :param normal: The normal of the surface which the grid points will be on.
   :type normal: Vec3Like
   :param numU: Number of grid point in the U direction.
   :type numU: number
   :param numV: Number of grid points in the V direction.
   :type numV: number
   :param groupSpacing: The distance between each point in the grid.
   :type groupSpacing: number


   Computes a grid of points based on the given point and normal and returns the array of points

   Useful for generating particle trace seed points. All grid points will be in the plane specified by the 
   given center and normal, centered around the center.

   :returns: An array of Vec3 points forming a grid as specified. The grid will contain numU*numV points.


   :rtype: [Vec3]

.. rst-class:: ts-api-section

:ts-api-decorator:`static` seedPointsFromPointsAndNormals
---------------------------------------------------------

.. js:method:: ParticleTraceUtils.seedPointsFromPointsAndNormals( pointArr, normalArr, modelBoundingBox[, planeFilter])

   :param pointArr: The result of a QueryPartSurfacePositions
   :type pointArr: ArrayLike <number>
   :param normalArr: Per point normals. The normal is used to nudge the seed point a bit in the opposite direction of the normal. This is to cater for the seed point being inside the volume and not outside due to numeric precision.
   :type normalArr: ArrayLike <number>
   :param modelBoundingBox: Model bounding box. Used to figure out how much to nudge the seed points to be inside the volume
   :type modelBoundingBox: BoundingBox
   :param planeFilter: :ts-api-decorator:`optional` If a plane is passed in this parameter, only centroids that are on or very close to this plane will be used.
   :type planeFilter: Plane


   Compute seed points based on the centroids of the visible element surfaces of a part.

   :returns: An array of Vec3 points.


   :rtype: [Vec3]

