rsspice 0.1.0

Pure Rust port of the SPICE Toolkit for space geometry
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
//! Constants
//!
//! ```text
//! C
//! C     Include file dsk02.inc
//! C
//! C     This include file declares parameters for DSK data type 2
//! C     (plate model).
//! C
//! C-       SPICELIB Version 1.0.0 08-FEB-2017 (NJB)
//! C
//! C          Updated version info.
//! C     
//! C           22-JAN-2016 (NJB)
//! C
//! C              Now includes spatial index parameters.
//! C
//! C           26-MAR-2015 (NJB)
//! C     
//! C              Updated to increase MAXVRT to 16000002. MAXNPV
//! C              has been changed to (3/2)*MAXPLT. Set MAXVOX
//! C              to 100000000.
//! C
//! C           13-MAY-2010 (NJB)
//! C
//! C              Updated to reflect new no-record design.
//! C
//! C           04-MAY-2010 (NJB)
//! C
//! C              Updated for new type 2 segment design. Now uses
//! C              a local parameter to represent DSK descriptor
//! C              size (NB).
//! C
//! C           13-SEP-2008 (NJB)
//! C
//! C              Updated to remove albedo information.
//! C              Updated to use parameter for DSK descriptor size.
//! C
//! C           27-DEC-2006 (NJB)
//! C
//! C              Updated to remove minimum and maximum radius information
//! C              from segment layout.  These bounds are now included
//! C              in the segment descriptor.
//! C
//! C           26-OCT-2006 (NJB)
//! C
//! C              Updated to remove normal, center, longest side, albedo,
//! C              and area keyword parameters.
//! C
//! C           04-AUG-2006 (NJB)
//! C
//! C              Updated to support coarse voxel grid.  Area data
//! C              have now been removed.
//! C
//! C           10-JUL-2006 (NJB)
//! C
//! C
//! C     Each type 2 DSK segment has integer, d.p., and character
//! C     components.  The segment layout in DAS address space is as
//! C     follows:
//! C
//! C
//! C        Integer layout:
//! C
//! C           +-----------------+
//! C           | NV              |  (# of vertices)
//! C           +-----------------+
//! C           | NP              |  (# of plates )
//! C           +-----------------+
//! C           | NVXTOT          |  (total number of voxels)
//! C           +-----------------+
//! C           | VGREXT          |  (voxel grid extents, 3 integers)   
//! C           +-----------------+
//! C           | CGRSCL          |  (coarse voxel grid scale, 1 integer)  
//! C           +-----------------+
//! C           | VOXNPT          |  (size of voxel-plate pointer list)
//! C           +-----------------+
//! C           | VOXNPL          |  (size of voxel-plate list)
//! C           +-----------------+
//! C           | VTXNPL          |  (size of vertex-plate list)
//! C           +-----------------+
//! C           | PLATES          |  (NP 3-tuples of vertex IDs)
//! C           +-----------------+
//! C           | VOXPTR          |  (voxel-plate pointer array)
//! C           +-----------------+
//! C           | VOXPLT          |  (voxel-plate list)
//! C           +-----------------+
//! C           | VTXPTR          |  (vertex-plate pointer array)
//! C           +-----------------+
//! C           | VTXPLT          |  (vertex-plate list)
//! C           +-----------------+
//! C           | CGRPTR          |  (coarse grid occupancy pointers)
//! C           +-----------------+
//! C
//! C
//!       INTEGER               IXNV
//!       PARAMETER           ( IXNV   =          1 )
//!       
//!       INTEGER               IXNP
//!       PARAMETER           ( IXNP   = IXNV   + 1 )
//!
//!       INTEGER               IXNVXT
//!       PARAMETER           ( IXNVXT = IXNP   + 1 )
//!       
//!       INTEGER               IXVGRX
//!       PARAMETER           ( IXVGRX = IXNVXT + 1 )
//!
//!       INTEGER               IXCGSC
//!       PARAMETER           ( IXCGSC = IXVGRX + 3 )
//!
//!       INTEGER               IXVXPS
//!       PARAMETER           ( IXVXPS = IXCGSC + 1 )
//!
//!       INTEGER               IXVXLS
//!       PARAMETER           ( IXVXLS = IXVXPS + 1 )
//!
//!       INTEGER               IXVTLS
//!       PARAMETER           ( IXVTLS = IXVXLS + 1 )
//!
//!       INTEGER               IXPLAT
//!       PARAMETER           ( IXPLAT = IXVTLS + 1 )
//!
//! C
//! C        D.p. layout:
//! C            
//! C           +-----------------+
//! C           | DSK descriptor  |  DSKDSZ elements
//! C           +-----------------+
//! C           | Vertex bounds   |  6 values (min/max for each component)
//! C           +-----------------+
//! C           | Voxel origin    |  3 elements
//! C           +-----------------+
//! C           | Voxel size      |  1 element
//! C           +-----------------+
//! C           | Vertices        |  3*NV elements
//! C           +-----------------+
//! C
//!       INTEGER               IXDSCR
//!       PARAMETER           ( IXDSCR = 1 )
//!       
//! C
//! C     This local parameter MUST be kept consistent with
//! C     the parameter DSKDSZ which is declared in dskdsc.inc.
//! C
//!       INTEGER               DSCSZ2
//!       PARAMETER           ( DSCSZ2 = 24 )
//!
//!       INTEGER               IXVTBD
//!       PARAMETER           ( IXVTBD = IXDSCR + DSCSZ2 )
//!
//!       INTEGER               IXVXOR
//!       PARAMETER           ( IXVXOR = IXVTBD + 6 )
//!
//!       INTEGER               IXVXSZ
//!       PARAMETER           ( IXVXSZ = IXVXOR + 3 )
//!
//!       INTEGER               IXVERT
//!       PARAMETER           ( IXVERT = IXVXSZ + 1 )
//!
//!  
//!
//! C
//! C     Integer item keyword parameters used by fetch routines:
//! C
//!       INTEGER               KWNV
//!       PARAMETER           ( KWNV   = 1 )
//!
//!       INTEGER               KWNP
//!       PARAMETER           ( KWNP   = KWNV   + 1 )
//!       
//!       INTEGER               KWNVXT
//!       PARAMETER           ( KWNVXT = KWNP   + 1 )
//!
//!       INTEGER               KWVGRX
//!       PARAMETER           ( KWVGRX = KWNVXT + 1 )
//!
//!       INTEGER               KWCGSC
//!       PARAMETER           ( KWCGSC = KWVGRX + 1 )
//!
//!       INTEGER               KWVXPS
//!       PARAMETER           ( KWVXPS = KWCGSC + 1 )
//!
//!       INTEGER               KWVXLS
//!       PARAMETER           ( KWVXLS = KWVXPS + 1 )
//!
//!       INTEGER               KWVTLS
//!       PARAMETER           ( KWVTLS = KWVXLS + 1 )
//!
//!       INTEGER               KWPLAT
//!       PARAMETER           ( KWPLAT = KWVTLS + 1 )
//!
//!       INTEGER               KWVXPT
//!       PARAMETER           ( KWVXPT = KWPLAT + 1 )
//!
//!       INTEGER               KWVXPL
//!       PARAMETER           ( KWVXPL = KWVXPT + 1 )
//!
//!       INTEGER               KWVTPT
//!       PARAMETER           ( KWVTPT = KWVXPL + 1 )
//!
//!       INTEGER               KWVTPL
//!       PARAMETER           ( KWVTPL = KWVTPT + 1 )
//!
//!       INTEGER               KWCGPT
//!       PARAMETER           ( KWCGPT = KWVTPL + 1 )
//!
//! C
//! C     Double precision item keyword parameters used by fetch routines:
//! C
//!       INTEGER               KWDSC
//!       PARAMETER           ( KWDSC  = KWCGPT + 1 )
//!
//!       INTEGER               KWVTBD
//!       PARAMETER           ( KWVTBD = KWDSC  + 1 )
//!
//!       INTEGER               KWVXOR
//!       PARAMETER           ( KWVXOR = KWVTBD + 1 )
//!
//!       INTEGER               KWVXSZ
//!       PARAMETER           ( KWVXSZ = KWVXOR + 1 )
//!
//!       INTEGER               KWVERT
//!       PARAMETER           ( KWVERT = KWVXSZ + 1 )
//!
//! C
//! C     The parameters below formerly were declared in pltmax.inc.
//! C
//! C     Limits on plate model capacity:
//! C
//! C     The maximum number of bodies, vertices and
//! C     plates in a plate model or collective thereof are
//! C     provided here.
//! C
//! C     These values can be used to dimension arrays, or to
//! C     use as limit checks.
//! C
//! C     The value of MAXPLT is determined from MAXVRT via
//! C     Euler's Formula for simple polyhedra having triangular
//! C     faces.
//! C
//! C     MAXVRT is the maximum number of vertices the triangular
//! C            plate model software will support.
//! C
//!       INTEGER               MAXVRT
//!       PARAMETER           ( MAXVRT = 16000002  )
//!  
//! C
//! C     MAXPLT is the maximum number of plates that the triangular
//! C            plate model software will support.
//! C
//!       INTEGER               MAXPLT
//!       PARAMETER           ( MAXPLT = 2*(MAXVRT - 2) )
//!
//! C
//! C     MAXNPV is the maximum allowed number of vertices, not taking into
//! C     account shared vertices.
//! C
//! C     Note that this value is not sufficient to create a vertex-plate
//! C     mapping for a model of maximum plate count.
//! C
//!       INTEGER               MAXNPV
//!       PARAMETER           ( MAXNPV = 3*MAXPLT/2 + 1 )
//!
//! C
//! C     MAXVOX is the maximum number of voxels.
//! C
//!       INTEGER               MAXVOX
//!       PARAMETER           ( MAXVOX = 100000000 )
//!
//! C
//! C     MAXCGR is the maximum size of the coarse voxel grid.
//! C     
//!       INTEGER               MAXCGR
//!       PARAMETER           ( MAXCGR = 100000 )
//!
//! C
//! C     MAXEDG is the maximum allowed number of vertex or plate
//! C     neighbors a vertex may have.
//! C
//!       INTEGER               MAXEDG
//!       PARAMETER           ( MAXEDG = 120 )
//!
//!
//!
//! C     DSK type 2 spatial index parameters
//! C     ===================================
//! C
//! C        DSK type 2 spatial index integer component
//! C        ------------------------------------------
//! C
//! C           +-----------------+
//! C           | VGREXT          |  (voxel grid extents, 3 integers)   
//! C           +-----------------+
//! C           | CGRSCL          |  (coarse voxel grid scale, 1 integer)  
//! C           +-----------------+
//! C           | VOXNPT          |  (size of voxel-plate pointer list)
//! C           +-----------------+
//! C           | VOXNPL          |  (size of voxel-plate list)
//! C           +-----------------+
//! C           | VTXNPL          |  (size of vertex-plate list)
//! C           +-----------------+
//! C           | CGRPTR          |  (coarse grid occupancy pointers)
//! C           +-----------------+
//! C           | VOXPTR          |  (voxel-plate pointer array)
//! C           +-----------------+
//! C           | VOXPLT          |  (voxel-plate list)
//! C           +-----------------+
//! C           | VTXPTR          |  (vertex-plate pointer array)
//! C           +-----------------+
//! C           | VTXPLT          |  (vertex-plate list)
//! C           +-----------------+
//! C
//! C
//! C        Index parameters
//! C
//! C
//! C     Grid extent:
//! C
//!       INTEGER               SIVGRX
//!       PARAMETER           ( SIVGRX = 1 )
//! C
//! C     Coarse grid scale:
//! C
//!       INTEGER               SICGSC
//!       PARAMETER           ( SICGSC = SIVGRX + 3 )
//! C
//! C     Voxel pointer count:
//! C
//!       INTEGER               SIVXNP
//!       PARAMETER           ( SIVXNP = SICGSC + 1 )
//! C
//! C     Voxel-plate list count:
//! C
//!       INTEGER               SIVXNL
//!       PARAMETER           ( SIVXNL = SIVXNP + 1 )
//! C
//! C     Vertex-plate list count:
//! C
//!       INTEGER               SIVTNL
//!       PARAMETER           ( SIVTNL = SIVXNL + 1 )
//! C
//! C     Coarse grid pointers:
//! C
//!       INTEGER               SICGRD
//!       PARAMETER           ( SICGRD = SIVTNL + 1 )
//!
//! C
//! C     Size of fixed-size portion of integer component:
//! C     
//!       INTEGER               IXIFIX
//!       PARAMETER           ( IXIFIX = MAXCGR + 7 )
//!
//!
//! C
//! C        DSK type 2 spatial index double precision component
//! C        ---------------------------------------------------
//! C
//! C           +-----------------+
//! C           | Vertex bounds   |  6 values (min/max for each component)
//! C           +-----------------+
//! C           | Voxel origin    |  3 elements
//! C           +-----------------+
//! C           | Voxel size      |  1 element
//! C           +-----------------+
//! C
//! C
//! C
//! C        Index parameters
//! C
//! C     Vertex bounds:
//! C
//!       INTEGER               SIVTBD
//!       PARAMETER           ( SIVTBD = 1 )
//! C
//! C     Voxel grid origin:
//! C
//!       INTEGER               SIVXOR
//!       PARAMETER           ( SIVXOR = SIVTBD + 6 )
//! C
//! C     Voxel size:  
//! C
//!       INTEGER               SIVXSZ
//!       PARAMETER           ( SIVXSZ = SIVXOR + 3 )
//!
//! C
//! C     Size of fixed-size portion of double precision component:
//! C     
//!       INTEGER               IXDFIX
//!       PARAMETER           ( IXDFIX = 10 )
//!
//!
//! C
//! C     The limits below are used to define a suggested maximum
//! C     size for the integer component of the spatial index.
//! C
//!
//! C
//! C     Maximum number of entries in voxel-plate pointer array:
//! C               
//!       INTEGER               MAXVXP
//!       PARAMETER           ( MAXVXP = MAXPLT / 2 )
//!
//! C
//! C     Maximum cell size:
//! C
//!       INTEGER               MAXCEL
//!       PARAMETER           ( MAXCEL = 60000000 )
//!
//! C
//! C     Maximum number of entries in voxel-plate list:
//! C
//!       INTEGER               MXNVLS
//!       PARAMETER           ( MXNVLS = MAXCEL + MAXVXP/2 )
//!
//! C
//! C     Spatial index integer component size:
//! C
//!       INTEGER               SPAISZ
//!       PARAMETER           ( SPAISZ =   IXIFIX + MAXVXP
//!      .                               + MXNVLS + MAXVRT  
//!      .                               + MAXNPV          )
//!
//!
//! C
//! C     End of include file dsk02.inc
//! C
//!
//! ```

