mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2024-12-29 16:29:40 +00:00
Adjusted skin() docs and example images.
This commit is contained in:
parent
ed205d713f
commit
c533dfe315
2 changed files with 47 additions and 47 deletions
36
skin.scad
36
skin.scad
|
@ -13,7 +13,7 @@
|
|||
include <vnf.scad>
|
||||
|
||||
// Section: Skinning
|
||||
//
|
||||
|
||||
// Function&Module: skin()
|
||||
// Usage: As module:
|
||||
// skin(profiles, [slices], [refine], [method], [sampling], [caps], [closed], [z]);
|
||||
|
@ -117,13 +117,13 @@ include <vnf.scad>
|
|||
// caps = true to create endcap faces when closed is false. Can be a length 2 boolean array. Default is true if closed is false.
|
||||
// method = method for connecting profiles, one of "distance", "tangent", "direct" or "reindex". Default: "direct".
|
||||
// z = array of height values for each profile if the profiles are 2d
|
||||
// Example(FlatSpin):
|
||||
// Example:
|
||||
// skin([octagon(4), regular_ngon(n=70,r=2)], z=[0,3], slices=10);
|
||||
// Example(FlatSpin): The circle() and pentagon() modules place the zero index at different locations, giving a twist
|
||||
// Example: The circle() and pentagon() modules place the zero index at different locations, giving a twist
|
||||
// skin([pentagon(4), circle($fn=80,r=2)], z=[0,3], slices=10);
|
||||
// Example(FlatSpin): You can untwist it with the "reindex" method
|
||||
// Example: You can untwist it with the "reindex" method
|
||||
// skin([pentagon(4), circle($fn=80,r=2)], z=[0,3], slices=10, method="reindex");
|
||||
// Example(FlatSpin): Offsetting the starting edge connects to circles in an interesting way:
|
||||
// Example: Offsetting the starting edge connects to circles in an interesting way:
|
||||
// circ = circle($fn=80, r=3);
|
||||
// skin([circ, rot(110,p=circ)], z=[0,5], slices=20);
|
||||
// Example(FlatSpin):
|
||||
|
@ -148,7 +148,7 @@ include <vnf.scad>
|
|||
// point3d(polar_to_xy((100+50*cos((a+b)*2))/2,a),b/90*100)
|
||||
// ]
|
||||
// ], slices=20);
|
||||
// Example(FlatSpin): Vaccum connector example from list-comprehension-demos
|
||||
// Example: Vaccum connector example from list-comprehension-demos
|
||||
// include <BOSL2/rounding.scad>
|
||||
// $fn=32;
|
||||
// base = round_corners(square([2,4],center=true), measure="radius", size=0.5);
|
||||
|
@ -160,7 +160,7 @@ include <vnf.scad>
|
|||
// for(i=[0:2]) each [path3d(circle(r=0.6), i+4),
|
||||
// path3d(circle(r=0.5), i+5)]
|
||||
// ],slices=0);
|
||||
// Example(FlatSpin): Vaccum nozzle example from list-comprehension-demos, using "length" sampling (the default)
|
||||
// Example: Vaccum nozzle example from list-comprehension-demos, using "length" sampling (the default)
|
||||
// xrot(90)down(1.5)
|
||||
// difference() {
|
||||
// skin(
|
||||
|
@ -172,7 +172,7 @@ include <vnf.scad>
|
|||
// circle($fn=64,r=0.45)], z=[-.01,3.01],
|
||||
// slices=40,sampling="length",method="reindex");
|
||||
// }
|
||||
// Example(FlatSpin): Same thing with "segment" sampling
|
||||
// Example: Same thing with "segment" sampling
|
||||
// xrot(90)down(1.5)
|
||||
// difference() {
|
||||
// skin(
|
||||
|
@ -184,7 +184,7 @@ include <vnf.scad>
|
|||
// circle($fn=64,r=0.45)], z=[-.01,3.01],
|
||||
// slices=40,sampling="segment",method="reindex");
|
||||
// }
|
||||
// Example(FlatSpin): Forma Candle Holder (from list-comprehension-demos)
|
||||
// Example: Forma Candle Holder (from list-comprehension-demos)
|
||||
// r = 50;
|
||||
// height = 140;
|
||||
// layers = 10;
|
||||
|
@ -201,18 +201,18 @@ include <vnf.scad>
|
|||
// interior = regular_ngon(n=len(base), d=60);
|
||||
// right_half()
|
||||
// skin([ sub_base, base, base, sub_base, interior], z=[0,2,height, height, 2], slices=0, refine=1, method="reindex");
|
||||
// Example(FlatSpin): Connecting a pentagon and circle with the "tangent" method produces triangular faces.
|
||||
// Example: Connecting a pentagon and circle with the "tangent" method produces triangular faces.
|
||||
// skin([pentagon(4), circle($fn=80,r=2)], z=[0,3], slices=10, method="tangent");
|
||||
// Example(FlatSpin): Another "tangent" example with non-parallel profiles
|
||||
// Example: Another "tangent" example with non-parallel profiles
|
||||
// skin([path3d(pentagon(4)),
|
||||
// yrot(35,p=path3d(right(4,p=circle($fn=80,r=2)),5))], slices=10, method="tangent");
|
||||
// Example(FlatSpin): rounding corners of a square. Note that $fn makes the number of points constant, and avoiding the `rounding=0` case keeps everything simple. In this case, the connections between profiles are linear, so there is no benefit to setting `slices` bigger than zero.
|
||||
// Example: rounding corners of a square. Note that `$fn` makes the number of points constant, and avoiding the `rounding=0` case keeps everything simple. In this case, the connections between profiles are linear, so there is no benefit to setting `slices` bigger than zero.
|
||||
// shapes = [for(i=[.01:.045:2])zrot(-i*180/2,cp=[-8,0,0],p=xrot(90,p=path3d(regular_ngon(n=4, side=4, rounding=i, $fn=64))))];
|
||||
// skin( shapes, slices=0);
|
||||
// Example(FlatSpin): Here's a simplified version of the above, with `i=0` included. That first layer doesn't look good.
|
||||
// Example: Here's a simplified version of the above, with `i=0` included. That first layer doesn't look good.
|
||||
// shapes = [for(i=[0:.2:1]) path3d(regular_ngon(n=4, side=4, rounding=i, $fn=32),i*5)];
|
||||
// skin( shapes, slices=0);
|
||||
// Example(FlatSpin): You can fix it by specifying "tangent" for the first method, but you still need "direct" for the rest.
|
||||
// Example: You can fix it by specifying "tangent" for the first method, but you still need "direct" for the rest.
|
||||
// shapes = [for(i=[0:.2:1]) path3d(regular_ngon(n=4, side=4, rounding=i, $fn=32),i*5)];
|
||||
// skin( shapes, slices=0, method=concat(["tangent"],replist("direct",len(shapes)-2)));
|
||||
// Example(FlatSpin): Connecting square to pentagon using "direct" method.
|
||||
|
@ -268,16 +268,16 @@ include <vnf.scad>
|
|||
// skin(
|
||||
// [for(i=[0:2*N-1]) xrot(360*i/2/N, p=(i%2==0 ? hex : pent))],
|
||||
// refine=1,slices=0,method="distance",closed=true);
|
||||
// Example(FlatSpin): A smooth morph is achieved when you can calculate all the slices yourself. Since you provide all the slices, set `slices=0`.
|
||||
// Example: A smooth morph is achieved when you can calculate all the slices yourself. Since you provide all the slices, set `slices=0`.
|
||||
// skin([for(n=[.1:.02:.5])
|
||||
// yrot(n*60-.5*60,p=path3d(supershape(step=360/128,m1=5,n1=n, n2=1.7),5-10*n))],
|
||||
// slices=0);
|
||||
// Example(FlatSpin): Another smooth supershape morph:
|
||||
// Example: Another smooth supershape morph:
|
||||
// skin([for(alpha=[-.2:.05:1.5])
|
||||
// path3d(supershape(step=360/256,m1=7, n1=lerp(2,3,alpha),
|
||||
// n2=lerp(8,4,alpha), n3=lerp(4,17,alpha)),alpha*5)],
|
||||
// slices=0);
|
||||
// Example(FlatSpin): Several polygons connected using "distance"
|
||||
// Example: Several polygons connected using "distance"
|
||||
// skin([regular_ngon(n=4, r=3),
|
||||
// regular_ngon(n=6, r=3),
|
||||
// regular_ngon(n=9, r=4),
|
||||
|
@ -289,7 +289,7 @@ include <vnf.scad>
|
|||
// for (ang = [0:10:90])
|
||||
// rot([0,ang,0], cp=[200,0,0], p=path3d(circle(d=100,$fn=12-(ang/10))))
|
||||
// ],method="distance",slices=10,refine=10);
|
||||
// Example(FlatSpin): Möbius Strip. This is a tricky model because when you work your way around to the connection, the direction of the profiles is flipped, so how can the proper geometry be created? The trick is to duplicate the first profile and turn the caps off. The model closes up and forms a valid polyhedron.
|
||||
// Example: Möbius Strip. This is a tricky model because when you work your way around to the connection, the direction of the profiles is flipped, so how can the proper geometry be created? The trick is to duplicate the first profile and turn the caps off. The model closes up and forms a valid polyhedron.
|
||||
// skin([
|
||||
// for (ang = [0:5:360])
|
||||
// rot([0,ang,0], cp=[100,0,0], p=rot(ang/2, p=path3d(square([1,30],center=true))))
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
BOSL_VERSION = [2,0,116];
|
||||
BOSL_VERSION = [2,0,117];
|
||||
|
||||
|
||||
// Section: BOSL Library Version Functions
|
||||
|
|
Loading…
Reference in a new issue