fix examples

This commit is contained in:
Adrian Mariano 2021-10-15 16:22:36 -04:00
parent 544bb5883e
commit a65315b876

View file

@ -255,14 +255,16 @@
// skin([regular_ngon(n=4, r=4), regular_ngon(n=5,r=5)], z=[0,4], refine=10, slices=10); // skin([regular_ngon(n=4, r=4), regular_ngon(n=5,r=5)], z=[0,4], refine=10, slices=10);
// Example(FlatSpin,VPD=35): Connecting square to shifted pentagon using "direct" method. // Example(FlatSpin,VPD=35): Connecting square to shifted pentagon using "direct" method.
// skin([regular_ngon(n=4, r=4), right(4,p=regular_ngon(n=5,r=5))], z=[0,4], refine=10, slices=10); // skin([regular_ngon(n=4, r=4), right(4,p=regular_ngon(n=5,r=5))], z=[0,4], refine=10, slices=10);
// Example(FlatSpin,VPD=35): To improve the look, you can actually rotate the polygons for a more symmetric pattern of lines. You have to resample yourself before calling `align_polygon` and you should choose a length that is a multiple of both polygon lengths. // Example(FlatSpin,VPD=185): In this example reindexing does not fix the orientation of the triangle because it happens in 3d within skin(), so we have to reverse the triangle manually
// sq = subdivide_path(regular_ngon(n=4, r=4),40); // ellipse = yscale(3,circle(r=10, $fn=32));
// pent = subdivide_path(regular_ngon(n=5,r=5),40); // tri = move([-50/3,-9],[[0,0], [50,0], [0,27]]);
// skin([sq, align_polygon(sq,pent,[0:1:360/5])], z=[0,4], slices=10); // skin([ellipse, reverse(tri)], z=[0,20], slices=20, method="reindex");
// Example(FlatSpin,VPD=35): For the shifted pentagon we can also align, making sure to pass an appropriate centerpoint to `align_polygon`. // Example(FlatSpin,VPD=185): You can get a nicer transition by rotating the polygons for better alignment. You have to resample yourself before calling `align_polygon`. The orientation is fixed so we do not need to reverse.
// sq = subdivide_path(regular_ngon(n=4, r=4),40); // ellipse = yscale(3,circle(r=10, $fn=32));
// pent = right(4,p=subdivide_path(regular_ngon(n=5,r=5),40)); // tri = move([-50/3,-9],
// skin([sq, align_polygon(sq,pent,[0:1:360/5],cp=[4,0])], z=[0,4], refine=10, slices=10); // subdivide_path([[0,0], [50,0], [0,27]], 32));
// aligned = align_polygon(ellipse,tri, [0:5:180]);
// skin([ellipse, aligned], z=[0,20], slices=20);
// Example(FlatSpin,VPD=35): The "distance" method is a completely different approach. // Example(FlatSpin,VPD=35): The "distance" method is a completely different approach.
// skin([regular_ngon(n=4, r=4), regular_ngon(n=5,r=5)], z=[0,4], refine=10, slices=10, method="distance"); // skin([regular_ngon(n=4, r=4), regular_ngon(n=5,r=5)], z=[0,4], refine=10, slices=10, method="distance");
// Example(FlatSpin,VPD=35,VPT=[0,0,4]): Connecting pentagon to heptagon inserts two triangular faces on each side // Example(FlatSpin,VPD=35,VPT=[0,0,4]): Connecting pentagon to heptagon inserts two triangular faces on each side