From 84d2e3d417eaed49f65deeb7fa8b9f7580d9e5c2 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Sun, 15 Jan 2023 09:25:38 -0500 Subject: [PATCH] Add linear_sweep examples with disconnected texture ends and show fix --- skin.scad | 65 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 16 deletions(-) diff --git a/skin.scad b/skin.scad index 2310d7b..5e0d17d 100644 --- a/skin.scad +++ b/skin.scad @@ -625,28 +625,61 @@ function skin(profiles, slices, refine=1, method="direct", sampling, caps, close // ] // ]; // linear_sweep(path, texture=tex, tex_size=[5,5], h=40); -// Example: VNF tile that has no top/bottom edges and produces a disconnected result -// shape = skin([ -// rect(2/5), -// rect(2/3), -// rect(2/5) -// ], -// z=[0,1/2,1], -// slices=0, -// caps=false); -// tile = move([0,1/2,2/3],yrot(90,shape)); -// linear_sweep( -// circle(20), texture=tile, -// tex_size=[10,10],tex_scale=5, -// h=40,convexity=4); - - // Example: As Function // path = glued_circles(r=15, spread=40, tangent=45); // vnf = linear_sweep( // path, h=40, texture="trunc_pyramids", tex_size=[5,5], // tex_scale=1, style="convex"); // vnf_polyhedron(vnf, convexity=10); +// Example: VNF tile that has no top/bottom edges and produces a disconnected result +// shape = skin([rect(2/5), +// rect(2/3), +// rect(2/5)], +// z=[0,1/2,1], +// slices=0, +// caps=false); +// tile = move([0,1/2,2/3],yrot(90,shape)); +// linear_sweep(circle(20), texture=tile, +// tex_size=[10,10],tex_scale=5, +// h=40,convexity=4); +// Example: The same tile from above, turned 90 degrees, creates problems at the ends, because the end cap is not a connected polygon. When the ends are disconnected you may find that some parts of the end cap are missing and spurious polygons included. +// shape = skin([rect(2/5), +// rect(2/3), +// rect(2/5)], +// z=[0,1/2,1], +// slices=0, +// caps=false); +// tile = move([1/2,1,2/3],xrot(90,shape)); +// linear_sweep(circle(20), texture=tile, +// tex_size=[30,20],tex_scale=15, +// h=40,convexity=4); +// Example: This example shoes some endcap polygons missing and a spurious triangle +// shape = skin([rect(2/5), +// rect(2/3), +// rect(2/5)], +// z=[0,1/2,1], +// slices=0, +// caps=false); +// tile = xscale(.5,move([1/2,1,2/3],xrot(90,shape))); +// doubletile = vnf_join([tile, right(.5,tile)]); +// linear_sweep(circle(20), texture=doubletile, +// tex_size=[45,45],tex_scale=15, h=40); +// Example: You can fix ends for disconnected cases using {{top_half()}} and {{bottom_half()}} +// shape = skin([rect(2/5), +// rect(2/3), +// rect(2/5)], +// z=[0,1/2,1], +// slices=0, +// caps=false); +// tile = move([1/2,1,2/3],xrot(90,shape)); +// vnf_polyhedron( +// top_half( +// bottom_half( +// linear_sweep(circle(20), texture=tile, +// tex_size=[30,20],tex_scale=15, +// h=40.2,caps=false), +// z=20), +// z=-20)); module linear_sweep( region, height, center,