I'm helping a friend's daughter to construct a 120 sided solid by
3d printing a skeleton that she's going to cover in mylar. My attempt is at: https://github.com/rugyoga/catalan_solids/blob/main/disdyakis_triacontahedron.scad Each face is a triangle. To save some time, I wanted to print the parallelogram formed by four triangles so I only need 30 of them. Ideally I wanted them to snap together like lego bricks. So the edges that mate to the neighbouring parallelogram should be half cylinders. The code for the parallelogram works great. But I can't get the difference operator to shave the half cylinders. I'm subtracting four tetrahedron where face slices the rod in half. c0 = 3 * (15 + sqrt(5)) / 44; c1 = (5 - sqrt(5)) / 2; c2 = 3 * (5 + 4 * sqrt(5)) / 22; c3 = 3 * (5 + sqrt(5)) / 10; c4 = sqrt(5); c5 = (75 + 27 * sqrt(5)) / 44; c6 = (15 + 9 * sqrt(5)) / 10; c7 = (5 + sqrt(5)) / 2; c8 = 3 * (5 + 4 * sqrt(5)) / 11; function vertices() = [[0.0, 0.0, c8], // 0 [0.0, 0.0, -c8], [ c8, 0.0, 0.0], [-c8, 0.0, 0.0], [0.0, c8, 0.0], [0.0, -c8, 0.0], [0.0, c1, c7], [0.0, c1, -c7], [0.0, -c1, c7], [0.0, -c1, -c7], [ c7, 0.0, c1], // 10 [ c7, 0.0, -c1], [-c7, 0.0, c1], [-c7, 0.0, -c1], [ c1, c7, 0.0], [ c1, -c7, 0.0], [-c1, c7, 0.0], [-c1, -c7, 0.0], [ c3, 0.0, c6], [ c3, 0.0, -c6], [-c3, 0.0, c6], // 20 [-c3, 0.0, -c6], [ c6, c3, 0.0], [ c6, -c3, 0.0], [-c6, c3, 0.0], [-c6, -c3, 0.0], [0.0, c6, c3], [0.0, c6, -c3], [0.0, -c6, c3], [0.0, -c6, -c3], [ c0, c2, c5], // 30 [ c0, c2, -c5], [ c0, -c2, c5], [ c0, -c2, -c5], [-c0, c2, c5], [-c0, c2, -c5], [-c0, -c2, c5], [-c0, -c2, -c5], [ c5, c0, c2], [ c5, c0, -c2], [ c5, -c0, c2], // 40 [ c5, -c0, -c2], [-c5, c0, c2], [-c5, c0, -c2], [-c5, -c0, c2], [-c5, -c0, -c2], [ c2, c5, c0], [ c2, c5, -c0], [ c2, -c5, c0], [ c2, -c5, -c0], [-c2, c5, c0], // 50 [-c2, c5, -c0], [-c2, -c5, c0], [-c2, -c5, -c0], [ c4, c4, c4], [ c4, c4, -c4], [ c4, -c4, c4], [ c4, -c4, -c4], [-c4, c4, c4], [-c4, c4, -c4], [-c4, -c4, c4], // 60 [-c4, -c4, -c4]]; v = vertices() // cribbed from http://forum.openscad.org/Rods-between-3D-points-tp13104p13115.html module rod(p1,p2,tk){ // draw ray between 2 specified points translate(p1) sphere(r=tk); translate(p2) sphere(r=tk); translate((p1+p2)/2) rotate([-acos((p2[2]-p1[2]) / norm(p1-p2)),0, -atan2(p2[0]-p1[0],p2[1]-p1[1])]) cylinder(r1=tk, h=norm(p1-p2), center = true); } module diamond() { rod(v[0], v[6], 1); rod(v[0], v[18], 1); rod(v[0], v[8], 1); rod(v[0], v[20], 1); rod(v[20], v[6], 1); rod(v[6], v[18], 1); rod(v[18], v[8], 1); rod(v[8], v[20], 1); } module tetra(points) { polyhedron( points, [[0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3]] ); } module flattened_diamond() { difference() { diamond(); tetra( [v[8], v[18], v[7], v[15]] * 2); tetra( [v[6], v[18], v[9], v[14]] * 2); tetra( [v[8], v[20], v[7], v[15]] * 2); tetra( [v[20], v[6], v[19], v[1]] * 2); } } Can you see anything obvious that I'm doing wrong? Cheers, Guy -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
Does she know how fragile mylar is???
On 12/18/20 11:30 PM, rugyoga wrote: > I'm helping a friend's daughter to construct a 120 sided solid by > 3d printing a skeleton that she's going to cover in mylar. > > My attempt is at: > https://github.com/rugyoga/catalan_solids/blob/main/disdyakis_triacontahedron.scad > > Each face is a triangle. > To save some time, I wanted to print the parallelogram formed by four > triangles > so I only need 30 of them. Ideally I wanted them to snap together like lego > bricks. > So the edges that mate to the neighbouring parallelogram should be half > cylinders. > The code for the parallelogram works great. > But I can't get the difference operator to shave the half cylinders. > I'm subtracting four tetrahedron where face slices the rod in half. > > c0 = 3 * (15 + sqrt(5)) / 44; > c1 = (5 - sqrt(5)) / 2; > c2 = 3 * (5 + 4 * sqrt(5)) / 22; > c3 = 3 * (5 + sqrt(5)) / 10; > c4 = sqrt(5); > c5 = (75 + 27 * sqrt(5)) / 44; > c6 = (15 + 9 * sqrt(5)) / 10; > c7 = (5 + sqrt(5)) / 2; > c8 = 3 * (5 + 4 * sqrt(5)) / 11; > > function vertices() = > [[0.0, 0.0, c8], // 0 > [0.0, 0.0, -c8], > [ c8, 0.0, 0.0], > [-c8, 0.0, 0.0], > [0.0, c8, 0.0], > [0.0, -c8, 0.0], > [0.0, c1, c7], > [0.0, c1, -c7], > [0.0, -c1, c7], > [0.0, -c1, -c7], > [ c7, 0.0, c1], // 10 > [ c7, 0.0, -c1], > [-c7, 0.0, c1], > [-c7, 0.0, -c1], > [ c1, c7, 0.0], > [ c1, -c7, 0.0], > [-c1, c7, 0.0], > [-c1, -c7, 0.0], > [ c3, 0.0, c6], > [ c3, 0.0, -c6], > [-c3, 0.0, c6], // 20 > [-c3, 0.0, -c6], > [ c6, c3, 0.0], > [ c6, -c3, 0.0], > [-c6, c3, 0.0], > [-c6, -c3, 0.0], > [0.0, c6, c3], > [0.0, c6, -c3], > [0.0, -c6, c3], > [0.0, -c6, -c3], > [ c0, c2, c5], // 30 > [ c0, c2, -c5], > [ c0, -c2, c5], > [ c0, -c2, -c5], > [-c0, c2, c5], > [-c0, c2, -c5], > [-c0, -c2, c5], > [-c0, -c2, -c5], > [ c5, c0, c2], > [ c5, c0, -c2], > [ c5, -c0, c2], // 40 > [ c5, -c0, -c2], > [-c5, c0, c2], > [-c5, c0, -c2], > [-c5, -c0, c2], > [-c5, -c0, -c2], > [ c2, c5, c0], > [ c2, c5, -c0], > [ c2, -c5, c0], > [ c2, -c5, -c0], > [-c2, c5, c0], // 50 > [-c2, c5, -c0], > [-c2, -c5, c0], > [-c2, -c5, -c0], > [ c4, c4, c4], > [ c4, c4, -c4], > [ c4, -c4, c4], > [ c4, -c4, -c4], > [-c4, c4, c4], > [-c4, c4, -c4], > [-c4, -c4, c4], // 60 > [-c4, -c4, -c4]]; > > v = vertices() > > // cribbed from > http://forum.openscad.org/Rods-between-3D-points-tp13104p13115.html > > module rod(p1,p2,tk){ // draw ray between 2 specified points > translate(p1) > sphere(r=tk); > translate(p2) > sphere(r=tk); > translate((p1+p2)/2) > rotate([-acos((p2[2]-p1[2]) / norm(p1-p2)),0, > -atan2(p2[0]-p1[0],p2[1]-p1[1])]) > cylinder(r1=tk, h=norm(p1-p2), center = true); > } > > module diamond() { > rod(v[0], v[6], 1); > rod(v[0], v[18], 1); > rod(v[0], v[8], 1); > rod(v[0], v[20], 1); > rod(v[20], v[6], 1); > rod(v[6], v[18], 1); > rod(v[18], v[8], 1); > rod(v[8], v[20], 1); > } > > module tetra(points) { > polyhedron( points, [[0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3]] ); > } > > module flattened_diamond() { > difference() { > diamond(); > tetra( [v[8], v[18], v[7], v[15]] * 2); > tetra( [v[6], v[18], v[9], v[14]] * 2); > tetra( [v[8], v[20], v[7], v[15]] * 2); > tetra( [v[20], v[6], v[19], v[1]] * 2); > } > } > > Can you see anything obvious that I'm doing wrong? > Cheers, > Guy > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > [hidden email] > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
Mylar is not fragile except in extremely thin shapes like balloons or insulation foils. I’ve used it for large vacuum chamber windows, and for drafting paper. Very versatile and strong substance.
-- David Gustavson [hidden email] On Fri, Dec 18, 2020, at 9:37 PM, David wrote: > Does she know how fragile mylar is??? > > > On 12/18/20 11:30 PM, rugyoga wrote: > > I'm helping a friend's daughter to construct a 120 sided solid by > > 3d printing a skeleton that she's going to cover in mylar. > > > > My attempt is at: > > https://github.com/rugyoga/catalan_solids/blob/main/disdyakis_triacontahedron.scad > > > > Each face is a triangle. > > To save some time, I wanted to print the parallelogram formed by four > > triangles > > so I only need 30 of them. Ideally I wanted them to snap together like lego > > bricks. > > So the edges that mate to the neighbouring parallelogram should be half > > cylinders. > > The code for the parallelogram works great. > > But I can't get the difference operator to shave the half cylinders. > > I'm subtracting four tetrahedron where face slices the rod in half. > > > > c0 = 3 * (15 + sqrt(5)) / 44; > > c1 = (5 - sqrt(5)) / 2; > > c2 = 3 * (5 + 4 * sqrt(5)) / 22; > > c3 = 3 * (5 + sqrt(5)) / 10; > > c4 = sqrt(5); > > c5 = (75 + 27 * sqrt(5)) / 44; > > c6 = (15 + 9 * sqrt(5)) / 10; > > c7 = (5 + sqrt(5)) / 2; > > c8 = 3 * (5 + 4 * sqrt(5)) / 11; > > > > function vertices() = > > [[0.0, 0.0, c8], // 0 > > [0.0, 0.0, -c8], > > [ c8, 0.0, 0.0], > > [-c8, 0.0, 0.0], > > [0.0, c8, 0.0], > > [0.0, -c8, 0.0], > > [0.0, c1, c7], > > [0.0, c1, -c7], > > [0.0, -c1, c7], > > [0.0, -c1, -c7], > > [ c7, 0.0, c1], // 10 > > [ c7, 0.0, -c1], > > [-c7, 0.0, c1], > > [-c7, 0.0, -c1], > > [ c1, c7, 0.0], > > [ c1, -c7, 0.0], > > [-c1, c7, 0.0], > > [-c1, -c7, 0.0], > > [ c3, 0.0, c6], > > [ c3, 0.0, -c6], > > [-c3, 0.0, c6], // 20 > > [-c3, 0.0, -c6], > > [ c6, c3, 0.0], > > [ c6, -c3, 0.0], > > [-c6, c3, 0.0], > > [-c6, -c3, 0.0], > > [0.0, c6, c3], > > [0.0, c6, -c3], > > [0.0, -c6, c3], > > [0.0, -c6, -c3], > > [ c0, c2, c5], // 30 > > [ c0, c2, -c5], > > [ c0, -c2, c5], > > [ c0, -c2, -c5], > > [-c0, c2, c5], > > [-c0, c2, -c5], > > [-c0, -c2, c5], > > [-c0, -c2, -c5], > > [ c5, c0, c2], > > [ c5, c0, -c2], > > [ c5, -c0, c2], // 40 > > [ c5, -c0, -c2], > > [-c5, c0, c2], > > [-c5, c0, -c2], > > [-c5, -c0, c2], > > [-c5, -c0, -c2], > > [ c2, c5, c0], > > [ c2, c5, -c0], > > [ c2, -c5, c0], > > [ c2, -c5, -c0], > > [-c2, c5, c0], // 50 > > [-c2, c5, -c0], > > [-c2, -c5, c0], > > [-c2, -c5, -c0], > > [ c4, c4, c4], > > [ c4, c4, -c4], > > [ c4, -c4, c4], > > [ c4, -c4, -c4], > > [-c4, c4, c4], > > [-c4, c4, -c4], > > [-c4, -c4, c4], // 60 > > [-c4, -c4, -c4]]; > > > > v = vertices() > > > > // cribbed from > > http://forum.openscad.org/Rods-between-3D-points-tp13104p13115.html > > > > module rod(p1,p2,tk){ // draw ray between 2 specified points > > translate(p1) > > sphere(r=tk); > > translate(p2) > > sphere(r=tk); > > translate((p1+p2)/2) > > rotate([-acos((p2[2]-p1[2]) / norm(p1-p2)),0, > > -atan2(p2[0]-p1[0],p2[1]-p1[1])]) > > cylinder(r1=tk, h=norm(p1-p2), center = true); > > } > > > > module diamond() { > > rod(v[0], v[6], 1); > > rod(v[0], v[18], 1); > > rod(v[0], v[8], 1); > > rod(v[0], v[20], 1); > > rod(v[20], v[6], 1); > > rod(v[6], v[18], 1); > > rod(v[18], v[8], 1); > > rod(v[8], v[20], 1); > > } > > > > module tetra(points) { > > polyhedron( points, [[0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3]] ); > > } > > > > module flattened_diamond() { > > difference() { > > diamond(); > > tetra( [v[8], v[18], v[7], v[15]] * 2); > > tetra( [v[6], v[18], v[9], v[14]] * 2); > > tetra( [v[8], v[20], v[7], v[15]] * 2); > > tetra( [v[20], v[6], v[19], v[1]] * 2); > > } > > } > > > > Can you see anything obvious that I'm doing wrong? > > Cheers, > > Guy > > > > > > > > -- > > Sent from: http://forum.openscad.org/ > > > > _______________________________________________ > > OpenSCAD mailing list > > [hidden email] > > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > [hidden email] > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
Thanks. My only experiences with mylar has been with the extremely thin
windows in radiation detection / counting equipment. Had no idea that thicker, stronger uses were even out there. David On 12/18/20 11:51 PM, David Gustavson wrote: > Mylar is not fragile except in extremely thin shapes like balloons or insulation foils. I’ve used it for large vacuum chamber windows, and for drafting paper. Very versatile and strong substance. > _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
Administrator
|
In reply to this post by rugyoga
Note for others, that pasted code is not complete, see the GitHub link
instead. ----- OpenSCAD Admin - email* me if you need anything, or if I've done something stupid... * on the Forum, click on my MichaelAtOz label, there is a link to email me. Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
* on the Forum, click on my MichaelAtOz label, there is a link to email me. Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. |
In reply to this post by rugyoga
This is your problem. That is F5 & View/Thrown-together. Your tetra( [v[8], v[18], v[7], v[15]] *2 ); is inside-out. Effectively negative, hence difference() doesn't work. See https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Primitive_Solids#Mis-ordered_faces
> -----Original Message----- > From: Discuss [mailto:[hidden email]] On Behalf Of rugyoga > Sent: Sat, 19 Dec 2020 16:30 > To: [hidden email] > Subject: [OpenSCAD] Problems with difference > > I'm helping a friend's daughter to construct a 120 sided solid by > 3d printing a skeleton that she's going to cover in mylar. > > My attempt is at: > https://github.com/rugyoga/catalan_solids/blob/main/disdyakis_triacontahedron.scad > > Each face is a triangle. > To save some time, I wanted to print the parallelogram formed by four > triangles > so I only need 30 of them. Ideally I wanted them to snap together like lego > bricks. > So the edges that mate to the neighbouring parallelogram should be half > cylinders. > The code for the parallelogram works great. > But I can't get the difference operator to shave the half cylinders. > I'm subtracting four tetrahedron where face slices the rod in half. > > c0 = 3 * (15 + sqrt(5)) / 44; > c1 = (5 - sqrt(5)) / 2; > c2 = 3 * (5 + 4 * sqrt(5)) / 22; > c3 = 3 * (5 + sqrt(5)) / 10; > c4 = sqrt(5); > c5 = (75 + 27 * sqrt(5)) / 44; > c6 = (15 + 9 * sqrt(5)) / 10; > c7 = (5 + sqrt(5)) / 2; > c8 = 3 * (5 + 4 * sqrt(5)) / 11; > > function vertices() = > [[0.0, 0.0, c8], // 0 > [0.0, 0.0, -c8], > [ c8, 0.0, 0.0], > [-c8, 0.0, 0.0], > [0.0, c8, 0.0], > [0.0, -c8, 0.0], > [0.0, c1, c7], > [0.0, c1, -c7], > [0.0, -c1, c7], > [0.0, -c1, -c7], > [ c7, 0.0, c1], // 10 > [ c7, 0.0, -c1], > [-c7, 0.0, c1], > [-c7, 0.0, -c1], > [ c1, c7, 0.0], > [ c1, -c7, 0.0], > [-c1, c7, 0.0], > [-c1, -c7, 0.0], > [ c3, 0.0, c6], > [ c3, 0.0, -c6], > [-c3, 0.0, c6], // 20 > [-c3, 0.0, -c6], > [ c6, c3, 0.0], > [ c6, -c3, 0.0], > [-c6, c3, 0.0], > [-c6, -c3, 0.0], > [0.0, c6, c3], > [0.0, c6, -c3], > [0.0, -c6, c3], > [0.0, -c6, -c3], > [ c0, c2, c5], // 30 > [ c0, c2, -c5], > [ c0, -c2, c5], > [ c0, -c2, -c5], > [-c0, c2, c5], > [-c0, c2, -c5], > [-c0, -c2, c5], > [-c0, -c2, -c5], > [ c5, c0, c2], > [ c5, c0, -c2], > [ c5, -c0, c2], // 40 > [ c5, -c0, -c2], > [-c5, c0, c2], > [-c5, c0, -c2], > [-c5, -c0, c2], > [-c5, -c0, -c2], > [ c2, c5, c0], > [ c2, c5, -c0], > [ c2, -c5, c0], > [ c2, -c5, -c0], > [-c2, c5, c0], // 50 > [-c2, c5, -c0], > [-c2, -c5, c0], > [-c2, -c5, -c0], > [ c4, c4, c4], > [ c4, c4, -c4], > [ c4, -c4, c4], > [ c4, -c4, -c4], > [-c4, c4, c4], > [-c4, c4, -c4], > [-c4, -c4, c4], // 60 > [-c4, -c4, -c4]]; > > v = vertices() > > // cribbed from > http://forum.openscad.org/Rods-between-3D-points-tp13104p13115.html > > module rod(p1,p2,tk){ // draw ray between 2 specified points > translate(p1) > sphere(r=tk); > translate(p2) > sphere(r=tk); > translate((p1+p2)/2) > rotate([-acos((p2[2]-p1[2]) / norm(p1-p2)),0, > -atan2(p2[0]-p1[0],p2[1]-p1[1])]) > cylinder(r1=tk, h=norm(p1-p2), center = true); > } > > module diamond() { > rod(v[0], v[6], 1); > rod(v[0], v[18], 1); > rod(v[0], v[8], 1); > rod(v[0], v[20], 1); > rod(v[20], v[6], 1); > rod(v[6], v[18], 1); > rod(v[18], v[8], 1); > rod(v[8], v[20], 1); > } > > module tetra(points) { > polyhedron( points, [[0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3]] ); > } > > module flattened_diamond() { > difference() { > diamond(); > tetra( [v[8], v[18], v[7], v[15]] * 2); > tetra( [v[6], v[18], v[9], v[14]] * 2); > tetra( [v[8], v[20], v[7], v[15]] * 2); > tetra( [v[20], v[6], v[19], v[1]] * 2); > } > } > > Can you see anything obvious that I'm doing wrong? > Cheers, > Guy > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
Administrator
|
Sorry, that's a bit misleading.
Not all inside-out, I keep forgetting on my normal system, a VM, I use S/W rendering, it draws thrown-together a bit wrong. I did it on a RM, two of the faces are bad. ----- OpenSCAD Admin - email* me if you need anything, or if I've done something stupid... * on the Forum, click on my MichaelAtOz label, there is a link to email me. Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
* on the Forum, click on my MichaelAtOz label, there is a link to email me. Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. |
Administrator
|
Also note your aim is a bit off > -----Original Message----- > From: Discuss
[mailto:[hidden email]] On Behalf Of > Sent: Sat, 19 Dec 2020 18:12 > To: [hidden email] > Subject: Re: [OpenSCAD] Problems with difference > > Sorry, that's a bit misleading. > Not all inside-out, I keep forgetting on my normal system, a VM, I use S/W > rendering, it draws thrown-together a bit wrong. > I did it on a RM, two of the faces are bad. > > > > ----- > OpenSCAD Admin - email* me if you need anything, or if I've done something stupid... > > * on the Forum, click on my > > Unless specifically shown otherwise above, my contribution is in the Public Domain; to the > extent possible under law, I have waived all copyright and related or neighbouring rights > to this work. Obviously inclusion of works of previous authors is not included in the > above. > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
* on the Forum, click on my MichaelAtOz label, there is a link to email me. Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. |
In reply to this post by MichaelAtOz
Yes!
The fix was: module tetra(points) { polyhedron( points, [[2, 1, 0], [1, 3, 0], [2, 3, 1], [0, 3, 2]] ); } Many thanks! -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
You might find this approach to making polyhedra interesting:
https://www.myminifactory.com/object/3d-print-folding-pentagonal-hexacontahedron-puzzle-85216 I made the tetrahedron and it worked very nicely. I'm not sure I fully understand your plan, but if I were trying to assemble 30 of those "diamond" modules I doubt they would align and close up once I was done. If you haven't thought about it you might want to introduce more registration geometry (e.g. alignment groove down the edge) so that the pieces hopefully line up properly. I'd also be worried about the labor of removing support material and the very small surface area for bed adhesion. Another observation: I tried to render the full_skeleton model from the above example. It's a pretty obnoxious model because every edge is in there twice and there are a bunch of repeated spheres at each vertex. Anyhow, it crashed opencad RC3 to try to render it. I made a generic wireframe module that takes out repeated edges and vertices and was able to render this beast, though it did take 24 minutes. If you're interested in polyhedra you might also want to take a look at this: https://github.com/revarbat/BOSL2/wiki/polyhedra.scad It will give you vertices and faces for all the catalan solids (and others). -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
Does hull recalculate the edges and smooth out the math?
David On 12/19/20 9:34 AM, adrianv wrote: > You might find this approach to making polyhedra interesting: > > https://www.myminifactory.com/object/3d-print-folding-pentagonal-hexacontahedron-puzzle-85216 > > I made the tetrahedron and it worked very nicely. I'm not sure I fully > understand your plan, but if I were trying to assemble 30 of those "diamond" > modules I doubt they would align and close up once I was done. If you > haven't thought about it you might want to introduce more registration > geometry (e.g. alignment groove down the edge) so that the pieces hopefully > line up properly. I'd also be worried about the labor of removing support > material and the very small surface area for bed adhesion. > > Another observation: I tried to render the full_skeleton model from the > above example. It's a pretty obnoxious model because every edge is in there > twice and there are a bunch of repeated spheres at each vertex. Anyhow, it > crashed opencad RC3 to try to render it. > > I made a generic wireframe module that takes out repeated edges and vertices > and was able to render this beast, though it did take 24 minutes. > > If you're interested in polyhedra you might also want to take a look at > this: > > https://github.com/revarbat/BOSL2/wiki/polyhedra.scad > > It will give you vertices and faces for all the catalan solids (and others). > > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > [hidden email] > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
Hull doesn't round anything. It just takes all the vertices of the objects and puts a skin around them. Imagine a rubber balloon stretched over a bunch of sharp objects. On Sat, 19 Dec 2020 at 20:45, David <[hidden email]> wrote: Does hull recalculate the edges and smooth out the math? _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
In the referenced polyhedra code (part of BOSL2) the vertices are computed
and the Linde user-space hull() function (not module) computes all of the faces of the polyhedron. I'm not sure if that's what the question was about. But it means that the polyhedra library doesn't have to know how to construct the faces for all of the polyhedra, just the vertices, so that simplifies things considerably. The hull function takes a list of points and computes the face list of the convex hull of the point list, which can then be passed to polyhedron(). nophead wrote > Hull doesn't round anything. It just takes all the vertices of the objects > and puts a skin around them. Imagine a rubber balloon stretched over a > bunch of sharp objects. > > On Sat, 19 Dec 2020 at 20:45, David < > ainut@ > > wrote: > >> Does hull recalculate the edges and smooth out the math? >> >> David >> >> >> On 12/19/20 9:34 AM, adrianv wrote: >> > You might find this approach to making polyhedra interesting: >> > >> > >> https://www.myminifactory.com/object/3d-print-folding-pentagonal-hexacontahedron-puzzle-85216 >> > >> > I made the tetrahedron and it worked very nicely. I'm not sure I fully >> > understand your plan, but if I were trying to assemble 30 of those >> "diamond" >> > modules I doubt they would align and close up once I was done. If you >> > haven't thought about it you might want to introduce more registration >> > geometry (e.g. alignment groove down the edge) so that the pieces >> hopefully >> > line up properly. I'd also be worried about the labor of removing >> support >> > material and the very small surface area for bed adhesion. >> > >> > Another observation: I tried to render the full_skeleton model from >> the >> > above example. It's a pretty obnoxious model because every edge is in >> there >> > twice and there are a bunch of repeated spheres at each vertex. >> Anyhow, >> it >> > crashed opencad RC3 to try to render it. >> > >> > I made a generic wireframe module that takes out repeated edges and >> vertices >> > and was able to render this beast, though it did take 24 minutes. >> > >> > If you're interested in polyhedra you might also want to take a look at >> > this: >> > >> > https://github.com/revarbat/BOSL2/wiki/polyhedra.scad >> > >> > It will give you vertices and faces for all the catalan solids (and >> others). >> > >> > >> > >> > >> > -- >> > Sent from: http://forum.openscad.org/ >> > >> > _______________________________________________ >> > OpenSCAD mailing list >> > > Discuss@.openscad >> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >> >> _______________________________________________ >> OpenSCAD mailing list >> > Discuss@.openscad >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >> > > _______________________________________________ > OpenSCAD mailing list > Discuss@.openscad > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
In reply to this post by nophead
Fun with hull()
$fn=30; stuff(); translate([50,0,0]) hull() stuff(); module stuff() { cylinder(5,r=3); rotate([45,-10,20]) translate([20,0,0]) cylinder(20,r=3); translate([0,30,5]) cube (10); translate([36,30,7]) cylinder(10,r1=1,r2=10); } -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
In reply to this post by rugyoga
But I can't get the difference operator to shave the half cylinders. Your strategy to get a shaved diamond is hard to debug because it resorts to other vertices besides the diamond ones. I got it using just the 4 extreme diamond vertices:
This shape, despite its name, has not a flat base and will need support for 3d printing. To get a flat base, the diamond needs to be elongated down and chopped, a non trivial task. Ideally I wanted them to snap together like lego bricks. The shape above is unable to snap in another one. I devised some clips that could keep the diamonds together at each vertex:
_______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
In reply to this post by adrianv
adrianv:
Cool finds! But the folding polyhedra doesn't work for our purpose because the net we would need would be too large for my 3d printer. That's also why we rejected printing the skeleton. (Also very wasteful of filament). Yup, the skeleton has a known bug. Hence the comment: // avoid this - it duplicates rods module skeleton(items) { Your comment about the registration geometry is spot on. My next step was to code pips - spheres evenly distributed along the semi-rods. The diamond solution was our favourite because: - low filament waste - easily scaled - only needed 30 of them -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
You're clearly down the road on your current approach, and no reason you need
to change if you're happy with it. But you might want to take a closer look at the example I posted. (Did you think about how big the 3d printer would have had to be to print the example net in one model?) The reason I posted that one and not the tetrahedron is that they print a model much bigger for any normal printer in 13 pieces that snap together. Presumably you could do the same for the shape you're interested in. I don't know the scale of what you're doing, but you could do it with 30 diamonds if they're huge or 12 "pentagons" (with 10 faces) if they're smaller. When talking about filament "waste" I'm not sure if you're referring to the support material and brim needed to print the diamonds, or the total amount of material needed to complete the project. The fold up method uses no support material at all, so in that sense, it's zero waste. But I suspect it would use more material than printing all the diamond frames, since it includes the faces. Hard to be sure because of all the support material you need, but it seems likely. Printing the whole skeleton is going to be very troublesome due to the internal support material, unless you have a two material printer and can print soluble support material. Note that my point about trying to render the full skeleton is not that it's a good model, but that it shouldn't crash openscad. You shouldn't be able to crash openscad by feeding it a nasty model. Your comment about duplicating rods doesn't even address the question of spheres at the vertices, some of which are duplicated 20 times. And I think the spheres have more faces than the cylinders, so that's a much worse flaw in the model. Cutting the duplication to 10 (by fixing the rod duplication) still leave a significant issue. Another note: you might want to fix the bug in rod() where it passes r1 instead of r. This causes it to make a cone shaped rod if r1 isn't equal to 1. rugyoga wrote > adrianv: > > Cool finds! > But the folding polyhedra doesn't work for our purpose because > the net we would need would be too large for my 3d printer. > > That's also why we rejected printing the skeleton. > (Also very wasteful of filament). > > Yup, the skeleton has a known bug. > Hence the comment: > > // avoid this - it duplicates rods > module skeleton(items) { > > Your comment about the registration geometry is spot on. > My next step was to code pips - spheres evenly distributed along the > semi-rods. > > The diamond solution was our favourite because: > - low filament waste > - easily scaled > - only needed 30 of them > > > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@.openscad > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
In reply to this post by adrianv
adrianv wrote
> The hull function takes a list of points > and computes the face list of the convex hull of the point list, which can > then be passed to polyhedron() Huh. So... this should work: module badCube(){ polyhedron(points=[[-1,-1,-1],[1,1,-1],[-1,1,-1],[1,-1,-1], [-1,-1, 1],[1,1, 1],[-1,1, 1],[1,-1, 1], [0,0,1.41]], faces=[[0,1,2,3,4,5,6,7,8]]); } color("pink") translate([0,-3,0]) badCube(); color("lightblue") hull(){ badCube(); } <http://forum.openscad.org/file/t452/badCube.png> I was going to request the 'hull' function be slightly modified to take as optional input a point cloud, but given that it seems to work with a polygon object with a 'faces' argument that only needs to define the used points [in any arbitrary order], creating a module that does that is fairly easy, e.g. module hullPointCloud(points) { hull() { echo([ for(i=[0:(len(points)-1)]) i]); polyhedron(points=points, faces=[[ for(i=[0:(len(points)-1)]) i]]); } } -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
Pay close attention to the difference between functions and modules. The
hull() module is part of OpenSCAD. The hull() function was written by Oskar Linde and is included in the BOSL2 library. It works on a list of points and produces a list of faces. Now as it happens, the thing you list below does work. This was actually discussed at length a while back. Your method is suboptimal because it creates a large complex face that may get triangulated by polyhedron() before hull() runs, leading to long run time. Instead you want to make a bogus polyhedron with triangular faces: module hull_points(points) { extra = len(points)%3; faces = [ [for(i=[0:1:extra+2])i], // Handle extra faces when vertex count not divisible by 3 for(i=[extra+3:3:len(points)-3])[i,i+1,i+2] ]; hull() polyhedron(points=points, faces=faces); } I believe this version can produce warnings in some degenerate cases, which may be a problem if you run OpenSCAD with "stop on first warning". In contrast, the hull() function produces a face list as output, not geometry. You then invoke polyhedron to draw the polyhedron. The problem with the hull() function is that it's not very fast. Doing 4000 points takes about a minute. The hack of hulling a bogus polyhedron is much faster, since it exploits the built-in hull operator. David Eccles (gringer) wrote > adrianv wrote >> The hull function takes a list of points >> and computes the face list of the convex hull of the point list, which >> can >> then be passed to polyhedron() > > Huh. So... this should work: > > module badCube(){ > polyhedron(points=[[-1,-1,-1],[1,1,-1],[-1,1,-1],[1,-1,-1], > [-1,-1, 1],[1,1, 1],[-1,1, 1],[1,-1, 1], [0,0,1.41]], > faces=[[0,1,2,3,4,5,6,7,8]]); > } > > color("pink") translate([0,-3,0]) badCube(); > color("lightblue") hull(){ > badCube(); > } > > <http://forum.openscad.org/file/t452/badCube.png> > > I was going to request the 'hull' function be slightly modified to take as > optional input a point cloud, but given that it seems to work with a > polygon > object with a 'faces' argument that only needs to define the used points > [in > any arbitrary order], creating a module that does that is fairly easy, > e.g. > > module hullPointCloud(points) { > hull() > { > echo([ for(i=[0:(len(points)-1)]) i]); > polyhedron(points=points, faces=[[ for(i=[0:(len(points)-1)]) i]]); > } > } > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@.openscad > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
In reply to this post by Ronaldo
Ronaldo:
Your flattened diamond formulation is much more elegant. Thank you. My plan to align the diamonds was evenly spaced spherical pips along the semi rods, like so module pips(start, finish, n, radius) { d = (finish - start)/(n*2); for (i = [1:2:2*n-1]) translate(start + i*d) sphere(radius); } module flattened_diamond_with_pips(thickness, no_of_pips) { difference() { flattened_diamond(); pips(v[6], v[18], no_of_pips, thickness * 0.52); pips(v[20], v[8], no_of_pips, thickness * 0.52); } pips(v[8], v[18], no_of_pips, thickness * 0.5); pips(v[20], v[6], no_of_pips, thickness * 0.5); } To minimize support I stack the diamonds. module diamond_family(thickness, no_of_pips, n) { z_offset = [0, 0, 2*thickness+1]; for (i = [0:n-1]) translate([0, 0, -v[8][2]]+i*z_offset) flattened_diamond_with_pips(thickness, no_of_pips); } I haven't figured how to generate decent support between the stacked diamonds. No gap and they bond with their neighbour. If I create a gap, the support generated by the slicer (Cura) is almost as solid. Thanks for the clips! i couldn't find the rotFromTo module. Even if I don't use them in the final model, they're handy to hold the skeleton while the glue sets. -- Sent from: http://forum.openscad.org/ _______________________________________________ OpenSCAD mailing list [hidden email] http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org |
Free forum by Nabble | Edit this page |