void addRandomSpheres( std::shared_ptr<Container> container, RandomNumberGenerator & rng, int numSpheres ) { for( int si = 0; si < numSpheres; si++ ) { container->add( std::make_shared<Sphere>( Vector4( rng.uniformRange( -1.5, 1.5 ), rng.uniformRange( -1.5, 1.5 ), rng.uniformRange( -10.0, -3.0 ) ), 0.15 ) ); } }
void addRandomCubes( std::shared_ptr<Container> container, RandomNumberGenerator & rng, int numCubes ) { for( int si = 0; si < numCubes; si++ ) { float x = rng.uniformRange( -1.5, 1.5 ); float y = rng.uniformRange( -1.5, 1.5 ); float z = rng.uniformRange( -10.0, -3.0 ); container->add( std::make_shared<AxisAlignedSlab>( x - 0.1, y - 0.1, z - 0.1, x + 0.1, y + 0.1, z + 0.1 ) ); } }
void testUniformSquare() { Plot2D plot( output_path + "/random_square.png", plot_size, plot_size ); for( auto i = 0; i < points_per_plot; i++ ) { float x = rng.uniformRange( -0.9, 0.9 ); float y = rng.uniformRange( -0.9, 0.9 ); plot.addPoint( x, y ); } }