From 6a2fbf99ae4bab9b4e13ce383db15af5a35eec81 Mon Sep 17 00:00:00 2001 From: Alex Matulich Date: Mon, 14 Apr 2025 23:35:52 -0700 Subject: [PATCH] minor example corrections --- beziers.scad | 4 ++-- vnf.scad | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/beziers.scad b/beziers.scad index 03a3f82b..f07dfc37 100644 --- a/beziers.scad +++ b/beziers.scad @@ -1595,7 +1595,7 @@ function bezier_patch_normals(patch, u, v) = // splinesteps = Number of segments on the border edges of the bezier surface. You can specify [USTEPS,VSTEPS]. Default: 16 // balanced = if true, then offset the bezier surface by half the specified thickness on each side. This increases execution time because two offsets must be performed. The sign of `thickness` does not matter. Default: false // style = {{vnf_vertex_array()}} style to use. Default: "default" -// Example(3D): Because the "inside" of this bezier patch is on the underside of this view, a positive thickness extends downward from that side of the surface. +// Example(3D): In this case, a positive thickness extends downward from that side of the surface. // patch = [ // // u=0,v=0 u=1,v=0 // [[-50,-50, 0], [-16,-50, 20], [ 16,-50, -20], [50,-50, 0]], @@ -1615,7 +1615,7 @@ function bezier_patch_normals(patch, u, v) = // // u=0,v=1 u=1,v=1 // ]; // vnf_polyhedron(bezier_vnf(patch)); -// vnf_polyhedron(bezier_sheet(patch, 10, balanced=true)); +// %vnf_polyhedron(bezier_sheet(patch, 10, balanced=true)); function bezier_sheet(patch, thickness, splinesteps=16, style="default", balanced=false) = assert(is_bezier_patch(patch)) diff --git a/vnf.scad b/vnf.scad index 161186c6..c1f5be95 100644 --- a/vnf.scad +++ b/vnf.scad @@ -206,7 +206,7 @@ EMPTY_VNF = [[],[]]; // The standard empty VNF with no vertices or faces. // apply(m, [ [rgroove[0].x,0,-z], each rgroove, [last(rgroove).x,0,-z] ]) // ], caps=true, col_wrap=true, reverse=true); // vnf_polyhedron(vnf, convexity=8); -// Example(3D,Med,NoAxes,VPD=300): When applying a texture to a vertex array, remember that the density of the texture follows the density of the vertex array grid. Here is a sheet with a wrinkle in both x and y directions, using location data generated by {{smooth_path()}}. The bezier curves have non-uniformly distributed spline points, indicated by the red dots along each edge. This results in a non-uniform distribution of the texture tiling. +// Example(3D,Med,NoAxes,VPD=300,VPT=[48,48,0]): When applying a texture to a vertex array, remember that the density of the texture follows the density of the vertex array grid. Here is a sheet with a wrinkle in both x and y directions, using location data generated by {{smooth_path()}}. The bezier curves have non-uniformly distributed spline points, indicated by the red dots along each edge. This results in a non-uniform distribution of the texture tiling. // include // // xprofile = smooth_path([[0,0,0], [25,0,0], [49,0,-10], [51,0,10], [75,0,0], [100,0,0]], @@ -223,7 +223,7 @@ EMPTY_VNF = [[],[]]; // The standard empty VNF with no vertices or faces. // for(p=xprofile) translate(p-[0,1,0]) sphere(1.5); // for(p=yprofile) translate(p-[1,0,0]) sphere(1.5); // } -// Example(3D,Med,NoAxes,VPD=300): By passing the spline curves into {{resample_path()}}, we can get a uniform distribution of the same number of x and y profile points, as shown by the red dots. This results in a uniform distribution of the texture tiling. +// Example(3D,Med,NoAxes,VPD=300,VPT=[48,48,0]): By passing the spline curves into {{resample_path()}}, we can get a uniform distribution of the same number of x and y profile points, as shown by the red dots. This results in a uniform distribution of the texture tiling. // include // // xprof = smooth_path([[0,0,0], [25,0,0], [49,0,-10], [51,0,10], [75,0,0], [100,0,0]], @@ -242,7 +242,7 @@ EMPTY_VNF = [[],[]]; // The standard empty VNF with no vertices or faces. // for(p=xprofile) translate(p-[0,4,0]) sphere(1.5); // for(p=yprofile) translate(p-[4,0,0]) sphere(1.5); // } -// Example(3D,NoAxes,VPR=[66,0,24],VPD=285,VPT=[0,2,44]): This is a vase shape that cannot be constructed with rotational or linear sweeps. Using a vertex array to create a stack of polygons is the most practical way to make this and many other shapes. The cross-section is a rounded 9-pointed star that changes size and rotates back and forth as it rises in the z direction. +// Example(3D,NoAxes,VPR=[73,0,27],VPD=260,VPT=[0,0,42]): This is a vase shape that cannot be constructed with rotational or linear sweeps. Using a vertex array to create a stack of polygons is the most practical way to make this and many other shapes. The cross-section is a rounded 9-pointed star that changes size and rotates back and forth as it rises in the z direction. // include // // vprofile = @@ -259,7 +259,7 @@ EMPTY_VNF = [[],[]]; // The standard empty VNF with no vertices or faces. // z) // ]; // vnf_polyhedron(vnf_vertex_array(polystack, col_wrap=true, caps=true)); -// Example(3D,NoAxes,VPR=[66,0,24],VPD=285,VPT=[0,2,44]): The previous vase shape with a pebbly texture, simply by adding `texture="dots"` to the `vnf_vertex_array()` call. Because textures are spread over grid units and not measurement units, the data points in the polygon stack should be more or less uniformly spaced. Each star-shaped cross-section has uniformly-spaced points, but the vertical profile `vprofile` in the previous example isn't uniform because the control points aren't evenly spaced. We fix this by passing this profile into `resample_path()`, which results in a uniform texture density. +// Example(3D,NoAxes,VPR=[73,0,27],VPD=260,VPT=[0,0,42]): The previous vase shape with a pebbly texture, simply by adding `texture="dots"` to the `vnf_vertex_array()` call. Because textures are spread over grid units and not measurement units, the data points in the polygon stack should be more or less uniformly spaced. Each star-shaped cross-section has uniformly-spaced points, but the vertical profile `vprofile` in the previous example isn't uniform because the control points aren't evenly spaced. We fix this by passing this profile into `resample_path()`, which results in a uniform texture density. // include // // vprofile = resample_path(