Compare commits

...

6 commits

Author SHA1 Message Date
Christopher Hotchkiss
a70dbbf6e2
Merge 3872625412 into 328e1f0a9a 2024-10-28 01:23:22 -07:00
Revar Desmera
328e1f0a9a
Merge pull request #1494 from RAMilewski/master
Fix missing diagrams in Rounding the Cube Tutorial
2024-10-28 01:20:50 -07:00
Richard Milewski
569e1a0e84 Merge branch 'master' of https://github.com/RAMilewski/BOSL2 2024-10-27 11:57:32 -07:00
Richard Milewski
4291acc27d Update Rounding_the_Cube.md
Fix missing roundover images
2024-10-27 11:57:17 -07:00
Christopher Hotchkiss
3872625412 Reverted my first edit and added an example to detail the nuance 2024-10-10 19:08:11 -07:00
Christopher Hotchkiss
ed525909d3
Update attachments.scad, fix tag_scope example
tag_scope only works if its used inside attachable which is the opposite of the documentation example
2024-10-02 16:35:14 -07:00
2 changed files with 56 additions and 8 deletions

View file

@ -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.
// Side Effects:
// `$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)
// {
// tag_scope("ringscope")
@ -1279,6 +1279,56 @@ module default_tag(tag,do_tag=true)
// 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){
req_children($children);
scope = is_undef(scope) ? rand_str(20) : scope;

View file

@ -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.
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)
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)
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)
The joint parameter is specified separately for the top, bottom and side edges; joint\_top, joint\_bot, and joint_sides.