Here's a module that takes a slice of one side of a cylinder.
Two questions:
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?
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+(2radpercent)]) {
rotate([0,-90,0]) {
intersection() {
translate([2rad(1.0-percent),0,0])
cube([2rad,2rad,thick], center=true);
cylinder(thick, r=rad, center=true);
}
}
}
}
arc(5, 40, .1);
When you speak of the chord of a cylinder, I hope you mean the chord of a
circle created by a perpendicular slice of the cylinder. If you add in the
angle of the slice, the math goes way out of control.
On that note, there's a series of answers located here:
Various methods to calculate circle radius
https://math.stackexchange.com/questions/564058/calculate-the-radius-of-a-circle-given-the-chord-length-and-height-of-a-segment
If the multitude of answers presented in math.stackexchange.com doesn't work
for you, give this one a try:
More options for chord calculations http://bfy.tw/CrMl
--
View this message in context: http://forum.openscad.org/specifying-a-section-of-a-cylinder-tp21827p21828.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Your approach is quite standard. To find the radius, see:
https://softsolder.com/2013/08/02/making-finger-grip-dents-the-chord-equation/
--
View this message in context: http://forum.openscad.org/specifying-a-section-of-a-cylinder-tp21827p21831.html
Sent from the OpenSCAD mailing list archive at Nabble.com.