⚡ Live Interactive Code Sandbox: AI Dev Tool: Poisson Disk Sampling
▶️ Run Code
💳 Unlock Source Code ($5)
📝 Editable Code Sandbox
```python # AI Dev Tool: Poisson Disk Sampling CLI Automation Tool # ===================================================== # A command-line interface (CLI) automation tool for generating Poisson Disk Sampling patterns. import numpy as np from scipy.spatial import distance import argparse import json def poisson_disk_sampling(width: int, height: int, radius: int, num_samples: int) -> np.ndarray: """ Generate a Poisson Disk Sampling pattern. Args: - width (int): The width of the sampling area. - height (int): The height of the sampling area. - radius (int): The minimum distance between samples. - num_samples (int): The number of samples to generate. Returns: - np.ndarray: A 2D array of sample points. """ # Initialize the sampling area with zeros sampling_area = np.zeros((height, width)) # Initialize the list of sample points sample_points = [] # Generate the first sample point at a random location x = np.random.randint(0, width) y = np.random.randint(0, height) sample_points.append((x, y)) sampling_area[y, x] = 1 # Generate
🖥️ Interactive Execution Terminal Console
⚡ Ready! Click ▶️ Run Code to execute code in browser terminal...