mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
commit
62c07c4823
5 changed files with 146 additions and 69 deletions
|
@ -1204,7 +1204,7 @@ module sp_neck(diam,type,wall,id,style="L",bead=false, anchor, spin, orient)
|
|||
|
||||
extra_bot = type==400 && bead ? -min(column(beadpts,1))+max(isect400) : 0;
|
||||
bead_shift = type==400 ? H+max(isect400) : entry[5]+W/2; // entry[5] is L
|
||||
|
||||
|
||||
attachable(anchor,spin,orient,r=bead ? beadmax : T/2, l=H+extra_bot){
|
||||
up((H+extra_bot)/2){
|
||||
difference(){
|
||||
|
|
|
@ -515,7 +515,7 @@ function _inherit_gear_thickness(thickness,dflt=10) =
|
|||
// with self-locking systems is that if the worm gear moves a large mass and the drive is suddenly shut off, the
|
||||
// worm wheel is still trying to move due to inertia, which can create large loads that fracture the worm.
|
||||
// In such cases, the worm cannot be stopped abruptly but must rotate a little further (called "over travel")
|
||||
// after switching off the drive
|
||||
// after switching off the drive.
|
||||
// Subsection: Bevel Gears
|
||||
// Bevel gearing is another way of dealing with intersecting gear shafts. For bevel gears, the teeth centers lie on
|
||||
// the surface of an imaginary cone, which is the "pitch cone" of the bevel gear. Two bevel gears can mesh when their pitch cone
|
||||
|
@ -3484,7 +3484,7 @@ function _gear_tooth_profile(
|
|||
// sun_ring = set sun/ring ratio to this value in a sun driven system, must have absolute value smaller than 1
|
||||
// helical = create gears with specified helical angle. Default: 0
|
||||
// gear_spin = rotate the driven gear by this number of degrees. Default:0
|
||||
// Example(2D,NoAxes,Anim,Frames=180,VPT=[-0.875705,-0.110537,-66.3877],VPR=[0,0,0],VPD=102,Med): In this example we request a ring/carrier ratio of 1.341 and the system produced has a ratio of 4/3. The sun is fixed, the input is carried by the ring, and the carrier, shown as the blue triangle, is the output, rotating approximately in accordance with the requested ratio.
|
||||
// Example(2D,NoAxes,Anim,Frames=90,FrameMS=30,VPT=[-0.875705,-0.110537,-66.3877],VPR=[0,0,0],VPD=102,Med): In this example we request a ring/carrier ratio of 1.341 and the system produced has a ratio of 4/3. The sun is fixed, the input is carried by the ring, and the carrier, shown as the blue triangle, is the output, rotating approximately in accordance with the requested ratio.
|
||||
// mod=1;
|
||||
// gear_data = planetary_gears(mod=mod, n=3, max_teeth=28, ring_carrier=1.341, gear_spin=4/3*360/3*$t);
|
||||
// ring_gear2d(mod=mod, teeth=gear_data[1][1], profile_shift=gear_data[1][2], gear_spin=gear_data[1][3],backing=2);
|
||||
|
@ -3501,7 +3501,7 @@ function _gear_tooth_profile(
|
|||
// spur_gear2d(mod=mod, teeth=gear_data[0][1], profile_shift=gear_data[0][2], gear_spin=gear_data[0][3]); //sun
|
||||
// color("red")move_copies(gear_data[2][4])
|
||||
// spur_gear2d(mod=mod, teeth=gear_data[2][1], profile_shift=gear_data[2][2], gear_spin=gear_data[2][3][$idx]);
|
||||
// Example(3D,Med,NoAxes,Anim,Frames=5,VPT=[0.128673,0.24149,0.651451],VPR=[38.5,0,21],VPD=222.648): Here we request a sun/ring ratio of 3 and it is exactly achieved. The carrier, shown in blue, is fixed. This example is shown with helical gears. It is important to remember to flip the sign of the helical angle for the planet gears.
|
||||
// Example(3D,Med,NoAxes,Anim,Frames=7,FrameMS=50,VPT=[0.128673,0.24149,0.651451],VPR=[38.5,0,21],VPD=222.648): Here we request a sun/ring ratio of 3 and it is exactly achieved. The carrier, shown in blue, is fixed. This example is shown with helical gears. It is important to remember to flip the sign of the helical angle for the planet gears.
|
||||
// mod=1;
|
||||
// helical=25;
|
||||
// gear_data = planetary_gears(mod=mod, n=4, max_teeth=82, sun_ring=3, helical=helical,gear_spin=360/27*$t);
|
||||
|
|
186
regions.scad
186
regions.scad
|
@ -633,6 +633,14 @@ function region_parts(region) =
|
|||
|
||||
|
||||
function _offset_chamfer(center, points, delta) =
|
||||
is_undef(points[1])?
|
||||
let( points = select(points,[0,2]),
|
||||
center = mean(points),
|
||||
sign = -_tri_class( [points[0],sign(delta)*line_normal(points),points[1]]),
|
||||
startvec = (points[0]-center)/cos(22.5)+center
|
||||
)
|
||||
[for(ang=lerpn(22.5, 157.6,4)) zrot(ang,startvec,cp=center)]
|
||||
:
|
||||
let(
|
||||
dist = sign(delta)*norm(center-line_intersection(select(points,[0,2]), [center, points[1]])),
|
||||
endline = _shift_segment(select(points,[0,2]), delta-dist)
|
||||
|
@ -753,25 +761,41 @@ function _point_dist(path,pathseg_unit,pathseg_len,pt) =
|
|||
// offset() module, you can use `r` to specify rounded offset and `delta` to specify offset with
|
||||
// corners. If you used `delta` you can set `chamfer` to true to get chamfers.
|
||||
// For paths and polygons positive offsets make the polygons larger. For paths,
|
||||
// positive offsets shift the path to the left, relative to the direction of the path. Note
|
||||
// that the path must not include any 180 degree turns, where the path reverses direction.
|
||||
// positive offsets shift the path to the left, relative to the direction of the path.
|
||||
// .
|
||||
// If you use `delta` without chamfers, the path must not include any 180 degree turns, where the path
|
||||
// reverses direction. Such reversals result in an offset with two parallel segments, so they cannot be
|
||||
// extended to an intersection point. If you select chamfering the reversals are permitted and will result
|
||||
// in a single segment connecting the parallel segments. With rounding, a semi-circle will connect the two offset segments.
|
||||
// Note also that repeated points are always illegal in the input; remove them first with {{deduplicate()}}.
|
||||
// .
|
||||
// When offsets shrink the path, segments cross and become invalid. By default `offset()` checks
|
||||
// for this situation. To test validity the code checks that segments have distance larger than (r
|
||||
// or delta) from the input path. This check takes O(N^2) time and may mistakenly eliminate
|
||||
// segments you wanted included in various situations, so you can disable it if you wish by setting
|
||||
// check_valid=false. Another situation is that the test is not sufficiently thorough and some
|
||||
// segments persist that should be eliminated. In this case, increase `quality` to 2 or 3. (This
|
||||
// increases the number of samples on the segment that are checked.) Run time will increase. In
|
||||
// some situations you may be able to decrease run time by setting quality to 0, which causes only
|
||||
// segment ends to be checked.
|
||||
// check_valid=false. When segments are mistakenly removed, you may get the wrong offset output, or you may
|
||||
// get an error, depending on the effect of removing the segment.
|
||||
// The erroneous removal of segments is more common when your input
|
||||
// contains very small segments and in this case can result in an invalid situation where the remaining
|
||||
// valid segments are parallel and cannot be connected to form an offset curve. If this happens, you
|
||||
// will get an error message to this effect. The only solutions are to either remove the small segments with {{deduplicate()}},
|
||||
// or if your path permits it, to set check_valid to false.
|
||||
// .
|
||||
// When invalid segments are eliminated, the path length decreases. If you use chamfering or rounding, then
|
||||
// Another situation that can arise with validity testing is that the test is not sufficiently thorough and some
|
||||
// segments persist that should be eliminated. In this case, increase `quality` from its default of 1 to a value of 2 or 3.
|
||||
// This increases the number of samples on the segment that are checked, so it will increase run time. In
|
||||
// some situations you may be able to decrease run time by setting quality to 0, which causes only
|
||||
// segment ends to be checked.
|
||||
// .
|
||||
// When invalid segments are eliminated, the path length decreases, and multiple points on the input path map to the same point
|
||||
// on the offset path. If you use chamfering or rounding, then
|
||||
// the chamfers and roundings can increase the length of the output path. Hence points in the output may be
|
||||
// difficult to associate with the input. If you want to maintain alignment between the points you
|
||||
// can use the `same_length` option. This option requires that you use `delta=` with `chamfer=false` to ensure
|
||||
// that no points are added. When points collapse to a single point in the offset, the output includes
|
||||
// that point repeated to preserve the correct length.
|
||||
// that no points are added. with `same_length`, when points collapse to a single point in the offset, the output includes
|
||||
// that point repeated to preserve the correct length. Generally repeated points will not appear in the offset output
|
||||
// unless you set `same_length` to true, but in some rare circumstances involving very short segments, it is possible for the
|
||||
// repeated points to occur in the output, even when `same_length=false`.
|
||||
// .
|
||||
// Another way to obtain alignment information is to use the return_faces option, which can
|
||||
// provide alignment information for all offset parameters: it returns a face list which lists faces between
|
||||
|
@ -792,41 +816,73 @@ function _point_dist(path,pathseg_unit,pathseg_len,pt) =
|
|||
// return_faces = return face list. Default: False.
|
||||
// firstface_index = starting index for face list. Default: 0.
|
||||
// flip_faces = flip face direction. Default: false
|
||||
// Example(2D,NoAxes):
|
||||
// Example(2D,NoAxes): Offset the red star out by 10 units.
|
||||
// star = star(5, r=100, ir=30);
|
||||
// #stroke(closed=true, star, width=3);
|
||||
// stroke(closed=true, star, width=3, color="red");
|
||||
// stroke(closed=true, width=3, offset(star, delta=10, closed=true));
|
||||
// Example(2D,NoAxes):
|
||||
// Example(2D,NoAxes): Offset the star with chamfering
|
||||
// star = star(5, r=100, ir=30);
|
||||
// #stroke(closed=true, star, width=3);
|
||||
// stroke(closed=true, star, width=3, color="red");
|
||||
// stroke(closed=true, width=3,
|
||||
// offset(star, delta=10, chamfer=true, closed=true));
|
||||
// Example(2D,NoAxes):
|
||||
// Example(2D,NoAxes): Offset the star with rounding
|
||||
// star = star(5, r=100, ir=30);
|
||||
// #stroke(closed=true, star, width=3);
|
||||
// stroke(closed=true, star, width=3, color="red");
|
||||
// stroke(closed=true, width=3,
|
||||
// offset(star, r=10, closed=true));
|
||||
// Example(2D,NoAxes):
|
||||
// Example(2D,NoAxes): Offset inward
|
||||
// star = star(7, r=120, ir=50);
|
||||
// #stroke(closed=true, width=3, star);
|
||||
// stroke(closed=true, width=3, star, color="red");
|
||||
// stroke(closed=true, width=3,
|
||||
// offset(star, delta=-15, closed=true));
|
||||
// Example(2D,NoAxes):
|
||||
// Example(2D,NoAxes): Inward offset with chamfers
|
||||
// star = star(7, r=120, ir=50);
|
||||
// #stroke(closed=true, width=3, star);
|
||||
// stroke(closed=true, width=3, star, color="red");
|
||||
// stroke(closed=true, width=3,
|
||||
// offset(star, delta=-15, chamfer=true, closed=true));
|
||||
// Example(2D,NoAxes):
|
||||
// Example(2D,NoAxes): Inward offset with rounding
|
||||
// star = star(7, r=120, ir=50);
|
||||
// #stroke(closed=true, width=3, star);
|
||||
// stroke(closed=true, width=3, star, color="red");
|
||||
// stroke(closed=true, width=3,
|
||||
// offset(star, r=-15, closed=true, $fn=20));
|
||||
// Example(2D,NoAxes): This case needs `quality=2` for success
|
||||
// Example(2D): Open path. The path moves from left to right and the positive offset shifts to the left of the initial red path.
|
||||
// sinpath = 2*[for(theta=[-180:5:180]) [theta/4,45*sin(theta)]];
|
||||
// stroke(sinpath, width=2, color="red");
|
||||
// stroke(offset(sinpath, r=17.5),width=2);
|
||||
// Example(2D,NoAxes): Offsetting a line segment with closed=false on the left, chamfered with closed=true in the center, and rounded on the right. When the path turns back on itself, chamfering produces a simple flat end and rounding produces a semicircle. This offset is invalid in the closed case with delta offsetting and chamfer=false.
|
||||
// seg = [[0,0],[0,50]];
|
||||
// stroke(seg,color="red");
|
||||
// stroke(offset(seg,r=15,closed=false));
|
||||
// right(30){
|
||||
// stroke(seg,color="red");
|
||||
// stroke([offset(seg,delta=15,chamfer=true,closed=true)]);
|
||||
// }
|
||||
// right(80){
|
||||
// stroke(seg,color="red");
|
||||
// stroke([offset(seg,r=15,closed=true)]);
|
||||
// }
|
||||
// Example(2D,NoAxes): A more complex example where the path turns back on itself several times.
|
||||
// $fn=32;
|
||||
// path = [
|
||||
// [0,0], [5,5],
|
||||
// [10,0],[5,5],
|
||||
// [11,8],[5,5],
|
||||
// [5,10],[5,5],
|
||||
// [-1,4],[5,5]
|
||||
// ];
|
||||
// op=offset(path, r=1.5,chamfer=true,closed=true);
|
||||
// stroke([op],width=.1);
|
||||
// Example(2D,NoAxes): This case produces an incorrect result because the offset edge corresponding to the long left edge (shown in green) is erroneously flagged as invalid. If you use `delta=` instead of `r=` with this example, it will fail with an error.
|
||||
// test = [[0,0],[10,0],[10,7],[0,7], [-1,-3]];
|
||||
// polygon(offset(test,r=-1.9, closed=true));
|
||||
// //polygon(offset(test,delta=-1.9, closed=true)); // Fails with erroneous 180 deg path error
|
||||
// stroke([test],width=.1,color="red");
|
||||
// stroke(select(test,-2,-1), width=.1, color="green");
|
||||
// Example(2D,NoAxes): Using `quality=2` produces the correct result
|
||||
// test = [[0,0],[10,0],[10,7],[0,7], [-1,-3]];
|
||||
// polygon(offset(test,r=-1.9, closed=true, quality=2));
|
||||
// //polygon(offset(test,r=-1.9, closed=true, quality=1)); // Fails with erroneous 180 deg path error
|
||||
// %down(.1)polygon(test);
|
||||
// Example(2D,NoAxes): This case fails if `check_valid=true` when delta is large enough because segments are too close to the opposite side of the curve.
|
||||
// stroke([test],width=.1,color="red");
|
||||
// Example(2D,NoAxes): This case fails if `check_valid=true` when delta is large enough because segments are too close to the opposite side of the curve so they all get flagged as invalid and deleted from the output.
|
||||
// star = star(5, r=22, ir=13);
|
||||
// stroke(star,width=.3,closed=true);
|
||||
// color("green")
|
||||
|
@ -850,15 +906,11 @@ function _point_dist(path,pathseg_unit,pathseg_len,pt) =
|
|||
// stroke(ellipse, closed=true, width=0.3);
|
||||
// stroke(offset(ellipse, r=-3, check_valid=true, closed=true),
|
||||
// width=0.3, closed=true);
|
||||
// Example(2D): Open path. The path moves from left to right and the positive offset shifts to the left of the initial red path.
|
||||
// sinpath = 2*[for(theta=[-180:5:180]) [theta/4,45*sin(theta)]];
|
||||
// #stroke(sinpath, width=2);
|
||||
// stroke(offset(sinpath, r=17.5),width=2);
|
||||
// Example(2D,NoAxes): Region
|
||||
// Example(2D,NoAxes): The region shown in red has the yellow offset region.
|
||||
// rgn = difference(circle(d=100),
|
||||
// union(square([20,40], center=true),
|
||||
// square([40,20], center=true)));
|
||||
// #linear_extrude(height=1.1) stroke(rgn, width=1);
|
||||
// stroke(rgn, width=1, color="red");
|
||||
// region(offset(rgn, r=-5));
|
||||
// Example(2D,NoAxes): Using `same_length=true` to align the original curve to the offset. Note that lots of points map to the corner at the top.
|
||||
// closed=false;
|
||||
|
@ -880,7 +932,7 @@ function offset(
|
|||
let(
|
||||
ofsregs = [for(R=region_parts(path))
|
||||
difference([for(i=idx(R)) offset(R[i], r=u_mul(i>0?-1:1,r), delta=u_mul(i>0?-1:1,delta),
|
||||
chamfer=chamfer, check_valid=check_valid, quality=quality,closed=true)])]
|
||||
chamfer=chamfer, check_valid=check_valid, quality=quality,same_length=same_length,closed=true)])]
|
||||
)
|
||||
union(ofsregs)
|
||||
:
|
||||
|
@ -896,13 +948,13 @@ function offset(
|
|||
)
|
||||
d==0 && !return_faces ? path :
|
||||
let(
|
||||
// shiftsegs = [for(i=[0:len(path)-1]) _shift_segment(select(path,i,i+1), d)],
|
||||
shiftsegs = [for(i=[0:len(path)-2]) _shift_segment([path[i],path[i+1]], d),
|
||||
if (closed) _shift_segment([last(path),path[0]],d)
|
||||
else [path[0],path[1]] // dummy segment, not used
|
||||
],
|
||||
// good segments are ones where no point on the segment is less than distance d from any point on the path
|
||||
good = check_valid ? _good_segments(path, abs(d), shiftsegs, closed, quality) : repeat(true,len(shiftsegs)),
|
||||
good = check_valid ? _good_segments(path, abs(d), shiftsegs, closed, quality)
|
||||
: repeat(true,len(shiftsegs)),
|
||||
goodsegs = bselect(shiftsegs, good),
|
||||
goodpath = bselect(path,good)
|
||||
)
|
||||
|
@ -912,22 +964,29 @@ function offset(
|
|||
sharpcorners = [for(i=[0:len(goodsegs)-1]) _segment_extension(select(goodsegs,i-1), select(goodsegs,i))],
|
||||
// If some segments are parallel then the extended segments are undefined. This case is not handled
|
||||
// Note if !closed the last corner doesn't matter, so exclude it
|
||||
parallelcheck =
|
||||
(len(sharpcorners)==2 && !closed) ||
|
||||
all_defined(closed? sharpcorners : select(sharpcorners, 1,-2))
|
||||
)
|
||||
assert(parallelcheck, "Path contains a segment that reverses direction (180 deg turn)")
|
||||
let(
|
||||
|
||||
// true if sharpcorner is defined or if the corner has a reversal; false if corner has two parallel
|
||||
// segments going in the same direction
|
||||
cornercheck = [for(i=idx(goodsegs)) (!closed && (i==0 || i==len(goodsegs)-1))
|
||||
|| is_def(sharpcorners[i])
|
||||
|| approx(unit(deltas(select(goodsegs,i-1))[0]) * unit(deltas(goodsegs[i])[0]),-1)],
|
||||
dummyA = assert(len(sharpcorners)==2 || all(cornercheck),"Two consecutive valid offset segments are parallel but do not meet at their ends, maybe because path contains very short segments that were mistakenly flagged as invalid; unable to compute offset"),
|
||||
reversecheck =
|
||||
!(is_def(delta) && !chamfer) // Reversals only a problem in delta mode without chamfers
|
||||
|| (len(sharpcorners)==2 && !closed)
|
||||
|| all_defined(closed? sharpcorners : select(sharpcorners, 1,-2)),
|
||||
dummyB = assert(reversecheck, "Either validity check failed and removed a valid segment or the input 'path' contains a segment that reverses direction (180 deg turn), which is only allowed with r= or chamfer=true"),
|
||||
// This is a Boolean array that indicates whether a corner is an outside or inside corner
|
||||
// For outside corners, the newcorner is an extension (angle 0), for inside corners, it turns backward
|
||||
// If either side turns back it is an inside corner---must check both.
|
||||
// Outside corners can get rounded (if r is specified and there is space to round them)
|
||||
outsidecorner = len(sharpcorners)==2 ? [false,false]
|
||||
outsidecorner = len(sharpcorners)==2 ? [closed,closed]
|
||||
:
|
||||
[for(i=[0:len(goodsegs)-1])
|
||||
let(prevseg=select(goodsegs,i-1))
|
||||
(i==0 || i==len(goodsegs)-1) && !closed ? false // In open case first entry is bogus
|
||||
:
|
||||
:is_undef(sharpcorners[i]) ? true
|
||||
:
|
||||
(goodsegs[i][1]-goodsegs[i][0]) * (goodsegs[i][0]-sharpcorners[i]) > 0
|
||||
&& (prevseg[1]-prevseg[0]) * (sharpcorners[i]-prevseg[1]) > 0
|
||||
],
|
||||
|
@ -947,26 +1006,37 @@ function offset(
|
|||
// Otherwise it's the same as sharpcorners
|
||||
// If rounding is on then newcorners[i] will be the point list that replaces goodpath[i] and newcorners later
|
||||
// gets flattened. If rounding is off then we set it to [sharpcorners] so we can later flatten it and get
|
||||
// plain sharpcorners back.
|
||||
newcorners = is_def(delta) && !chamfer ? [sharpcorners]
|
||||
: [for(i=[0:len(goodsegs)-1])
|
||||
// plain sharpcorners back. If path is open then first and last entries in newcorners are ignored
|
||||
newcorners =
|
||||
is_def(delta) && !chamfer
|
||||
? [sharpcorners]
|
||||
: [for(i=[0:len(goodsegs)-1])
|
||||
let(
|
||||
basepts = [
|
||||
select(goodsegs,i-1)[1],
|
||||
goodsegs[i][0]
|
||||
]
|
||||
)
|
||||
(!chamfer && steps[i] <=1) // Don't round if steps is smaller than 2
|
||||
|| !outsidecorner[i] // Don't round inside corners
|
||||
|| (!closed && (i==0 || i==len(goodsegs)-1)) // Don't round ends of an open path
|
||||
? [sharpcorners[i]]
|
||||
|| !outsidecorner[i] // Don't round inside corners
|
||||
|| (!closed && (i==0 || i==len(goodsegs)-1)) // Don't round ends of an open path
|
||||
? (is_def(sharpcorners[i] || (!closed && (i==0 || i==len(goodsegs)-1)))
|
||||
? [sharpcorners[i]] : basepts)
|
||||
: chamfer ? _offset_chamfer(
|
||||
goodpath[i], [
|
||||
select(goodsegs,i-1)[1],
|
||||
sharpcorners[i],
|
||||
goodsegs[i][0]
|
||||
], d
|
||||
)
|
||||
)
|
||||
: // rounded case
|
||||
arc(cp=goodpath[i],
|
||||
points=[
|
||||
select(goodsegs,i-1)[1],
|
||||
goodsegs[i][0]
|
||||
],
|
||||
let(
|
||||
class =_tri_class( [ each select(goodsegs,i-1), goodsegs[i][0]]),
|
||||
cw = class==1,
|
||||
ccw = class==-1
|
||||
)
|
||||
arc(cp=goodpath[i], cw=cw, ccw=ccw,
|
||||
points=basepts,
|
||||
n=steps[i])
|
||||
],
|
||||
pointcount = (is_def(delta) && !chamfer)?
|
||||
|
@ -982,7 +1052,11 @@ function offset(
|
|||
flip_faces, firstface_index, good,
|
||||
pointcount, closed
|
||||
),
|
||||
final_edges = same_length ? select(edges, [0,each list_head (cumsum([for(g=good) g?1:0]))])
|
||||
final_edges = same_length ? select(edges,
|
||||
[0,
|
||||
each list_head(cumsum([for(g=good) g?1:0]))
|
||||
]
|
||||
)
|
||||
: edges
|
||||
) return_faces? [edges,faces] : final_edges;
|
||||
|
||||
|
|
|
@ -1082,7 +1082,7 @@ module rotate_sweep(
|
|||
// If turns is positive the path will be right-handed; if turns is negative the path will be left-handed.
|
||||
// Such an extrusion can be used to make screw threads.
|
||||
// .
|
||||
// The lead_in options specify a lead-in setiton where the ends of the spiral scale down to avoid a sharp cut face at the ends.
|
||||
// The lead_in options specify a lead-in section where the ends of the spiral scale down to avoid a sharp cut face at the ends.
|
||||
// You can specify the length of this scaling directly with the lead_in parameters or as an angle using the lead_in_ang parameters.
|
||||
// If you give a positive value, the extrusion is lengthenend by the specified distance or angle; if you give a negative
|
||||
// value then the scaled end is included in the extrusion length specified by `turns`. If the value is zero then no scaled ends
|
||||
|
|
|
@ -2011,7 +2011,8 @@ module _nutshape(nutwidth, h, shape, bevel1, bevel2)
|
|||
// Topics: Threading, Screws
|
||||
// See Also: generic_threaded_rod()
|
||||
// Usage:
|
||||
// thread_helix(d, pitch, [thread_depth], [flank_angle], [turns], [profile=], [left_handed=], [higbee=], [internal=]);
|
||||
// thread_helix(d, pitch, turns=, [thread_depth=], [thread_angle=|flank_angle=], [profile=], [starts=], [internal=], ...) {ATTACHMENTS};
|
||||
// thread_helix(d1=,d2=, pitch=, turns=, [thread_depth=], [thread_angle=|flank_angle=], [profile=], [starts=], [internal=], ...) {ATTACHMENTS};
|
||||
// Description:
|
||||
// Creates a right-handed helical thread with optional end tapering. Unlike
|
||||
// {{generic_threaded_rod()}, this module just generates the thread, and you specify the total
|
||||
|
@ -2036,9 +2037,12 @@ module _nutshape(nutwidth, h, shape, bevel1, bevel2)
|
|||
// unlike the threaded_rod modules, thread_helix does not adjust the diameter for faceting, nor does it
|
||||
// subtract any $slop for clearance.
|
||||
// .
|
||||
// The taper options specify tapering at of the threads at each end, and is given as the linear distance
|
||||
// over which to taper. If taper is positive the threads are lengthened by the specified distance; if taper
|
||||
// is negative, the taper is included in the thread length specified by `turns`. Tapering works on both internal and external threads.
|
||||
// The lead_in options specify a lead-in section where the ends of the threads scale down to avoid a sharp face at the thread ends.
|
||||
// You can specify the length of this scaling directly with the lead_in parameters or as an angle using the lead_in_ang parameters.
|
||||
// If you give a positive value, the extrusion is lengthenend by the specified distance or angle; if you give a negative
|
||||
// value then the scaled end is included in the extrusion length specified by `turns`. If the value is zero then no scaled ends
|
||||
// are produced. The shape of the scaled ends can be controlled with the lead_in_shape parameter. Supported options are "sqrt", "linear"
|
||||
// "smooth" and "cut". Lead-in works on both internal and external threads.
|
||||
// Figure(2D,Med,NoAxes):
|
||||
// pa_delta = tan(15)/4;
|
||||
// rr1 = -1/2;
|
||||
|
@ -2091,24 +2095,23 @@ module _nutshape(nutwidth, h, shape, bevel1, bevel2)
|
|||
// d = Base diameter of threads. Default: 10
|
||||
// pitch = Distance between threads. Default: 2
|
||||
// ---
|
||||
// turns = Number of revolutions to rotate thread around.
|
||||
// thread_depth = Depth of threads from top to bottom.
|
||||
// flank_angle = Angle of thread faces to plane perpendicular to screw. Default: 15 degrees.
|
||||
// turns = Number of revolutions to rotate thread around.
|
||||
// thread_angle = Angle between two thread faces.
|
||||
// profile = If an asymmetrical thread profile is needed, it can be specified here.
|
||||
// starts = The number of thread starts. Default: 1
|
||||
// left_handed = If true, thread has a left-handed winding.
|
||||
// internal = if true make internal threads. The only effect this has is to change how the threads taper if tapering is selected. When true, threads taper towards the outside; when false, they taper towards the inside. Default: false
|
||||
// internal = if true make internal threads. The only effect this has is to change how the thread lead_in is constructed. When true, the lead-in section tapers towards the outside; when false, it tapers towards the inside. Default: false
|
||||
// d1 = Bottom inside base diameter of threads.
|
||||
// d2 = Top inside base diameter of threads.
|
||||
// thread_angle = Angle between
|
||||
// lead_in = Specify linear length of the lead in section of the threading with blunt start threads
|
||||
// lead_in1 = Specify linear length of the lead in section of the threading at the bottom with blunt start threads
|
||||
// lead_in2 = Specify linear length of the lead in section of the threading at the top with blunt start threads
|
||||
// lead_in_ang = Specify angular length in degrees of the lead in section of the threading with blunt start threads
|
||||
// lead_in_ang1 = Specify angular length in degrees of the lead in section of the threading at the bottom with blunt start threads
|
||||
// lead_in_ang2 = Specify angular length in degrees of the lead in section of the threading at the top with blunt start threads
|
||||
// lead_in_shape = Specify the shape of the thread lead in by giving a text string or function. Default: "default"
|
||||
// lead_in_shape = Specify the shape of the thread lead in by giving a text string or function. Default: "sqrt"
|
||||
// lead_in_sample = Factor to increase sample rate in the lead-in section. Default: 10
|
||||
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER`
|
||||
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0`
|
||||
|
|
Loading…
Reference in a new issue