This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO, parallel sort of points, refactoring. | |
/// <summary> | |
/// Variable radii poisson disk sampling in 3D. | |
/// Based on: graphics.cs.umass.edu/pubs/sa_2010.pdf | |
/// </summary> | |
public static class PoissonSampling3D { | |
struct PointDataComparer : IComparer<float4> { | |
public AABB GridBounds; | |
public int3 CellsPerAxis; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import multiprocessing | |
import os | |
import time | |
class Pool(): | |
def __init__(self): | |
self.cpu_count = os.cpu_count() | |
self.pool = [] | |
self.pool_lock = multiprocessing.Lock() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import queue | |
import threading | |
import os | |
import time | |
import signal | |
class Worker(threading.Thread): | |
def __init__(self, tasks, results): | |
super().__init__() | |
self.tasks = tasks |