Here's a module that takes a slice of one side of a cylinder.
Two questions:
1. I'm just getting started with composing things in modules. Is
the approach reasonable, or is there a better way to chop off
the unused part of the cylinder?
2. This module specifies the radius and a percentage of the circle
to keep. I would rather specify:
- thickness (as is now)
- length of chord
- distance from chord to edge of cylinder
If someone could give me a clue as to deriving the location and
radius of the cylinder from the chord length and height, I would
appreciate it!
module arc(thick, rad, percent) {
translate([thick/2,0,-rad+(2*rad*percent)]) {
rotate([0,-90,0]) {
intersection() {
translate([2*rad*(1.0-percent),0,0])
cube([2*rad,2*rad,thick], center=true);
cylinder(thick, r=rad, center=true);
}
}
}
}
arc(5, 40, .1);
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org