Commit graph

161 commits

Author SHA1 Message Date
Garth Minette
70a6b7fac8 Fixed some undef warnings in distributors. 2020-12-09 23:43:08 -08:00
Garth Minette
e6ef5e98be Fix math.scad regression. 2020-12-02 17:21:58 -08:00
Garth Minette
f36fbb60db Fix for #166: tweaks for xcopies, etc. 2020-11-30 21:09:00 -08:00
Marcin Jaworski
8cd7530743 Added tests for struct_val() with default value 2020-11-13 17:19:29 +01:00
Adrian Mariano
f598426344 Add cumprod function and regression test 2020-10-23 19:06:30 -04:00
Adrian Mariano
c80c7c558a Added rot_decode to decode rotation matrices and matrix_trace,
supporting function, and regression tests for both.
2020-10-20 16:26:11 -04:00
Garth Minette
41ab991c15 Fixed bad spheroid() regression. 2020-10-15 19:21:36 -07:00
Garth Minette
16ee49e8b2 Fixed a bunch of undef math warnings with dev snapshot OpenSCAD builds. 2020-10-03 19:50:29 -07:00
Garth Minette
e3ccf482fa Make list functions make more sense with strings. 2020-09-28 19:12:07 -07:00
Garth Minette
cc29e07d8f Enable list-of-matrix use of vmul(). 2020-09-28 17:35:05 -07:00
Garth Minette
23bcc1b806 Removed sum_of_squares() as it's redundant with sqr(vector) 2020-09-28 16:56:18 -07:00
Garth Minette
37ae0cbba0 Simplify sqr(x) to x*x 2020-09-28 16:52:17 -07:00
Garth Minette
1435100e37 Implemented Issue #262 2020-09-25 00:31:42 -07:00
Garth Minette
f193871a34 Implement fix for issue #174. 2020-09-25 00:01:45 -07:00
Garth Minette
4f88775ef9 Changed circle_point_tangents() to return just a list of 2D tangent points. 2020-09-24 17:09:06 -07:00
Garth Minette
45dbfe6524 Added regressions for torx_drive.scad 2020-09-24 15:59:25 -07:00
Garth Minette
c400843cb2 Added regressions for vnf_centroid() and vnf_volume() 2020-09-23 19:38:22 -07:00
Garth Minette
eb969bba7e hull, quaternion, and edges regressions. 2020-09-22 20:33:50 -07:00
RonaldoCMP
75e5cd4979 Solving bugs in functions on planes 2020-09-09 09:37:31 +01:00
Garth Minette
b2121fbfb3 Added all_nonzero(). Added is_vector(all_nonzero=). 2020-09-07 23:10:39 -07:00
Garth Minette
a9b8f5618a Fix for Issue #263 2020-09-06 17:15:08 -07:00
Adrian Mariano
399c40f7a6 Added null_space and diagonal_matrix 2020-09-01 18:38:31 -04:00
Adrian Mariano
3caeeff2cd Added norm_fro, quadratic_roots and pivoting to qr_factor and
linear_solve.  Added tests.
2020-09-01 17:57:31 -04:00
Adrian Mariano
8f6c2e8538 Add submatrix_set and block_matrix and tests 2020-09-01 16:42:47 -04:00
RonaldoCMP
bbe4ad1467 Sort debugging and optimizing
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
2020-08-30 12:12:36 +01:00
Garth Minette
5d2c45bba0 Merge branch 'master' of github.com:revarbat/BOSL2 into revarbat_dev 2020-08-28 19:19:04 -07:00
Garth Minette
e1b0985afc Fixed broken line-plane intersections. Attachment enhanced vnf_polyhedron(). 2020-08-28 19:07:10 -07:00
Adrian Mariano
411c1f866e fixed missing ; bug in test_transforms.scad 2020-08-27 19:48:13 -04:00
Garth Minette
b679ea52dc Add is_zero(), is_positive(), is_negative(), is_nonpositive(), is_nonnegative(). 2020-08-26 18:02:16 -07:00
Garth Minette
9f02750519 Merge branch 'master' of github.com:revarbat/BOSL2 into revarbat_dev 2020-08-25 22:54:00 -07:00
RonaldoCMP
da5546cbc2 In observance of owner's last review
Eliminate double definitions.
Eliminate unneeded comments.

In common.scad redefine num_defined(), all_defined() and get_radius().

In geometry.scad:
- change name _dist to _dist2line
- simplify _point_above_below_segment() and triangle_area()
- change some arg names for uniformity (path>>poly)
- change point_in_polygon() to accept the Even-odd rule as alternative
- and other minor edits

Update tests_geometry to the new funcionalities.
2020-08-20 22:42:24 +01:00
RonaldoCMP
5462616e1e Revert "In observance of owner's last review"
This reverts commit 99e815f077.
2020-08-20 22:36:50 +01:00
RonaldoCMP
99e815f077 In observance of owner's last review
Eliminate double definitions.
Eliminate unneeded comments.

