mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-16 14:34:00 +02:00
logic improvement, typos, error documentation
This commit is contained in:
16
regions.scad
16
regions.scad
@@ -865,13 +865,13 @@ function _point_dist(path,pathseg_unit,pathseg_len,pt) =
|
|||||||
// r = offset radius. Distance to offset, rounds over corners.
|
// r = offset radius. Distance to offset, rounds over corners.
|
||||||
// delta = Distance to offset with pointed corners.
|
// delta = Distance to offset with pointed corners.
|
||||||
// chamfer = Chamfer corners when you specify `delta`. Default: false
|
// chamfer = Chamfer corners when you specify `delta`. Default: false
|
||||||
// closed = If true, path is treated as a polygon. Default: True.
|
// closed = If true, path is treated as a polygon. Default: true
|
||||||
// check_valid = Perform segment validity check. Default: True.
|
// check_valid = Perform segment validity check. Default: true
|
||||||
// quality = Validity check quality parameter, a small integer. Default: 1.
|
// quality = Validity check quality parameter, a small integer. Default: 1
|
||||||
// error = If true, assert an error if offset path is degenerate. If false, return an empty list `[]` for a degenerate path. Default: true
|
// error = If true, assert an error if offset path is degenerate. If false, return an empty list `[]` for a degenerate path. You must check the result yourself before passing it into another function. Default: true
|
||||||
// same_length = Return a path with the same length as the input. Only compatible with `delta=`. Default: false
|
// same_length = Return a path with the same length as the input. Only compatible with `delta=`. Default: false
|
||||||
// return_faces = Return face list. Default: False.
|
// return_faces = Return face list. Default: false
|
||||||
// firstface_index = Starting index for face list. Default: 0.
|
// firstface_index = Starting index for face list. Default: 0
|
||||||
// flip_faces = Flip face direction. Default: false
|
// flip_faces = Flip face direction. Default: false
|
||||||
// Example(2D,NoAxes): Offset the red star out by 10 units.
|
// Example(2D,NoAxes): Offset the red star out by 10 units.
|
||||||
// star = star(5, r=100, ir=30);
|
// star = star(5, r=100, ir=30);
|
||||||
@@ -1028,8 +1028,8 @@ function offset(
|
|||||||
goodpath = bselect(path,good),
|
goodpath = bselect(path,good),
|
||||||
degenerate = (len(goodsegs)-(!closed && select(good,-1)?1:0) <= 0)
|
degenerate = (len(goodsegs)-(!closed && select(good,-1)?1:0) <= 0)
|
||||||
)
|
)
|
||||||
degenerate && error ? assert(false, "\nOffset of path is degenerate.")
|
assert(!(degenerate && error), "\nOffset of path is degenerate.")
|
||||||
: degenerate && !error ? [] // return empty path
|
: degenerate ? [] // return empty path
|
||||||
: let(
|
: let(
|
||||||
// Extend the shifted segments to their intersection points. For open curves the endpoints
|
// Extend the shifted segments to their intersection points. For open curves the endpoints
|
||||||
// are simply the endpoints of the shifted segments. If segments are parallel then the intersection
|
// are simply the endpoints of the shifted segments. If segments are parallel then the intersection
|
||||||
|
Reference in New Issue
Block a user