From a1ed8a5d1765be52445d008e39e24f0823fe6f04 Mon Sep 17 00:00:00 2001 From: Adrian Mariano <avm4@cornell.edu> Date: Sat, 25 Jan 2025 09:44:32 -0500 Subject: [PATCH 1/2] add notes about bezier paths --- beziers.scad | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/beziers.scad b/beziers.scad index 9a27a41..01b38f5 100644 --- a/beziers.scad +++ b/beziers.scad @@ -42,6 +42,9 @@ // and intermediate values of `u` fill in the curve in a non-uniform fashion. This function uses an optimized method which // is best when `u` is a long list and the bezier degree is 10 or less. The degree of the bezier // curve is `len(bezier)-1`. +// . +// Note that if you have a bezier **path** (see below) then you should use {{bezpath_points()}} to +// evaluate the points on that bezier path. This function is for a single bezier. // Arguments: // bezier = The list of endpoints and control points for this bezier curve. // u = Parameter values for evaluating the curve, given as a single value, a list or a range. @@ -194,6 +197,9 @@ function _bezier_matrix(N) = // of the bezier curve, but you still get the same number of (more tightly spaced) points. // The distance between the points will *not* be equidistant. // The degree of the bezier curve is one less than the number of points in `curve`. +// . +// Note that if you have a bezier **path** (see below) then you should use {{bezpath_curve()}} to +// evaluate the that bezier path. This function is for a single bezier. // Arguments: // bezier = The list of control points that define the Bezier curve. // splinesteps = The number of segments to create on the bezier curve. Default: 16 From 5c42891c39ed63ba9ac7954b5b7b9a605bfe4544 Mon Sep 17 00:00:00 2001 From: Adrian Mariano <avm4@cornell.edu> Date: Sun, 26 Jan 2025 12:38:40 -0500 Subject: [PATCH 2/2] triangulate in vnf_bend to avoid non-coplanar faces output --- vnf.scad | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vnf.scad b/vnf.scad index 9812cad..555eef5 100644 --- a/vnf.scad +++ b/vnf.scad @@ -1677,7 +1677,7 @@ function vnf_bend(vnf,r,d,axis="Z") = step = (extent[1]-extent[0]) / steps, bend_at = [for(i = [1:1:steps-1]) i*step+extent[0]], slicedir = axis=="X"? "Y" : "X", // slice in y dir for X axis case, and x dir otherwise - sliced = vnf_slice(vnf, slicedir, bend_at), + sliced = vnf_triangulate(vnf_slice(vnf, slicedir, bend_at)), coord = axis=="X" ? [0,sign(bmax.z),0] : axis=="Y" ? [sign(bmax.z),0,0] : [sign(bmax.y),0,0], new_vert = [for(p=sliced[0]) let(a=coord*p*180/(PI*r))