mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-15 17:09:40 +00:00
Compare commits
1 commit
ee689cc45d
...
e79c15b34f
Author | SHA1 | Date | |
---|---|---|---|
|
e79c15b34f |
1 changed files with 19 additions and 5 deletions
24
vnf.scad
24
vnf.scad
|
@ -315,11 +315,11 @@ function vnf_vertex_array(
|
||||||
// vnf_polyhedron(vnf4);
|
// vnf_polyhedron(vnf4);
|
||||||
// color("green") vnf_wireframe(vnf4);
|
// color("green") vnf_wireframe(vnf4);
|
||||||
// }
|
// }
|
||||||
// Example(3D,NoAxes,Edges,VPR=[65,0,25]): Model of a cymbal with roughly same-size facets, using a different number of points for each concentric ring of vertices.
|
// Example(3D,NoAxes,Edges): Model of a cymbal with roughly same-size facets, using a different number of points for each concentric ring of vertices.
|
||||||
// include <BOSL2/beziers.scad>
|
// include <BOSL2/beziers.scad>
|
||||||
// bez = [
|
// bez = [
|
||||||
// [[0,26], [35,26], [29,0], [80,16], [102,0]], //top
|
// [[0,22], [35,22], [30,0], [80,14], [102,0]], //top
|
||||||
// [[99,-1], [79,15], [28,-1], [34,25], [-1,25]] // bottom
|
// [[99,-1], [79,13], [29,-1], [34,21], [-1,21]] // bottom
|
||||||
// ];
|
// ];
|
||||||
// points = [
|
// points = [
|
||||||
// for(b=bez)
|
// for(b=bez)
|
||||||
|
@ -413,7 +413,7 @@ function _lofttri(p1, p2, i1offset, i2offset, n1, n2, reverse=false, trilist=[],
|
||||||
_lofttri(p1, p2, i1offset, i2offset, n1, n2, reverse, concat(trilist, [triangle]), d12<d21 ? i1 : t1, d12<d21 ? t2 : i2)
|
_lofttri(p1, p2, i1offset, i2offset, n1, n2, reverse, concat(trilist, [triangle]), d12<d21 ? i1 : t1, d12<d21 ? t2 : i2)
|
||||||
|
|
||||||
: // equal row lengths
|
: // equal row lengths
|
||||||
let(n=n1, i=i1,
|
let(
|
||||||
t = i < n ? i+1 : n, // test point
|
t = i < n ? i+1 : n, // test point
|
||||||
d12 = t>=n ? 9e+9 : norm(p2[t]-p1[i]), // distance from p1 to new p2
|
d12 = t>=n ? 9e+9 : norm(p2[t]-p1[i]), // distance from p1 to new p2
|
||||||
d21 = t>=n ? 9e+9 : norm(p1[t]-p2[i]), // distance from p2 to new p1
|
d21 = t>=n ? 9e+9 : norm(p1[t]-p2[i]), // distance from p2 to new p1
|
||||||
|
@ -424,8 +424,22 @@ function _lofttri(p1, p2, i1offset, i2offset, n1, n2, reverse=false, trilist=[],
|
||||||
[i2offset+t, i1offset+t, d12<d21 ? i1offset+i : i2offset+i] :
|
[i2offset+t, i1offset+t, d12<d21 ? i1offset+i : i2offset+i] :
|
||||||
[i1offset+t, i2offset+t, d12<d21 ? i1offset+i : i2offset+i]
|
[i1offset+t, i2offset+t, d12<d21 ? i1offset+i : i2offset+i]
|
||||||
) t>=n ? trilist :
|
) t>=n ? trilist :
|
||||||
_lofttri(p1, p2, i1offset, i2offset, n, n, reverse, concat(trilist, [triangle1, triangle2]), t, t);
|
_lofttri_eq(p1, p2, i1offset, i2offset, n, reverse, concat(trilist, [triangle1, triangle2]), t);
|
||||||
|
|
||||||
|
/*
|
||||||
|
function _lofttri_eq(p1, p2, i1offset, i2offset, n, reverse=false, trilist=[], i=0) = let(
|
||||||
|
t = i < n ? i+1 : n, // test point
|
||||||
|
d12 = t>=n ? 9e+9 : norm(p2[t]-p1[i]), // distance from p1 to new p2
|
||||||
|
d21 = t>=n ? 9e+9 : norm(p1[t]-p2[i]), // distance from p2 to new p1
|
||||||
|
triangle1 = reverse ?
|
||||||
|
[i1offset+i, i2offset+i, d12<d21 ? i2offset+t : i1offset+t] :
|
||||||
|
[i2offset+i, i1offset+i, d12<d21 ? i2offset+t : i1offset+t],
|
||||||
|
triangle2 = reverse ?
|
||||||
|
[i2offset+t, i1offset+t, d12<d21 ? i1offset+i : i2offset+i] :
|
||||||
|
[i1offset+t, i2offset+t, d12<d21 ? i1offset+i : i2offset+i]
|
||||||
|
) t>=n ? trilist :
|
||||||
|
_lofttri_eq(p1, p2, i1offset, i2offset, n, reverse, concat(trilist, [triangle1, triangle2]), t);
|
||||||
|
*/
|
||||||
|
|
||||||
// Function: vnf_join()
|
// Function: vnf_join()
|
||||||
// Synopsis: Returns a single VNF structure from a list of VNF structures.
|
// Synopsis: Returns a single VNF structure from a list of VNF structures.
|
||||||
|
|
Loading…
Reference in a new issue