mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-15 08:59:40 +00:00
Compare commits
6 commits
7b466df29d
...
a70dbbf6e2
Author | SHA1 | Date | |
---|---|---|---|
|
a70dbbf6e2 | ||
|
328e1f0a9a | ||
|
569e1a0e84 | ||
|
4291acc27d | ||
|
3872625412 | ||
|
ed525909d3 |
2 changed files with 56 additions and 8 deletions
|
@ -1256,7 +1256,7 @@ module default_tag(tag,do_tag=true)
|
||||||
// Note that if you directly set the `$tag` variable then tag scoping will not work correctly.
|
// Note that if you directly set the `$tag` variable then tag scoping will not work correctly.
|
||||||
// Side Effects:
|
// Side Effects:
|
||||||
// `$tag_prefix` is set to the value of `scope=` if given, otherwise is set to a random string.
|
// `$tag_prefix` is set to the value of `scope=` if given, otherwise is set to a random string.
|
||||||
// Example: In this example the ring module uses "remove" tags which will conflict with use of the same tags by the parent.
|
// Example: In this example the ring module uses "remove" tags which will conflict with use of the same tags by the parent without tag_scope.
|
||||||
// module ring(r,h,w=1,anchor,spin,orient)
|
// module ring(r,h,w=1,anchor,spin,orient)
|
||||||
// {
|
// {
|
||||||
// tag_scope("ringscope")
|
// tag_scope("ringscope")
|
||||||
|
@ -1279,6 +1279,56 @@ module default_tag(tag,do_tag=true)
|
||||||
// tag("rem")ring(9.5,8,w=.3);
|
// tag("rem")ring(9.5,8,w=.3);
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
// Example: tag_scope can interact unexpectedly with attachable() depending on if you place it before attachable() or just inside it. If placed outside, the tag_scope will also apply to the attachable's children(). If placed inside it will only apply to the attachable's parent object.
|
||||||
|
// module outside_attachable(){
|
||||||
|
// tag_scope("outside_attachable")
|
||||||
|
// attachable(anchor=CENTER, spin=0, d=60, l=60) {
|
||||||
|
// color_this("white")
|
||||||
|
// diff()
|
||||||
|
// cyl(d=60, l=60){
|
||||||
|
//
|
||||||
|
// tag("remove")
|
||||||
|
// color_this("red")
|
||||||
|
// cyl(d=30, l=61);
|
||||||
|
// }
|
||||||
|
// children();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// module inside_attachable(){
|
||||||
|
// attachable(anchor=CENTER, spin=0, d=60, l=60) {
|
||||||
|
// tag_scope("inside_attachable")
|
||||||
|
// color_this("green")
|
||||||
|
// diff()
|
||||||
|
// cyl(d=60, l=60){
|
||||||
|
// tag("remove")
|
||||||
|
// color_this("blue")
|
||||||
|
// cyl(d=30, l=61);
|
||||||
|
// }
|
||||||
|
// children();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// diff()
|
||||||
|
// outside_attachable(){
|
||||||
|
// color_this("orange")
|
||||||
|
// cyl(d=20, l=61){
|
||||||
|
// tag("remove")
|
||||||
|
// color_this("yellow")
|
||||||
|
// cyl(d=10, l=65);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// right(60)
|
||||||
|
// diff()
|
||||||
|
// inside_attachable(){
|
||||||
|
// color_this("orange")
|
||||||
|
// cyl(d=20, l=61){
|
||||||
|
// tag("remove")
|
||||||
|
// color_this("yellow")
|
||||||
|
// cyl(d=10, l=65);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
module tag_scope(scope){
|
module tag_scope(scope){
|
||||||
req_children($children);
|
req_children($children);
|
||||||
scope = is_undef(scope) ? rand_str(20) : scope;
|
scope = is_undef(scope) ? rand_str(20) : scope;
|
||||||
|
|
|
@ -398,13 +398,11 @@ A feature unique to [rounded_prism()](https://github.com/BelfrySCAD/BOSL2/wiki/r
|
||||||
|
|
||||||
Two parameters control the roundover, k and joint. The joint parameter is the distance from where the rounding starts to the unrounded edge. The k parameter ranges from 0 to 1 with a default of 0.5. Larger values give a more abrupt transition and smaller ones a more gradual transition.
|
Two parameters control the roundover, k and joint. The joint parameter is the distance from where the rounding starts to the unrounded edge. The k parameter ranges from 0 to 1 with a default of 0.5. Larger values give a more abrupt transition and smaller ones a more gradual transition.
|
||||||
|
|
||||||
Parameters of a "smooth" roundover, with k=0.75.
|
A smooth roundover with a joint length of 18 and the value of k set to 0.75.
|
||||||
|
![](https://github.com/BelfrySCAD/BOSL2/wiki/images/rounding/figure_1_3.png)
|
||||||
|
|
||||||
![](https://github.com/BelfrySCAD/BOSL2/wiki/images/rounding/section-types-of-roundovers_fig3.png)
|
A smooth roundover, with the value of k set to 0.15. The transition is so gradual that it appears that the roundover is much smaller than specified. The cut length is much smaller for the same joint length.
|
||||||
|
![](https://github.com/BelfrySCAD/BOSL2/wiki/images/rounding/figure_1_4.png)
|
||||||
Parameters of a "smooth" roundover, with k=0.15. The transition is so gradual that it appears that the roundover is much smaller than specified. The cut length is much smaller for the same joint length.
|
|
||||||
|
|
||||||
![](https://github.com/BelfrySCAD/BOSL2/wiki/images/rounding/section-types-of-roundovers_fig4.png)
|
|
||||||
|
|
||||||
The joint parameter is specified separately for the top, bottom and side edges; joint\_top, joint\_bot, and joint_sides.
|
The joint parameter is specified separately for the top, bottom and side edges; joint\_top, joint\_bot, and joint_sides.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue