discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: F5 / F6 – bug?

TP
Torsten Paul
Tue, Jun 28, 2022 8:28 PM

This type of script generating a huge amount of operations is not
going to work with the release version. It's really just causing
lots of calculations that are slow in the geometry engine.

It does render in less than a minute for me using the dev snapshot
with the "fast-csg" experimental features enabled.

ciao,
Torsten.

This type of script generating a huge amount of operations is not going to work with the release version. It's really just causing lots of calculations that are slow in the geometry engine. It does render in less than a minute for me using the dev snapshot with the "fast-csg" experimental features enabled. ciao, Torsten.
FH
Father Horton
Tue, Jun 28, 2022 10:08 PM

Don't do CSG. OpenSCAD tempts you to do it, but don't. Instead, do this in
2D, linear_extrude it, and attach the appropriate-sized square to the
bottom.

r_min = 164;
r_max = 179;
rminsq = r_min * r_min;
rmaxsq = r_max * r_max;
s60 = sin(60); // If OpenSCAD caches function calls, this won't help
c60 = cos(60); // Ditto

linear_extrude(0.4) {
difference(){
// translate([0,0,-5])
square([400,400], center = true);
for(i=[-500:1.6:500], j=[-500:1.6:500])
if(rminsq < (js6)^2 + (i+jc60)^2 && (js60)^2 + (i+jc60)^2 <
rmaxsq)
translate([js6,i+jc60])
resize(1.2, 1.6) circle($fn = 6, r = 1);
}
}

You've got a lot of rotational symmetry to use too, although that 60 degree
angle makes it harder. If you can get this down to quadrants or (even
better) octants, you can speed it up that way too.

Don't do CSG. OpenSCAD tempts you to do it, but don't. Instead, do this in 2D, linear_extrude it, and attach the appropriate-sized square to the bottom. r_min = 164; r_max = 179; rminsq = r_min * r_min; rmaxsq = r_max * r_max; s60 = sin(60); // If OpenSCAD caches function calls, this won't help c60 = cos(60); // Ditto linear_extrude(0.4) { difference(){ // translate([0,0,-5]) square([400,400], center = true); for(i=[-500:1.6:500], j=[-500:1.6:500]) if(rminsq < (j*s6)^2 + (i+j*c60)^2 && (j*s60)^2 + (i+j*c60)^2 < rmaxsq) translate([j*s6,i+j*c60]) resize(1.2, 1.6) circle($fn = 6, r = 1); } } You've got a lot of rotational symmetry to use too, although that 60 degree angle makes it harder. If you can get this down to quadrants or (even better) octants, you can speed it up that way too.
JG
Joe Greene
Tue, Jun 28, 2022 10:13 PM

Hey now no dissing the hextents... hexagons are the bestagons!

On Tue, Jun 28, 2022, 18:08 Father Horton fatherhorton@gmail.com wrote:

Don't do CSG. OpenSCAD tempts you to do it, but don't. Instead, do this in
2D, linear_extrude it, and attach the appropriate-sized square to the
bottom.

r_min = 164;
r_max = 179;
rminsq = r_min * r_min;
rmaxsq = r_max * r_max;
s60 = sin(60); // If OpenSCAD caches function calls, this won't help
c60 = cos(60); // Ditto

linear_extrude(0.4) {
difference(){
// translate([0,0,-5])
square([400,400], center = true);
for(i=[-500:1.6:500], j=[-500:1.6:500])
if(rminsq < (js6)^2 + (i+jc60)^2 && (js60)^2 + (i+jc60)^2 <
rmaxsq)
translate([js6,i+jc60])
resize(1.2, 1.6) circle($fn = 6, r = 1);
}
}

You've got a lot of rotational symmetry to use too, although that 60
degree angle makes it harder. If you can get this down to quadrants or
(even better) octants, you can speed it up that way too.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Hey now no dissing the hextents... hexagons are the bestagons! On Tue, Jun 28, 2022, 18:08 Father Horton <fatherhorton@gmail.com> wrote: > > Don't do CSG. OpenSCAD tempts you to do it, but don't. Instead, do this in > 2D, linear_extrude it, and attach the appropriate-sized square to the > bottom. > > r_min = 164; > r_max = 179; > rminsq = r_min * r_min; > rmaxsq = r_max * r_max; > s60 = sin(60); // If OpenSCAD caches function calls, this won't help > c60 = cos(60); // Ditto > > linear_extrude(0.4) { > difference(){ > // translate([0,0,-5]) > square([400,400], center = true); > for(i=[-500:1.6:500], j=[-500:1.6:500]) > if(rminsq < (j*s6)^2 + (i+j*c60)^2 && (j*s60)^2 + (i+j*c60)^2 < > rmaxsq) > translate([j*s6,i+j*c60]) > resize(1.2, 1.6) circle($fn = 6, r = 1); > } > } > > You've got a lot of rotational symmetry to use too, although that 60 > degree angle makes it harder. If you can get this down to quadrants or > (even better) octants, you can speed it up that way too. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
FH
Father Horton
Tue, Jun 28, 2022 10:34 PM

Oddly, circle() doesn't allow for differing radiuses. It makes life a
little trickier.

On Tue, Jun 28, 2022 at 5:13 PM Joe Greene volgclawtooth@gmail.com wrote:

Hey now no dissing the hextents... hexagons are the bestagons!

On Tue, Jun 28, 2022, 18:08 Father Horton fatherhorton@gmail.com wrote:

Don't do CSG. OpenSCAD tempts you to do it, but don't. Instead, do this
in 2D, linear_extrude it, and attach the appropriate-sized square to the
bottom.

r_min = 164;
r_max = 179;
rminsq = r_min * r_min;
rmaxsq = r_max * r_max;
s60 = sin(60); // If OpenSCAD caches function calls, this won't help
c60 = cos(60); // Ditto

linear_extrude(0.4) {
difference(){
// translate([0,0,-5])
square([400,400], center = true);
for(i=[-500:1.6:500], j=[-500:1.6:500])
if(rminsq < (js6)^2 + (i+jc60)^2 && (js60)^2 + (i+jc60)^2 <
rmaxsq)
translate([js6,i+jc60])
resize(1.2, 1.6) circle($fn = 6, r = 1);
}
}

You've got a lot of rotational symmetry to use too, although that 60
degree angle makes it harder. If you can get this down to quadrants or
(even better) octants, you can speed it up that way too.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Oddly, circle() doesn't allow for differing radiuses. It makes life a little trickier. On Tue, Jun 28, 2022 at 5:13 PM Joe Greene <volgclawtooth@gmail.com> wrote: > Hey now no dissing the hextents... hexagons are the bestagons! > > On Tue, Jun 28, 2022, 18:08 Father Horton <fatherhorton@gmail.com> wrote: > >> >> Don't do CSG. OpenSCAD tempts you to do it, but don't. Instead, do this >> in 2D, linear_extrude it, and attach the appropriate-sized square to the >> bottom. >> >> r_min = 164; >> r_max = 179; >> rminsq = r_min * r_min; >> rmaxsq = r_max * r_max; >> s60 = sin(60); // If OpenSCAD caches function calls, this won't help >> c60 = cos(60); // Ditto >> >> linear_extrude(0.4) { >> difference(){ >> // translate([0,0,-5]) >> square([400,400], center = true); >> for(i=[-500:1.6:500], j=[-500:1.6:500]) >> if(rminsq < (j*s6)^2 + (i+j*c60)^2 && (j*s60)^2 + (i+j*c60)^2 < >> rmaxsq) >> translate([j*s6,i+j*c60]) >> resize(1.2, 1.6) circle($fn = 6, r = 1); >> } >> } >> >> You've got a lot of rotational symmetry to use too, although that 60 >> degree angle makes it harder. If you can get this down to quadrants or >> (even better) octants, you can speed it up that way too. >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
OL
Orkus Lambada
Thu, Jun 30, 2022 8:16 AM

Thank you very much, Torsten, Father Horton and Joe for your clarifications!

Your ideas solved the problem; i was able to reduce the computational load enough.

I failed in compiling OpenSCAD from source, but that is another problem. I don't know if i am ready to tackle that…

Just for the case, that it was something obvious; i had to compile and install cmake (3.20.0), CGAL-5.4.1 and gmp-6.2.1 … When i use check-dependencies.sh it shows evrything as OK but gives warnings:

Warning: you have a copy of CGAL under /usr/local/include
Warning: you have a copy of gmp.h under /usr/local/include
Warning: you have pkgconfig under /usr/local/lib

But when i try to "make" OpenSCAD, a fatal error occurs a 8%:

In file included from /usr/local/include/CGAL/Surface_mesh/Surface_mesh.h:24:0,
                 from /usr/local/include/CGAL/Surface_mesh.h:18,
                 from /home/bloemle/Downloads/openscad/src/geometry/cgal/cgal.h:24,
                 from /home/bloemle/Downloads/openscad/src/geometry/cgal/CGAL_Nef_polyhedron.h:3,
                 from /home/bloemle/Downloads/openscad/src/openscad.cc:60:
/usr/local/include/CGAL/boost/graph/copy_face_graph.h:28:10: fatal error: boost/iterator/function_output_iterator.hpp: Datei oder Verzeichnis nicht gefunden
 #include <boost/iterator/function_output_iterator.hpp>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Is there something obvious, that i missed?

Thank you
Orkus

Am Mittwoch, 29. Juni 2022 um 00:35:58 MESZ hat Father Horton <fatherhorton@gmail.com> Folgendes geschrieben:  

Oddly, circle() doesn't allow for differing radiuses. It makes life a little trickier.
On Tue, Jun 28, 2022 at 5:13 PM Joe Greene volgclawtooth@gmail.com wrote:

Hey now no dissing the hextents... hexagons are the bestagons!
On Tue, Jun 28, 2022, 18:08 Father Horton fatherhorton@gmail.com wrote:

Don't do CSG. OpenSCAD tempts you to do it, but don't. Instead, do this in 2D, linear_extrude it, and attach the appropriate-sized square to the bottom.
r_min = 164;
r_max = 179;
rminsq = r_min * r_min;
rmaxsq = r_max * r_max;
s60 = sin(60); // If OpenSCAD caches function calls, this won't help
c60 = cos(60); // Ditto

linear_extrude(0.4) {
    difference(){
     // translate([0,0,-5])
      square([400,400], center = true);
        for(i=[-500:1.6:500], j=[-500:1.6:500])
          if(rminsq < (js6)^2 + (i+jc60)^2 && (js60)^2 + (i+jc60)^2 < rmaxsq)
            translate([js6,i+jc60])
            resize(1.2, 1.6) circle($fn = 6, r = 1);
    }
}
You've got a lot of rotational symmetry to use too, although that 60 degree angle makes it harder. If you can get this down to quadrants or (even better) octants, you can speed it up that way too._______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Thank you very much, Torsten, Father Horton and Joe for your clarifications! Your ideas solved the problem; i was able to reduce the computational load enough. I failed in compiling OpenSCAD from source, but that is another problem. I don't know if i am ready to tackle that… Just for the case, that it was something obvious; i had to compile and install cmake (3.20.0), CGAL-5.4.1 and gmp-6.2.1 … When i use check-dependencies.sh it shows evrything as OK but gives warnings: Warning: you have a copy of CGAL under /usr/local/include Warning: you have a copy of gmp.h under /usr/local/include Warning: you have pkgconfig under /usr/local/lib But when i try to "make" OpenSCAD, a fatal error occurs a 8%: In file included from /usr/local/include/CGAL/Surface_mesh/Surface_mesh.h:24:0,                  from /usr/local/include/CGAL/Surface_mesh.h:18,                  from /home/bloemle/Downloads/openscad/src/geometry/cgal/cgal.h:24,                  from /home/bloemle/Downloads/openscad/src/geometry/cgal/CGAL_Nef_polyhedron.h:3,                  from /home/bloemle/Downloads/openscad/src/openscad.cc:60: /usr/local/include/CGAL/boost/graph/copy_face_graph.h:28:10: fatal error: boost/iterator/function_output_iterator.hpp: Datei oder Verzeichnis nicht gefunden  #include <boost/iterator/function_output_iterator.hpp>           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. Is there something obvious, that i missed? Thank you Orkus Am Mittwoch, 29. Juni 2022 um 00:35:58 MESZ hat Father Horton <fatherhorton@gmail.com> Folgendes geschrieben: Oddly, circle() doesn't allow for differing radiuses. It makes life a little trickier. On Tue, Jun 28, 2022 at 5:13 PM Joe Greene <volgclawtooth@gmail.com> wrote: Hey now no dissing the hextents... hexagons are the bestagons! On Tue, Jun 28, 2022, 18:08 Father Horton <fatherhorton@gmail.com> wrote: Don't do CSG. OpenSCAD tempts you to do it, but don't. Instead, do this in 2D, linear_extrude it, and attach the appropriate-sized square to the bottom. r_min = 164; r_max = 179; rminsq = r_min * r_min; rmaxsq = r_max * r_max; s60 = sin(60); // If OpenSCAD caches function calls, this won't help c60 = cos(60); // Ditto linear_extrude(0.4) {     difference(){      // translate([0,0,-5])       square([400,400], center = true);         for(i=[-500:1.6:500], j=[-500:1.6:500])           if(rminsq < (j*s6)^2 + (i+j*c60)^2 && (j*s60)^2 + (i+j*c60)^2 < rmaxsq)             translate([j*s6,i+j*c60])             resize(1.2, 1.6) circle($fn = 6, r = 1);     } } You've got a lot of rotational symmetry to use too, although that 60 degree angle makes it harder. If you can get this down to quadrants or (even better) octants, you can speed it up that way too._______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org