Index Page
cspice_dskp02
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 

Abstract
I/O
Examples
Particulars
Required Reading
Version
Index_Entries

Abstract


   CSPICE_DSKP02 returns a specified set of triangular plates from a
   type 2 DSK segment.

   For important details concerning this module's function, please refer to
   the CSPICE routine dskp02_c.

I/O


   Given:

      handle    the handle of a DSK file containing a type 2
                segment from which data are to be fetched.

      dladsc    the DLA descriptor associated with the segment
                from which data are to be fetched.

      start     the ID of the first plate to be fetched from the
                segment designated by `handle' and `dladsc'. The ID
                of a plate is its ordinal position within the
                segment. Plate IDs range from 1 to NP, where NP is
                the number of plates in the segment.

                Note that Fortran-style 1-based indexing is used for
                plate IDs because these IDs must be consistent with
                the IDs used in DSK files, across all languages
                supported by SPICE.

      room      the maximum number of plates to return.

   the call:

      cspice_dskp02, handle, dladsc, start, room, plates

   returns:

      plates    an array representing a contiguous set of `n' plates, where
                `n' is between 1 and `room' inclusive. The returned
                plates are arranged in order of increasing plate
                ID. The IDs of the returned plates range from

                    start

                to

                    start + n - 1

                Each "plate" consists of three vertex indices.
                The range of vertex indices is from 1 to NV, where NV is
                the number of vertices in the segment.

                The correspondence of elements of `plates' with the
                elements of the set of plates contained in the segment
                is:

                   plates[0,0]      plate_set[0, start]
                   plates[1,0]      plate_set[1, start]
                   plates[2,0]      plate_set[2, start]
                     ...             ...
                   plates[0,n-1]    plate_set[0, start+n-1]
                   plates[1,n-1]    plate_set[1, start+n-1]
                   plates[2,n-1]    plate_set[2, start+n-1]

                If an error occurs on the call, `plates' is
                undefined.

Examples


   Any numerical results shown for this example may differ between
   platforms as the results depend on the SPICE kernels used as input
   and the machine specific arithmetic implementation.

   Look up all the vertices associated with each plate
   of the model contained in a specified type 2 segment. For each
   plate, display the plate's vertices and normal vector.

   For this example, we'll show the context of this look-up:
   opening the DSK file for read access, traversing a trivial,
   one-segment list to obtain the segment of interest.

      PRO DSKZ02_T, dsk

         ;;
         ;; Declare DSK Mice parameters for use in API calls.
         ;;
         @IcyUser

         ;;
         ;; Constants
         ;;
         PBUFSIZ = 10000L

         ;;
         ;; Initial values
         ;;
         verts = dblarr(3,3)

         ;;
         ;; Open the DSK file for read access.
         ;; We use the DAS-level interface for
         ;; this function.
         ;;
         cspice_dasopr, dsk, handle

         ;;
         ;; Begin a forward search through the
         ;; kernel, treating the file as a DLA.
         ;; In this example, it's a very short
         ;; search.
         ;;
         cspice_dlabfs, handle, dladsc, found

         if ( ~found ) then begin

            ;;
            ;; We arrive here only if the kernel
            ;; contains no segments. This is
            ;; unexpected, but we're prepared for it.
            ;;
            warning, 'No segments found in DSK file ' + dsk

         endif

         ;;
         ;; If we made it this far, `dladsc' is the
         ;; DLA descriptor of the first segment.
         ;;
         ;; Get segment vertex and plate counts.
         ;;
         cspice_dskz02, handle, dladsc, nv, np

         print
         print, 'Number of vertices: ', nv
         print, 'Number of plates:   ', np

         ;;
         ;;  Display the vertices of each plate.
         ;;
         remain = np
         start  = 1

         while (remain gt 0 ) do begin

            ;;
            ;; `nread' is the number of plates we"ll read on this
            ;; loop pass. Set `nread' to the minimum of PBUFSIZ
            ;; and `remain'.
            ;;
            nread = min( [PBUFSIZ, remain])

            cspice_dskp02, handle, dladsc, start, nread, plates

            for  i = 1, nread do begin

               plix = start + i - 1

               ;;
               ;;  Read the vertices of the current plate.
               ;;
               for  j = 1, 3 do begin

                  cspice_dskv02, handle, dladsc, plates[j-1,i-1], 1, v
                  verts[*,j-1] = v

               endfor


               ;;
               ;; Display the vertices of the ith plate:
               ;;
               print
               print, 'Plate number: ', i

               for j = 1, 3 do begin
                  print, '   Vertex :', j, verts[*,j-1]
               endfor

               ;;
               ;; Display the normal vector of the current plate:
               ;;
               cspice_dskn02, handle, dladsc, plix, normal
               print, '   Normal: ', normal

            end

            start  = start  + nread
            remain = remain - nread

         endwhile

         ;;
         ;; Close file.
         ;;
         cspice_dascls, handle

      END

   IDL outputs:

      IDL> dskz02_t, 'solid.bds'

      Number of vertices:           12
      Number of plates:             20

      Plate number:        1
         Vertex :       1       0.0000000       0.0000000       1.1755700
         Vertex :       2       1.0514600       0.0000000      0.52573100
         Vertex :       3      0.32492000       1.0000000      0.52573100
         Normal:       0.49112416      0.35682135      0.79465438

      Plate number:        2
         Vertex :       1       0.0000000       0.0000000       1.1755700
         Vertex :       2      0.32492000       1.0000000      0.52573100
         Vertex :       3     -0.85065100      0.61803400      0.52573100
         Normal:      -0.18759233      0.57735008      0.79465465

         ...

      Plate number:       19
         Vertex :       1     -0.32492000      -1.0000000     -0.52573100
         Vertex :       2       0.0000000       0.0000000      -1.1755700
         Vertex :       3      0.85065100     -0.61803400     -0.52573100
         Normal:       0.18759233     -0.57735008     -0.79465465

      Plate number:       20
         Vertex :       1      0.85065100     -0.61803400     -0.52573100
         Vertex :       2       0.0000000       0.0000000      -1.1755700
         Vertex :       3      0.85065100      0.61803400     -0.52573100
         Normal:       0.60706168       0.0000000     -0.79465472

Particulars


   None.

Required Reading


   ICY.REQ
   DAS.REQ
   DSK.REQ

Version


   -Icy Version 1.0.0, 04-APR-2017, ML (JPL), EDW (JPL)

Index_Entries


   return specified plates from type 2 DSK segment



Wed Apr  5 17:58:00 2017