From 9742177381117150b485b00db1774a5c445b7e43 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Sun, 13 Oct 2024 20:03:00 -0400 Subject: [PATCH 1/3] misc fixes --- attachments.scad | 26 +------------------------- regions.scad | 2 +- shapes2d.scad | 4 +++- 3 files changed, 5 insertions(+), 27 deletions(-) diff --git a/attachments.scad b/attachments.scad index f0ebc8fa..fd5c4171 100644 --- a/attachments.scad +++ b/attachments.scad @@ -908,7 +908,7 @@ function _make_anchor_legal(anchor,geom) = // rmax = is_vector(r) ? r[1] : r; // layers = [for(z=[0:steps]) // let( -// r=rmin+(rmax-rmin)/2*(cos(z*360*cycles/steps)+1),ff=echo(r=r) +// r=rmin+(rmax-rmin)/2*(cos(z*360*cycles/steps)+1), // ) // path3d( concat([[0,0]], // arc(corner=path2d([BACK,CTR,RIGHT]), n=n, r=r)), @@ -3991,29 +3991,6 @@ function _find_anchor(anchor, geom)= ) assert(len(final[1])==2, "invalid!") final, - - - /*[column(facelists,0), column(facelists - - - - - face1 = _vnf_find_edge_faces(vnf,[match1[0],match2[0]]), - face2 = _vnf_find_edge_faces(vnf,[match1[0],match2[1]]), - face1a = _vnf_find_edge_faces(vnf,[match1[1],match2[0]]), - face2a = _vnf_find_edge_faces(vnf,[match1[1],match2[1]]), -feet= echo(facelist1 =select(vnf[1],face1a), facelist2=select(vnf[1],face2a)), - edge1 = [match1[0], face1==[] ? match2[1] : match2[0]], - edge2 = list_remove_values(idxs,edge1), - fee=echo(edxs=idxs, edge1=edge1, edge2=edge2,alt=[match1[1],match2[0]],[match1[1],match2[1]], - edgefaces = _vnf_find_edge_faces(vnf,edge1),_vnf_find_edge_faces(vnf,edge2) ), - face3 = _vnf_find_edge_faces(vnf,edge2), - allfaces = concat(face1,face2,face3), - f=echo(pts=pts,matchind=matchind,match1=match1,match2=match2,face1=face1,face2=face2,face3=face3,edge1=edge1,edge2=edge2,face1a=face1a,face2a=face2a) - ) - assert(len(allfaces)==2, str("Invalid polyhedron encountered while computing VNF anchor",len(allfaces))) - [[edge1,edge2], allfaces],*/ -// fe=echo(edge_faces=edges_faces), dir = len(idxs)>2 && edges_faces==[] ? [anchor,oang] : edges_faces!=[] ? let( @@ -4024,7 +4001,6 @@ feet= echo(facelist1 =select(vnf[1],face1a), faceli projnormals = project_plane(point4d(cross(facenormals[0],facenormals[1])), facenormals), ang = 180- posmod(v_theta(projnormals[1])-v_theta(projnormals[0]),360), horiz_face = [for(i=[0:1]) if (approx(v_abs(facenormals[i]),UP)) i], -fda= echo(horiz=horiz_face), spin = horiz_face==[] ? let( edgedir = edge[1]-edge[0], diff --git a/regions.scad b/regions.scad index dfe2a211..802b6baf 100644 --- a/regions.scad +++ b/regions.scad @@ -817,7 +817,7 @@ function _point_dist(path,pathseg_unit,pathseg_len,pt) = // When `closed=true` (the default), the input is treated as a polygon. If the input is a region it is treated as a collection // of polygons. In this case, positive offset values make the shape larger. If you set `closed=false` then the input is treated as a path // with distinct start and end points. For paths, positive offsets shifts the path to the left, relative to the direction of the path. -// Note that a path that happens to end at its starting point is not the same as a polygon and the offset result may differ. +// Note that a path that happens to end at its starting point is not the same as a polygon and the offset result may differ and the ends. // . // 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 diff --git a/shapes2d.scad b/shapes2d.scad index 465f9afa..45fda070 100644 --- a/shapes2d.scad +++ b/shapes2d.scad @@ -1472,7 +1472,7 @@ function egg(length, r1, r2, R, d1, d2, D, anchor=CENTER, spin=0) = let( r1 = get_radius(r1=r1,d1=d1), r2 = get_radius(r1=r2,d1=d2), - D = get_radius(r1=R, d1=D) + R = get_radius(r1=R, d1=D) ) assert(length>0) assert(R>length/2, "Side radius R must be larger than length/2") @@ -1500,6 +1500,8 @@ function egg(length, r1, r2, R, d1, d2, D, anchor=CENTER, spin=0) = module egg(length,r1,r2,R,d1,d2,D,anchor=CENTER, spin=0) { path = egg(length,r1,r2,R,d1,d2,D); + r1 = get_radius(r1=r1,d1=d1); + r2 = get_radius(r1=r2,d1=d2); anchors = [named_anchor("left", [-length/2+r1,0], BACK, 0), named_anchor("right", [length/2-r2,0], BACK, 0)]; attachable(anchor, spin, two_d=true, path=path, extent=true, anchors=anchors){ From 1114f3f80229037e26289b5b7f8dba05000670e5 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Sun, 13 Oct 2024 20:29:32 -0400 Subject: [PATCH 2/3] remove comma --- attachments.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attachments.scad b/attachments.scad index fd5c4171..795f5c87 100644 --- a/attachments.scad +++ b/attachments.scad @@ -908,7 +908,7 @@ function _make_anchor_legal(anchor,geom) = // rmax = is_vector(r) ? r[1] : r; // layers = [for(z=[0:steps]) // let( -// r=rmin+(rmax-rmin)/2*(cos(z*360*cycles/steps)+1), +// r=rmin+(rmax-rmin)/2*(cos(z*360*cycles/steps)+1) // ) // path3d( concat([[0,0]], // arc(corner=path2d([BACK,CTR,RIGHT]), n=n, r=r)), From c83253c81456cc53232f843304e4b83a4b88f02d Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Mon, 14 Oct 2024 15:56:35 -0400 Subject: [PATCH 3/3] doc tweak --- rounding.scad | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rounding.scad b/rounding.scad index 3b2599d2..be31892c 100644 --- a/rounding.scad +++ b/rounding.scad @@ -2095,9 +2095,9 @@ function _rp_compute_patches(top, bot, rtop, rsides, ktop, ksides, concave) = // top = 2d or 3d path describing top polygon (must be the same dimension as bottom) // --- // height/length/h/l = height of the shape when you give 2d bottom -// joint_top = rounding length for top (number or 2-vector). Default: 0 -// joint_bot = rounding length for bottom (number or 2-vector). Default: 0 -// joint_sides = rounding length for side edges, a number/2-vector or list of them. Default: 0 +// joint_top = joint distance or [joint,k] pair for top roundover (number or 2-vector). Default: 0 +// joint_bot = joint distance or [joint,k] for bottom roundover (number or 2-vector). Default: 0 +// joint_sides = joint distance or [joint,k] for rounding of side edges, a number/2-vector or list of them. Default: 0 // k = continuous curvature rounding parameter for all edges. Default: 0.5 // k_top = continuous curvature rounding parameter for top // k_bot = continuous curvature rounding parameter for bottom