Commit graph

129 commits

Author SHA1 Message Date
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
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
RonaldoCMP
526c01109c Minor edits in in_list and transpose, removal of is_simple list 2020-07-31 15:52:35 +01:00
Garth Minette
6064dcbed0 Fix list_remove() for null index list. 2020-07-29 22:39:17 -07:00
Revar Desmera
cddb76a131
Merge branch 'master' into master 2020-07-29 22:14:16 -07:00
Revar Desmera
5e98cbf679
Merge pull request #216 from RonaldoCMP/master
Extensive changes in arrays.scad, vectors.scad, common.scad and their regression test codes
2020-07-29 21:44:39 -07:00
RonaldoCMP
8a25764744 Overall review, input data check, format, new function definitions
New function definitions in commom.scad:
1. valid_range;
2. _list_pattern

New function definitions in math.scad:
1. binomial;
2. binomial_coefficient;
3. convolve;

Code review in math:
1. sum;
2. median;
3. is_matrix;
4. approx;
5. count_true;
6. doc of deriv2;
7. polynomial;
8. poly_mult;
9; poly_div;
10. _poly_trim

Code change in test_common:
1. new test_valid_range;
2. test_is_consistent

Code change in test_math:
1. test_approx;
2. new test_convolve;
3. new test_binomial;
4. new test_binomial_coefficient;
5. test_outer_product;
6. test_polynomial;
7. test_poly_mult;
8. test_poly_div;
9. test_poly_add;
2020-07-29 22:41:02 +01:00
RonaldoCMP
babc10d60d Revert "input checks in math and new function definitions"
This reverts commit 19e5a9504a.
2020-07-29 21:50:22 +01:00
RonaldoCMP
19e5a9504a input checks in math and new function definitions 2020-07-29 21:49:15 +01:00
RonaldoCMP
281d945ed7 Revert "update"
This reverts commit d45f289a95.
2020-07-29 15:30:35 +01:00
RonaldoCMP
62629b6eb6 Revert "remove test_all"
This reverts commit 66aba45802.
2020-07-29 06:50:42 +01:00
RonaldoCMP
66aba45802 remove test_all 2020-07-29 02:40:59 +01:00
Adrian Mariano
b7b276099f commented out test for removed function
added test for find_noncollinear_points where no such points exist
2020-07-28 18:06:57 -04:00
RonaldoCMP
d45f289a95 update 2020-07-28 22:55:21 +01:00
Adrian Mariano
7b5c2456ce change hull to use find_noncollinear_points, add some error checks,
add regression tests
2020-07-28 17:54:57 -04:00
RonaldoCMP
ab57790c27 Correction of is_vector and doc text 2020-07-28 19:02:35 +01:00
RonaldoCMP
c10a8b919d Extensive review of arrays.scad, vectors.scad, common.scad and their regression tests
Here is an extensive review of common.scad, vectors.scad, arrays.scad and their regression test codes. The changes were mostly in input data check and format. Some few functions got more changes either to adapt them to the new asserts or because a better (faster, simpler) code was found.

Another change was moving add_scalar from vectors.scad to arrays.scad. It is in fact an array operation. Some few documentation examples and test codes were added. Some function argument names were changed to keep them consistent with the names they have in other similar functions. That name changes were not as extensive as I would like but it is advisable to favor users.

Most, but not all, changed function codes are followed by a comment with a short summary of the changes done. Those comments always start with:
//***

I can eliminate those comments before a merge is done or in a second round.
2020-07-25 20:27:19 +01:00
RonaldoCMP
bdba4c0821 A broad review of input data check and code format
Some functions were changed for sake of clarity or better performance.
2020-07-24 22:54:34 +01:00
Adrian Mariano
1dda5b088c Fixed docs for path2d.
Modified pointlist_bounds to give output that matches input
dimension and to work on any input dimension.  Also made it ~20 times faster.
2020-07-24 16:36:57 -04:00
RonaldoCMP
d2e851ae42
Merge branch 'master' into master 2020-07-24 14:47:25 +01:00
RonaldoCMP
464c65ce8c Eliminating tabs 2020-07-24 13:30:19 +01:00
RonaldoCMP
877a07b711 Full review of input data checking, formating and improvement in some functions
Refactorigng of list_set(), list_insert() and list_remove() without any sorting and speed gain.

Some argument names changed for consistence between functions.

test_array() updated.
2020-07-24 00:19:49 +01:00
RonaldoCMP
88e2fc0f29 Input data check review and some refactoring
Some functions have been changed as a consequence of the dat checking review. vector_axis was fully refactored. add_scalar was moved to arrays.scad
2020-07-24 00:10:36 +01:00
RonaldoCMP
39b4b7282d Update typeof(), int(), range(), list_of() and segs 2020-07-24 00:04:16 +01:00
Adrian Mariano
7eafa691b4 Changed to relative include names 2020-07-21 20:05:21 -04:00
Adrian Mariano
a73ca6368c fixed in_list bug 2020-07-21 19:55:05 -04:00
Garth Minette
4a37a5dc8e Added zero=undef/true/false arg to is_vector. Bugfix for vector_axis() 2020-07-21 16:15:02 -07:00
RonaldoCMP
e017c6075d input data checks and addition of many new functions
1. Input data check in all functions
2. Definition of new functions for data check, new interpolations functions, quaternion from matrix, rotation path interpolating quaternions, inverse, exp, ln, power.
2020-07-17 20:28:28 +01:00
Revar Desmera
0ade5d5baa
Merge pull request #201 from adrianVmariano/master
Updates
2020-07-13 09:35:21 -07:00
Adrian Mariano
f190b50c4d substituted correct file 2020-07-12 07:10:56 -04:00
Adrian Mariano
4e2092f347 Added a bunch of tests 2020-07-11 12:22:44 -04:00
Garth Minette
dde616dad5 unit() now asserts error for zero-length vector unless dflt= arg is given. 2020-07-10 00:03:55 -07:00
Garth Minette
34e16dc0ca Fixed skin regression. 2020-07-07 21:21:05 -07:00
Garth Minette
78ecbbd9c5 Added regression for centroid() 2020-07-06 16:15:32 -07:00