@@ -293,7 +293,7 @@ struct CellNoise3D:Noise
293
293
// the closest point
294
294
295
295
// Cell group I:
296
- // within r^2 = 0.25
296
+ // outside r^2 = 0
297
297
// cumulative sample coverage = 47.85%
298
298
_inspect_cell ( offset: ( - 1 , 0 , 0 ) )
299
299
_inspect_cell ( offset: ( 0 , - 1 , 0 ) )
@@ -304,140 +304,119 @@ struct CellNoise3D:Noise
304
304
_inspect_cell ( offset: ( - 1 , - 1 , 0 ) )
305
305
306
306
_inspect_cell ( offset: ( - 1 , - 1 , - 1 ) )
307
+
308
+ // Cell group II:
309
+ // outside r^2 = 0.25
310
+ // cumulative sample coverage = 88.60%
307
311
guard r2 > 0.25
308
312
else
309
313
{
310
314
return self . amplitude * r2
311
315
}
312
-
313
- // Cell group II:
314
- // within r^2 = 0.5
315
- // cumulative sample coverage = 88.60%
316
316
for offset in [ ( 1 , 0 , 0 ) , ( 0 , 1 , 0 ) , ( 0 , 0 , 1 ) ,
317
317
( 0 , - 1 , 1 ) , ( 0 , 1 , - 1 ) , ( 1 , 0 , - 1 ) , ( - 1 , 0 , 1 ) , ( - 1 , 1 , 0 ) , ( 1 , - 1 , 0 ) ,
318
318
( 1 , - 1 , - 1 ) , ( - 1 , 1 , - 1 ) , ( - 1 , - 1 , 1 ) ]
319
319
{
320
320
_inspect_cell ( offset: offset)
321
321
}
322
+
323
+ // Cell group III:
324
+ // outside r^2 = 0.5
325
+ // cumulative sample coverage = 98.26%
322
326
guard r2 > 0.5
323
327
else
324
328
{
325
329
return self . amplitude * r2
326
330
}
327
-
328
- // Cell group III:
329
- // within r^2 = 0.75
330
- // cumulative sample coverage = 98.26%
331
331
for offset in [ ( 0 , 1 , 1 ) , ( 1 , 0 , 1 ) , ( 1 , 1 , 0 ) , ( - 1 , 1 , 1 ) , ( 1 , - 1 , 1 ) , ( 1 , 1 , - 1 ) ]
332
332
{
333
333
_inspect_cell ( offset: offset)
334
334
}
335
- guard r2 > 0.75
336
- else
337
- {
338
- return self . amplitude * r2
339
- }
340
335
341
- // Cell group IV:
342
- // within r^2 = 1.0
336
+ // Cell group IV: [(1, 1, 1)] [ occluded ]
337
+ // outside r^2 = 0.75
343
338
// cumulative sample coverage = 99.94%
344
- _inspect_cell ( offset: ( 1 , 1 , 1 ) )
339
+
340
+ // Cell group V:
341
+ // outside r^2 = 1.0
342
+ // cumulative sample coverage > 99.99%
345
343
guard r2 > 1.0
346
344
else
347
345
{
348
346
return self . amplitude * r2
349
347
}
350
-
351
- // Cell group V:
352
- // within r^2 = 1.25
353
- // cumulative sample coverage > 99.99%
354
348
for offset in [ ( - 2 , 0 , 0 ) , ( 0 , - 2 , 0 ) , ( 0 , 0 , - 2 ) ,
355
349
( 0 , - 2 , - 1 ) , ( 0 , - 1 , - 2 ) , ( - 2 , 0 , - 1 ) , ( - 1 , 0 , - 2 ) , ( - 2 , - 1 , 0 ) , ( - 1 , - 2 , 0 ) ,
356
350
( - 2 , - 1 , - 1 ) , ( - 1 , - 2 , - 1 ) , ( - 1 , - 1 , - 2 ) ]
357
351
{
358
352
_inspect_cell ( offset: offset)
359
353
}
354
+
355
+ // Cell group VI:
356
+ // outside r^2 = 1.25
357
+ // cumulative sample coverage > 99.99%
360
358
guard r2 > 1.25
361
359
else
362
360
{
363
361
return self . amplitude * r2
364
362
}
365
-
366
- // Cell group VI:
367
- // within r^2 = 1.5
368
- // cumulative sample coverage > 99.99%
369
363
for offset in [ ( 0 , 1 , - 2 ) , ( 0 , - 2 , 1 ) , ( 1 , 0 , - 2 ) , ( - 2 , 0 , 1 ) , ( 1 , - 2 , 0 ) , ( - 2 , 1 , 0 ) ,
370
364
( - 2 , 1 , - 1 ) , ( - 2 , - 1 , 1 ) , ( 1 , - 2 , - 1 ) , ( - 1 , - 2 , 1 ) , ( 1 , - 1 , - 2 ) , ( - 1 , 1 , - 2 ) ]
371
365
{
372
366
_inspect_cell ( offset: offset)
373
367
}
374
- guard r2 > 1.5
375
- else
376
- {
377
- return self . amplitude * r2
378
- }
379
368
380
- // Cell group VII:
381
- // within r^2 = 2.0
369
+ // Cell group VII: [(-2, 1, 1), (1, -2, 1), (1, 1, -2)] [ occluded ]
370
+ // outside r^2 = 1.5
371
+ // cumulative sample coverage > 99.99%
372
+
373
+ // Cell group VIII:
374
+ // outside = 2.0
382
375
// cumulative sample coverage > 99.99%
383
- _inspect_cell ( offset: ( - 2 , 1 , 1 ) )
384
- _inspect_cell ( offset: ( 1 , - 2 , 1 ) )
385
- _inspect_cell ( offset: ( 1 , 1 , - 2 ) )
386
376
guard r2 > 2.0
387
377
else
388
378
{
389
379
return self . amplitude * r2
390
380
}
391
-
392
- // Cell group VIII:
393
- // within r^2 = 2.25
394
- // cumulative sample coverage > 99.99%
395
381
for offset in [ ( 0 , - 2 , - 2 ) , ( - 2 , 0 , - 2 ) , ( - 2 , - 2 , 0 ) , ( - 1 , - 2 , - 2 ) , ( - 2 , - 1 , - 2 ) , ( - 2 , - 2 , - 1 ) ]
396
382
{
397
383
_inspect_cell ( offset: offset)
398
384
}
385
+
386
+ // Cell group IX: [(1, -2, -2), (-2, -2, 1), (-2, 1, -2)] [ occluded ]
387
+ // outside r^2 = 2.25
388
+ // cumulative sample coverage > 99.99%
399
389
guard r2 > 2.25
400
390
else
401
391
{
402
392
return self . amplitude * r2
403
393
}
404
-
405
- // Cell group IX:
406
- // within r^2 = 2.5
407
- // cumulative sample coverage > 99.99%
408
- for offset in [ ( 2 , 0 , 0 ) , ( 0 , 2 , 0 ) , ( 0 , 0 , 2 ) ,
394
+ for offset in [ ( 2 , 0 , 0 ) , ( 0 , 2 , 0 ) , ( 0 , 0 , 2 ) ,
409
395
( 0 , - 1 , 2 ) , ( 0 , 2 , - 1 ) , ( - 1 , 0 , 2 ) , ( 2 , 0 , - 1 ) , ( - 1 , 2 , 0 ) , ( 2 , - 1 , 0 ) ,
410
- ( 1 , - 2 , - 2 ) , ( 2 , - 1 , - 1 ) , ( - 2 , - 2 , 1 ) , ( - 1 , - 1 , 2 ) , ( - 2 , 1 , - 2 ) , ( - 1 , 2 , - 1 ) ]
396
+ ( 2 , - 1 , - 1 ) , ( - 1 , - 1 , 2 ) , ( - 1 , 2 , - 1 ) ]
411
397
{
412
398
_inspect_cell ( offset: offset)
413
399
}
400
+
401
+ // Cell group X:
402
+ // outside r^2 = 2.5
403
+ // cumulative sample coverage > 99.99%
414
404
guard r2 > 2.5
415
405
else
416
406
{
417
407
return self . amplitude * r2
418
408
}
419
-
420
- // Cell group X:
421
- // within r^2 = 2.75
422
- // cumulative sample coverage > 99.99%
423
409
for offset in [ ( 0 , 1 , 2 ) , ( 0 , 2 , 1 ) , ( 1 , 0 , 2 ) , ( 2 , 0 , 1 ) , ( 1 , 2 , 0 ) , ( 2 , 1 , 0 ) ,
424
410
( 2 , 1 , - 1 ) , ( 2 , - 1 , 1 ) , ( 1 , 2 , - 1 ) , ( - 1 , 2 , 1 ) , ( 1 , - 1 , 2 ) , ( - 1 , 1 , 2 ) ]
425
411
{
426
412
_inspect_cell ( offset: offset)
427
413
}
428
- guard r2 > 2.75
429
- else
430
- {
431
- return self . amplitude * r2
432
- }
433
414
434
- // Cell group XI:
435
- // within r^2 = 3.0
415
+ // Cell group XI: [(2, 1, 1), (1, 2, 1), (1, 1, 2)] [ occluded ]
416
+ // outside r^2 = 2.75
436
417
// cumulative sample coverage = 100%
437
- for offset in [ ( 2 , 1 , 1 ) , ( 1 , 2 , 1 ) , ( 1 , 1 , 2 ) ]
438
- {
439
- _inspect_cell ( offset: offset)
440
- }
418
+
419
+ // stop outside r^2 = 3.0
441
420
return self . amplitude * r2
442
421
}
443
422
0 commit comments