In common.scad redefine num_defined(), all_defined() and get_radius().

In geometry.scad:
- change name _dist to _dist2line
- simplify _point_above_below_segment() and triangle_area()
- change some arg names for uniformity (path>>poly)
- change point_in_polygon() to accept the Even-odd rule as alternative
- and other minor edits

Update tests_geometry to the new funcionalities.
2020-08-20 22:36:26 +01:00
RonaldoCMP
5051fe5977 Revert "In observance of owner's last review"
This reverts commit 12963296bb.
2020-08-20 22:22:55 +01:00
RonaldoCMP
12963296bb In observance of owner's last review
Eliminate double definitions.
Eliminate unneeded comments.

In common.scad redefine num_defined(), all_defined() and get_radius().

In geometry.scad:
- change name _dist to _dist2line
- simplify _point_above_below_segment() and triangle_area()
- change some arg names for uniformity (path>>poly)
- change point_in_polygon() to accept the Even-odd rule as alternative
- and other minor edits

Update tests_geometry to the new funcionalities.
2020-08-20 22:03:20 +01:00
Garth Minette
5e981fb4a7 Added tests for path3d() and path4d() with fille= 2020-08-18 19:25:05 -07:00
RonaldoCMP
2efd0ca5d0 Function name change
plane_projection >> projection_on_plane
2020-08-16 23:54:00 +01:00
RonaldoCMP
3bf22cd236 In-depth review
Besides param validation and some formating, changes:

A. add new functions:

1. _valid_line()
2. _valid_plane()
3. line_from_points()
4. projection_on_plane()
5. points_on_plane()

B. rename/redefine/remove functions:

1. points_are_coplanar() >> coplanar()
2. collinear() works with list of points as well as coplanar()
3. find_noncollinear_points >> noncollinear_triple
4. collinear_indexed() removed
5. polygon_is_convex() >> is_convex_polygon()

C. recode/optimize the codes of the functions:

1. point_on_segment2d()
2. point_left_of_line2d()
3. distance_from_line()
4. line_closest_point()
5. plane_from_polygon()
6. _general_plane_line_intersection()
7. polygon_line_intersection()
8. find_circle_2tangents()
9. find_circle_3points()
10. polygon_area()
11. is_convex_polygon()
12. reindex_polygon()
13. centroid()
14. polygon_is_clockwise()
15. clockwise_polygon()
16. ccw_polygon()

The function name changes were updated in:
test_geometry.scad
hull.scad
rounding.scad
vnf.scad

Regression tests for the new external functions were included in test_geometry.scad.

Unsolved questions:
1. why sorting the indices in plane_from_points and polygon_line_intersection?
2. aren't redundant plane_from_polygon() and plane_from_points()?
2020-08-16 23:33:11 +01:00
RonaldoCMP
b6085e0cbc
Exclude echo() 2020-08-11 15:36:44 +01:00
RonaldoCMP
50b0f170e7 Extend the scope of transpose
It allows a transposition in respect to the secondary "diagonal"
2020-08-11 14:55:25 +01:00
RonaldoCMP
1df84f3552 Revert "Extend scope of transpose"
This reverts commit 5ebf1c80b9.
2020-08-11 14:33:42 +01:00
RonaldoCMP
5ebf1c80b9 Extend scope of transpose
Includes an arg to allow transposing in respecto to the secondary "diagonal"
2020-08-11 14:32:25 +01:00
Revar Desmera
c0481f14eb
Merge pull request #229 from adrianVmariano/master
move submatrix to arrays and relax input restrictions
2020-08-04 00:38:23 -07:00
Adrian Mariano
4e36eacca8 Moved submatrix to arrays.scad and relaxed requirement for numerical
input.  Added examples and tests.
2020-08-03 19:49:22 -04:00
RonaldoCMP
e06519bbfb changes to hide recursion args and avoid repetitive arg validations
cumsum broken in two to hide recursion args and avoid repetitive arg validations.

back_substitute changed to avoid repetitive arg validations in the recursion.

minor change in deriv2 and deriv3 to avoid an unecessary call to is_matrix.

change in is_matrix for better performance

any() and all() broken in two to avoid repetitive arg validation in the recursion and to hide recursion args.

change in polymult to call convolve

break of poly_div in two to avoid repetitive arg validations in the recursion.
2020-08-04 00:38:36 +01:00
RonaldoCMP
c9408a66fa Merge remote-tracking branch 'upstream/master' 2020-08-04 00:13:26 +01:00
Adrian Mariano
06b69475cb Fix bug. Add test for subindex. 2020-08-02 10:38:11 -04:00
Adrian Mariano
47d02ae783 removed median tests 2020-08-02 01:23:15 -04:00
Adrian Mariano
e2817ae64d removed references to errors.scad 2020-08-02 01:18:33 -04:00
RonaldoCMP
e858d5627e Merge remote-tracking branch 'upstream/revarbat_dev' 2020-08-02 00:03:05 +01:00