PaulVirally/VoxelShapes.jl: v0.2.0
Résumé fourni par la source
VoxelShapes v0.2.0 Diff since v0.1.1 0.2.0 Breaking changes Removed World. This is now replaced by Geometry, which holds the shapes, background, and anti-aliasing, and Region which defines the voxel grid: # in v0.1 world = World((N, N, N), (1/N, 1/N, 1/N), shapes, 0.0, NoAntiAliasing()) arr = Array(world) # in v0.2 geometry = Geometry(shapes, 0.0, NoAntiAliasing()) region = Region((N, N, N), (1//N, 1//N, 1//N), (1//2, 1//2, 1//2)) arr = rasterize(geometry, region) Array(world), CuArray(world), fill!(arr, world) and similar(world) have been removed. Use rasterize(geometry, region), rasterize(geometry, region, CuArray) and rasterize!(arr, geometry, region) instead. The grid is now specified by its center, not its lower corner. Voxel size and grid center must be Rational (or Integer), not floating point. The floating point type used by the kernel is no longer inferred from the voxel size. It defaults to Float64 and is set with the precision keyword, for example rasterize(geometry, region; precision=Float32) for Float32 shapes on the GPU. add_shape now takes a Geometry instead of a World. size(world) and eltype(world) are gone. Use size(region) or cells(region) for the grid, and eltype(geometry) for the fill type. New CompositeGrid: holds multiple Regions of different resolution that tile one box. Regions must have even cell counts, integer scale ratios, a common grid, disjoint interiors, and must tile their bounding box exactly. refine(grid, box; factor=2) carves a region into a finer core plus the slabs that fill the rest, with the box given as a Region or a (center, dims) tuple. refine(grid, shape; factor=2, padding=0) does the same for the shape's bounding box. rasterize(geometry, grid::CompositeGrid) returns a CompositeField which is a flat vector with one entry per voxel, region by region. vec, regionview, eachregion and regrid exist to work with this type. Grid accessors: cells, scale, center, lower_corner, upper_corner, voxel_centers, regions, nregions, finest, coordinates, cellvolumes, bounding_box. bounding_box(shape) for every built in shape, Rotated and the CSG wrappers. The default for a custom shape is an infinite box. sample(geometry, pos, voxel_size) evaluates a geometry at one point. Example examples/08_refine.jl and a "Grids and refinement" docs page. Merged pull requests: Bump julia-actions/setup-julia from 2 to 3 (#2) (@dependabot[bot]) Bump codecov/codecov-action from 4 to 7 (#3) (@dependabot[bot]) Bump julia-actions/cache from 2 to 3 (#4) (@dependabot[bot]) Bump actions/checkout from 4 to 7 (#5) (@dependabot[bot]) Update CUDA requirement from 5.8.2 to 5.8.2, 6.2 (#6) (@dependabot[bot]) Add the ability to refine a grid in certain key sub regions (#8) (@PaulVirally)