pub const IXNV: i32 = 1;
pub const IXNP: i32 = (IXNV + 1);
pub const IXNVXT: i32 = (IXNP + 1);
pub const IXVGRX: i32 = (IXNVXT + 1);
pub const IXCGSC: i32 = (IXVGRX + 3);
pub const IXVXPS: i32 = (IXCGSC + 1);
pub const IXVXLS: i32 = (IXVXPS + 1);
pub const IXVTLS: i32 = (IXVXLS + 1);
pub const IXPLAT: i32 = (IXVTLS + 1);
pub const IXDSCR: i32 = 1;
pub const DSCSZ2: i32 = 24;
pub const IXVTBD: i32 = (IXDSCR + DSCSZ2);
pub const IXVXOR: i32 = (IXVTBD + 6);
pub const IXVXSZ: i32 = (IXVXOR + 3);
pub const IXVERT: i32 = (IXVXSZ + 1);
pub const KWNV: i32 = 1;
pub const KWNP: i32 = (KWNV + 1);
pub const KWNVXT: i32 = (KWNP + 1);
pub const KWVGRX: i32 = (KWNVXT + 1);
pub const KWCGSC: i32 = (KWVGRX + 1);
pub const KWVXPS: i32 = (KWCGSC + 1);
pub const KWVXLS: i32 = (KWVXPS + 1);
pub const KWVTLS: i32 = (KWVXLS + 1);
pub const KWPLAT: i32 = (KWVTLS + 1);
pub const KWVXPT: i32 = (KWPLAT + 1);
pub const KWVXPL: i32 = (KWVXPT + 1);
pub const KWVTPT: i32 = (KWVXPL + 1);
pub const KWVTPL: i32 = (KWVTPT + 1);
pub const KWCGPT: i32 = (KWVTPL + 1);
pub const KWDSC: i32 = (KWCGPT + 1);
pub const KWVTBD: i32 = (KWDSC + 1);
pub const KWVXOR: i32 = (KWVTBD + 1);
pub const KWVXSZ: i32 = (KWVXOR + 1);
pub const KWVERT: i32 = (KWVXSZ + 1);
pub const MAXVRT: i32 = 16000002;
pub const MAXPLT: i32 = (2 * (MAXVRT - 2));
pub const MAXNPV: i32 = (((3 * MAXPLT) / 2) + 1);
pub const MAXVOX: i32 = 100000000;
pub const MAXCGR: i32 = 100000;
pub const MAXEDG: i32 = 120;
pub const SIVGRX: i32 = 1;
pub const SICGSC: i32 = (SIVGRX + 3);
pub const SIVXNP: i32 = (SICGSC + 1);
pub const SIVXNL: i32 = (SIVXNP + 1);
pub const SIVTNL: i32 = (SIVXNL + 1);
pub const SICGRD: i32 = (SIVTNL + 1);
pub const IXIFIX: i32 = (MAXCGR + 7);
pub const SIVTBD: i32 = 1;
pub const SIVXOR: i32 = (SIVTBD + 6);
pub const SIVXSZ: i32 = (SIVXOR + 3);
pub const IXDFIX: i32 = 10;
pub const MAXVXP: i32 = (MAXPLT / 2);
pub const MAXCEL: i32 = 60000000;
pub const MXNVLS: i32 = (MAXCEL + (MAXVXP / 2));
pub const SPAISZ: i32 = ((((IXIFIX + MAXVXP) + MXNVLS) + MAXVRT) + MAXNPV);