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.
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.
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.
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.
Added attachment support to all modules, and bug fixed rounded_prism (problem introduced by error checking in det2), and fixed broken example in rounding.
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()?
- introducing is_matrix in is_path makes it more efficient.
- simplify is_path and simplify_path_indexed is now able to deal with path of any dimension.