mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-06 04:09:47 +00:00
bbe4ad1467
There were bugs in the previous sorting functions. They didn't check the homogeneity of the input list before calling _sort_scalars and _sort_vectors. The bug might result in wrong order and missing list elements in the output. Besides correcting the bug a recode of all sorting functions result in better performance and a enlargement of their scope. With the new functions, list of vectors of any dimension may be sorted, even with idx given, with the native comparison operators. The scope of indexed sorting is also extended. The file test_arrays has been extended to check the new funcionality. New functions: is_homogeneous - checks if a list has elements of the same type (although not distinguing booleans from numbers) up to a given depth _sort_vectors - internal function to sort homgeneous lists of vectors using native comparison operators; extends the scope of the previous _sort_vectors# functions with better performance _lexical_sort - internal function to sort non-homogeneous lists; uses compare_vals _indexed_sort - internal function to perform indexed sorting of non-homogeneous lists; uses compar_vals Changed/reviewed functions: _valid_idx - doesn't requires the input of imin and imax args sort - explores the internal functions to get better performance and an enlarged scope sortidx - explores the internal functions to get better performance and an enlarged scope _sort_general - just for sortings of non-homogeneous lists using compare_vals _array_dim_recurse - changed for bit better performance Functions eliminated: _sort_vectors1 _sort_vectors2 _sort_vectors3 _sort_vectors4 |
||
---|---|---|
.. | ||
hull.scad | ||
polyhedra.scad | ||
test_affine.scad | ||
test_arrays.scad | ||
test_common.scad | ||
test_coords.scad | ||
test_cubetruss.scad | ||
test_debug.scad | ||
test_edges.scad | ||
test_geometry.scad | ||
test_hull.scad | ||
test_linear_bearings.scad | ||
test_math.scad | ||
test_mutators.scad | ||
test_primitives.scad | ||
test_quaternions.scad | ||
test_queues.scad | ||
test_shapes.scad | ||
test_shapes2d.scad | ||
test_skin.scad | ||
test_stacks.scad | ||
test_strings.scad | ||
test_structs.scad | ||
test_transforms.scad | ||
test_vectors.scad | ||
test_version.scad | ||
test_vnf.scad |