Commit graph

1340 commits

Author SHA1 Message Date
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
RonaldoCMP
14b0f264ac
Merge pull request #2 from revarbat/master
My repository update
2020-08-30 11:51:21 +01:00
Revar Desmera
3cba94efdc
Merge pull request #252 from RonaldoCMP/master
Correction of C_times arg validation
2020-08-29 21:42:36 -07:00
Revar Desmera
6a96f9331d
Merge pull request #251 from adrianVmariano/master
added os_mask to rounding and tweaked error messages in transpose
2020-08-29 21:41:00 -07:00
Adrian Mariano
2eb0ce0348 added os_mask to rounding and tweaked error messages in transpose 2020-08-28 23:16:11 -04:00
Revar Desmera
9a9f169f8f
Merge pull request #250 from revarbat/revarbat_dev
Fixed broken line-plane intersections.  Attachment enhanced vnf_polyhedron()
2020-08-28 19:22:18 -07: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
Garth Minette
7051f8ef19 Fixed cheatsheet index link. 2020-08-28 00:06:28 -07:00
Revar Desmera
1d6d63748d
Merge pull request #249 from adrianVmariano/master
some child handling
2020-08-27 23:50:45 -07:00
Garth Minette
e344de4aa4 Added cheat-sheet generation script. 2020-08-27 22:29:11 -07:00
Adrian Mariano
411c1f866e fixed missing ; bug in test_transforms.scad 2020-08-27 19:48:13 -04:00
Adrian Mariano
c1782f1113 added no_children checks, and attachable to vnf_polyhedron 2020-08-27 19:25:41 -04:00
Revar Desmera
f14b64cdbd
Merge pull request #248 from adrianVmariano/master
small tweak to hide two functions
2020-08-27 14:21:06 -07:00
Adrian Mariano
a8522854e4 small tweak to hide two functions 2020-08-27 17:07:12 -04:00
RonaldoCMP
ab8a04fe82 Merge branch 'master' of https://github.com/RonaldoCMP/BOSL2 2020-08-27 11:51:10 +01:00
RonaldoCMP
75a7dabfd2
Merge pull request #1 from revarbat/master
Updating my repository
2020-08-27 11:50:20 +01:00
Revar Desmera
6eab7101e0
Merge pull request #247 from revarbat/revarbat_dev
Implement Issue #2.  Added diameter alternates for most radius options.
2020-08-26 20:42:00 -07:00
Garth Minette
bb046c34dc Merge branch 'master' of github.com:revarbat/BOSL2 into revarbat_dev 2020-08-26 20:39:59 -07:00
Garth Minette
dba5aab918 Implement Issue #2. Added diameter alternates for most radius options. 2020-08-26 20:39:45 -07:00
Revar Desmera
c71342c0eb
Merge pull request #246 from revarbat/revarbat_dev
Added is_zero(), is_positive(), is_negative, is_nonpositive(), is_nonnegative().
2020-08-26 18:06:59 -07:00
Garth Minette
1d318ebc38 Merge branch 'master' of github.com:revarbat/BOSL2 into revarbat_dev 2020-08-26 18:02:31 -07:00
Garth Minette
b679ea52dc Add is_zero(), is_positive(), is_negative(), is_nonpositive(), is_nonnegative(). 2020-08-26 18:02:16 -07:00
Revar Desmera
9e32d28932
Merge pull request #245 from revarbat/revarbat_dev
Fix for #243.  Added better docs and asserts to rot()
2020-08-26 16:02:06 -07:00
Garth Minette
90e02ad7a4 Fix for #243. Added better docs and asserts to rot() 2020-08-26 15:59:35 -07:00
RonaldoCMP
99b18d6311 Correction of C_times arg validation 2020-08-26 14:14:26 +01:00
RonaldoCMP
069432021b Revert "Revert "Revert "Correction of C_times validation"""
This reverts commit e8499baba1.
2020-08-26 14:09:32 +01:00
RonaldoCMP
e8499baba1 Revert "Revert "Correction of C_times validation""
This reverts commit 4a366967f9.
2020-08-26 14:09:12 +01:00
RonaldoCMP
4a366967f9 Revert "Correction of C_times validation"
This reverts commit 1ced82f16c.
2020-08-26 14:07:53 +01:00
RonaldoCMP
1ced82f16c Correction of C_times validation 2020-08-26 14:07:12 +01:00
Revar Desmera
de946381ae
Merge pull request #244 from revarbat/revarbat_dev
Revarbat dev
2020-08-25 22:55:41 -07:00
Garth Minette
9f02750519 Merge branch 'master' of github.com:revarbat/BOSL2 into revarbat_dev 2020-08-25 22:54:00 -07:00
Revar Desmera
248921df8d
Merge pull request #242 from kelvie/diff-tag-fix
Fix diff/intersect when some tags are hidden
2020-08-25 22:50:48 -07:00
Revar Desmera
32c30c448e
Merge pull request #234 from RonaldoCMP/master
Geometry full review and minor edits
2020-08-25 22:38:51 -07:00
RonaldoCMP
fb8d49f8cc Restore updating calls to geometry 2020-08-25 12:28:15 +01:00
Kelvie Wong
e5a0a3cad7 Fix diff/intersect when some tags are hidden
When the first operand is hidden, some strange things happen, so this guards
against that.

Example:

    include <BOSL2/std.scad>

    part_to_show = "A"; // [A,B,C]
    part_to_hide = "B"; // [A,B,C]

    module my_part() {
        tags("A") left(10) cuboid(10);
        tags("B") diff("neg", "B") right(10) {
            cuboid(10);
            cyl(d=10, h=10, $tags="neg");
        }
        tags("C") fwd(10) cuboid(10);
    }

    show(part_to_show) hide(part_to_hide) my_part();

Tag "B" here acts very strangely when it is supposed to be hidden, and never
hides completely.
2020-08-22 16:19:39 -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
9611bc54ec Merge branch 'master' of https://github.com/RonaldoCMP/BOSL2 2020-08-20 22:41:00 +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
Revar Desmera
92d9c49b90
Merge pull request #240 from revarbat/revarbat_dev
Added excess= argument to most mask modules.
2020-08-18 19:11:41 -07:00
Garth Minette
ee86544a81 Added excess= argument to most mask modules. 2020-08-18 19:09:26 -07:00
RonaldoCMP
a10a74a265
Update geometry.scad
Removed all double definitions
2020-08-18 23:31:29 +01:00
RonaldoCMP
29672105ed
Update geometry.scad
Removed all double definitions
2020-08-18 23:27:38 +01:00
RonaldoCMP
26ff57491e
Merge branch 'master' into master 2020-08-18 23:10:57 +01:00
RonaldoCMP
a290741b17 Merge remote-tracking branch 'upstream/master' 2020-08-18 11:06:36 +01:00
RonaldoCMP
5fab080f8e Revert "Revert "Merge remote-tracking branch 'upstream/revarbat_dev'""
This reverts commit f4a8138b37.
2020-08-18 11:04:56 +01:00