discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

SVG import

KE
Karl Exler
Sat, Apr 15, 2023 5:19 PM

Gentlemen
Many thanks for all your help. I will close this issue for me with a new
great learning. This is my future solution for similar challenges:


include <bosl2/std.scad>

A=[-85,45];
B=[-75,45];
C=[-65,0];
D=[-0,0];

path=[A,B,C,D];

rotate_extrude($fn=4)
translate([-0.6,0,0])
stroke(path, width=1,closed=false);
cylinder(r=3,h=0.1);

Thanks a lot for your help
Karl

Am 15.04.23 um 17:24 schrieb Karl Exler:

of course I had no semicolon at first:

include <bosl2/std.scad>

A=[-5,5];
B=[-4,5];
C=[-3,0];
D=[0,0];

path=[A,B,C,D];

rotate_extrude()
stroke(path, closed=false);


But without semicolon really nothing happens... not even the stroke
appears

BR
Karl
And many thanks for your patience

Am 15.04.23 um 16:48 schrieb Adrian Mariano:

rotate_extrude() is "failing" because you put a semi-colon after it,
so you've given it no children.   It's fairly easy to screw up your
code with either an extra or missing semicolon.  One way to avoid the
problem in cases like this would be to always use braces.   (In BOSL2
we make it an error to give no children to a module that needs
children to produce output.)

On Sat, Apr 15, 2023 at 10:27 AM Karl Exler karl.exler@meinklang.cc
wrote:

 Sorry Gents!

 The syntax is not sooo selfexplaining ;-)

 ---------
 include <bosl2/std.scad>

 A=[-5,5];
 B=[-4,5];
 C=[-3,0];
 D=[0,0];

 path=[A,B,C,D];

 rotate_extrude();
 stroke(path, closed=false);

 -------------------------------------------------------

 In deed I can draw a path with stroke.. but rotate_extrude() does
 not work... As I want to create something similar like a cup.

 Thanks in advance
 Karl

 Am 14.04.23 um 22:35 schrieb Adrian Mariano:
 The BOSL2 library has stroke() which does this---it takes a list
 of points and turns it into a 2d line of specified width.  If
 you prefer to reinvent the wheel, then you can accomplish this
 by taking the union of hulls of pairs of circles of the desired
 width located at each point.   As already noted, if you want to
 rotate the actual point data, you can do that by using a
 transformation matrix. In BOSL2 you can do
 `zrot(angle,point_list)` to rotate a list of points around the z
 axis.


 On Fri, Apr 14, 2023 at 11:01 AM Karl Exler
 <karl.exler@meinklang.cc> wrote:

     Gentlemen!


     Sometimes I use the import function in Openscad. I draw
     something in
     Inkscape and then I import it and rotate(_extrude) it. This
     works great
     and is a quick hack.

     BUT.... If there are dependencies, variables and so on it is
     not the
     best way. Is there an easy way to draw one (!) path and make it
     afterwards a bit "thicker" ?

     Example:

     I cannot rotate A=([-5,0]) : B([5,0]), because this is not
     an geometric
     figure, only a line. But If I could define a thickness to
     those both
     coordinates it should be possible to rotate them.

     What is your oppinion?
     Thanks
     Karl
     _______________________________________________
     OpenSCAD mailing list
     To unsubscribe send an email to discuss-leave@lists.openscad.org


 _______________________________________________
 OpenSCAD mailing list
 To unsubscribe send an email todiscuss-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 todiscuss-leave@lists.openscad.org


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

Gentlemen Many thanks for all your help. I will close this issue for me with a new great learning. This is my future solution for similar challenges: ------------------------------------------------------------------- include <bosl2/std.scad> A=[-85,45]; B=[-75,45]; C=[-65,0]; D=[-0,0]; path=[A,B,C,D]; rotate_extrude($fn=4) translate([-0.6,0,0]) stroke(path, width=1,closed=false); cylinder(r=3,h=0.1); ---------------------------------------------------------------------- Thanks a lot for your help Karl Am 15.04.23 um 17:24 schrieb Karl Exler: > > of course I had no semicolon at first: > > include <bosl2/std.scad> > > A=[-5,5]; > B=[-4,5]; > C=[-3,0]; > D=[0,0]; > > path=[A,B,C,D]; > > rotate_extrude() > stroke(path, closed=false); > > ------------------------------------------------------- > > But without semicolon really nothing happens... not even the stroke > appears > > BR > Karl > And many thanks for your patience > > > Am 15.04.23 um 16:48 schrieb Adrian Mariano: >> rotate_extrude() is "failing" because you put a semi-colon after it, >> so you've given it no children.   It's fairly easy to screw up your >> code with either an extra or missing semicolon.  One way to avoid the >> problem in cases like this would be to always use braces.   (In BOSL2 >> we make it an error to give no children to a module that needs >> children to produce output.) >> >> On Sat, Apr 15, 2023 at 10:27 AM Karl Exler <karl.exler@meinklang.cc> >> wrote: >> >> Sorry Gents! >> >> The syntax is not sooo selfexplaining ;-) >> >> --------- >> include <bosl2/std.scad> >> >> A=[-5,5]; >> B=[-4,5]; >> C=[-3,0]; >> D=[0,0]; >> >> path=[A,B,C,D]; >> >> rotate_extrude(); >> stroke(path, closed=false); >> >> ------------------------------------------------------- >> >> In deed I can draw a path with stroke.. but rotate_extrude() does >> not work... As I want to create something similar like a cup. >> >> Thanks in advance >> Karl >> >> Am 14.04.23 um 22:35 schrieb Adrian Mariano: >>> The BOSL2 library has stroke() which does this---it takes a list >>> of points and turns it into a 2d line of specified width.  If >>> you prefer to reinvent the wheel, then you can accomplish this >>> by taking the union of hulls of pairs of circles of the desired >>> width located at each point.   As already noted, if you want to >>> rotate the actual point data, you can do that by using a >>> transformation matrix. In BOSL2 you can do >>> `zrot(angle,point_list)` to rotate a list of points around the z >>> axis. >>> >>> >>> On Fri, Apr 14, 2023 at 11:01 AM Karl Exler >>> <karl.exler@meinklang.cc> wrote: >>> >>> Gentlemen! >>> >>> >>> Sometimes I use the import function in Openscad. I draw >>> something in >>> Inkscape and then I import it and rotate(_extrude) it. This >>> works great >>> and is a quick hack. >>> >>> BUT.... If there are dependencies, variables and so on it is >>> not the >>> best way. Is there an easy way to draw one (!) path and make it >>> afterwards a bit "thicker" ? >>> >>> Example: >>> >>> I cannot rotate A=([-5,0]) : B([5,0]), because this is not >>> an geometric >>> figure, only a line. But If I could define a thickness to >>> those both >>> coordinates it should be possible to rotate them. >>> >>> What is your oppinion? >>> Thanks >>> Karl >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email todiscuss-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 todiscuss-leave@lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email todiscuss-leave@lists.openscad.org
JB
Jordan Brown
Sat, Apr 15, 2023 9:25 PM

On 4/15/2023 9:32 AM, nop head wrote:

I think it would only make sense if the angle was less than 180,
otherwise you get a self-intersection.

The scheme I gave - union the results of RXing the positive and negative
components - yields a well-defined answer.  There are no
self-intersections to clean up, because any overlap is between the two
RXed objects, not for any one RXed object.

Whether you actually want objects like that is a whole different
question.  But it would help in cases like Karl's where the slight
intrusion into the other side of the Y axis isn't really important.

On 4/15/2023 9:32 AM, nop head wrote: > I think it would only make sense if the angle was less than 180, > otherwise you get a self-intersection. The scheme I gave - union the results of RXing the positive and negative components - yields a well-defined answer.  There are no self-intersections to clean up, because any overlap is between the two RXed objects, not for any one RXed object. Whether you actually *want* objects like that is a whole different question.  But it would help in cases like Karl's where the slight intrusion into the other side of the Y axis isn't really important.
KE
Karl Exler
Sun, Apr 16, 2023 10:56 AM

Dear all!

So my seed cup is finished. ..nearly... now I have the funny situation
that F5 preview shows my creation. But F6 (render) does only show less
parts. No error message. I am really very gratefull about the many
helping hands here  in this group but on the long run I would like to
get more independent ;-)

And when there even is no error message I have absolutly no idea where
and how to search.. Until now I tried to uncomment parts of my code, but
this did not lead to a solution.

---------------------------------from here

$fn=50;
include <bosl2/std.scad>
Q=170; //Quadrat
H=45;

f=1.08;
f2=0.7;

A=[-Q/2,H];
B=[-Q/2+10,H];
C=[-Q/2+20,0];
D=[-0,0];
path=[A,B,C,D];

a=[-Q/2+5,0,H-3];
b=[Q/2-5,0,H-3];
c=[0,-Q/2+5,H-3];
d=[0,Q/2-5,H-3];

u=37;
w=[-Q/2+u,0];
x=[Q/2-u,0];
y=[0,-Q/2+u];
z=[0,Q/2-u];
j=[0,0];

difference()
{
schale();
for(i=[a,b,c,d,]) translate(i) color ("blue")cylinder(r=1,h=7.5);
};

module schale()

{
union()
    {
        rotate_extrude($fn=4)
        {
            difference()
                {
                    stroke(path, width=1,closed=false);
                    translate([0,-100])
                        square([100,200]);
                }
        }
            for(i=[a,b,c,d]) translate(i) color ("green")
cylinder(r=4,h=3);

            for(a=[j,w,x,y,z]) translate(a) color ("red")
cylinder(h=7,r1=4,r2=6,$fn=8);
    }

}

---------------------------------until here

Am 15.04.23 um 17:52 schrieb Jordan Brown:

I get a reasonable result from chopping off the +X part...

 rotate_extrude() {
      difference() {
          stroke(path, closed=false);
          translate([0,-100])
              square([100,200]);
      }
 }

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

Dear all! So my seed cup is finished. ..nearly... now I have the funny situation that F5 preview shows my creation. But F6 (render) does only show less parts. No error message. I am really very gratefull about the many helping hands here  in this group but on the long run I would like to get more independent ;-) And when there even is no error message I have absolutly no idea where and how to search.. Until now I tried to uncomment parts of my code, but this did not lead to a solution. ---------------------------------from here --------------------------------------------------------------------- $fn=50; include <bosl2/std.scad> Q=170; //Quadrat H=45; f=1.08; f2=0.7; A=[-Q/2,H]; B=[-Q/2+10,H]; C=[-Q/2+20,0]; D=[-0,0]; path=[A,B,C,D]; a=[-Q/2+5,0,H-3]; b=[Q/2-5,0,H-3]; c=[0,-Q/2+5,H-3]; d=[0,Q/2-5,H-3]; u=37; w=[-Q/2+u,0]; x=[Q/2-u,0]; y=[0,-Q/2+u]; z=[0,Q/2-u]; j=[0,0]; difference() { schale(); for(i=[a,b,c,d,]) translate(i) color ("blue")cylinder(r=1,h=7.5); }; module schale() { union()     {         rotate_extrude($fn=4)         {             difference()                 {                     stroke(path, width=1,closed=false);                     translate([0,-100])                         square([100,200]);                 }         }             for(i=[a,b,c,d]) translate(i) color ("green") cylinder(r=4,h=3);             for(a=[j,w,x,y,z]) translate(a) color ("red") cylinder(h=7,r1=4,r2=6,$fn=8);     } } ---------------------------------until here --------------------------------------------------------------------- Am 15.04.23 um 17:52 schrieb Jordan Brown: > I get a reasonable result from chopping off the +X part... > > rotate_extrude() { > difference() { > stroke(path, closed=false); > translate([0,-100]) > square([100,200]); > } > } > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email todiscuss-leave@lists.openscad.org
MM
Michael Möller
Sun, Apr 16, 2023 12:37 PM

I get the "opposite". Some strange artifacts in F5 preview
[image: image.png]
like partially "transparent". That changes as one rotates

But I get a nice result in F6
[image: image.png]
unless there are pieces missing I do not see in either view

Vanilla version OpenSCAD 2021.01 and the BOSL2 is a year old.

On Sun, 16 Apr 2023 at 12:57, Karl Exler karl.exler@meinklang.cc wrote:

Dear all!

So my seed cup is finished. ..nearly... now I have the funny situation
that F5 preview shows my creation. But F6 (render) does only show less
parts. No error message. I am really very gratefull about the many helping
hands here  in this group but on the long run I would like to get more
independent ;-)

And when there even is no error message I have absolutly no idea where and
how to search.. Until now I tried to uncomment parts of my code, but this
did not lead to a solution.

---------------------------------from here

$fn=50;
include <bosl2/std.scad>
Q=170; //Quadrat
H=45;

f=1.08;
f2=0.7;

A=[-Q/2,H];
B=[-Q/2+10,H];
C=[-Q/2+20,0];
D=[-0,0];
path=[A,B,C,D];

a=[-Q/2+5,0,H-3];
b=[Q/2-5,0,H-3];
c=[0,-Q/2+5,H-3];
d=[0,Q/2-5,H-3];

u=37;
w=[-Q/2+u,0];
x=[Q/2-u,0];
y=[0,-Q/2+u];
z=[0,Q/2-u];
j=[0,0];

difference()
{
schale();
for(i=[a,b,c,d,]) translate(i) color ("blue")cylinder(r=1,h=7.5);
};

module schale()

{
union()
{
rotate_extrude($fn=4)
{
difference()
{
stroke(path, width=1,closed=false);
translate([0,-100])
square([100,200]);
}
}
for(i=[a,b,c,d]) translate(i) color ("green")
cylinder(r=4,h=3);

         for(a=[j,w,x,y,z]) translate(a) color ("red")

cylinder(h=7,r1=4,r2=6,$fn=8);
}

}

---------------------------------until here

Am 15.04.23 um 17:52 schrieb Jordan Brown:

I get a reasonable result from chopping off the +X part...

rotate_extrude() {
difference() {
stroke(path, closed=false);
translate([0,-100])
square([100,200]);
}
}


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

I get the "opposite". Some strange artifacts in F5 preview [image: image.png] like partially "transparent". That changes as one rotates But I get a nice result in F6 [image: image.png] unless there are pieces missing I do not see in either view Vanilla version OpenSCAD 2021.01 and the BOSL2 is a year old. On Sun, 16 Apr 2023 at 12:57, Karl Exler <karl.exler@meinklang.cc> wrote: > Dear all! > > So my seed cup is finished. ..nearly... now I have the funny situation > that F5 preview shows my creation. But F6 (render) does only show less > parts. No error message. I am really very gratefull about the many helping > hands here in this group but on the long run I would like to get more > independent ;-) > > And when there even is no error message I have absolutly no idea where and > how to search.. Until now I tried to uncomment parts of my code, but this > did not lead to a solution. > > ---------------------------------from here > --------------------------------------------------------------------- > > > $fn=50; > include <bosl2/std.scad> > Q=170; //Quadrat > H=45; > > f=1.08; > f2=0.7; > > A=[-Q/2,H]; > B=[-Q/2+10,H]; > C=[-Q/2+20,0]; > D=[-0,0]; > path=[A,B,C,D]; > > a=[-Q/2+5,0,H-3]; > b=[Q/2-5,0,H-3]; > c=[0,-Q/2+5,H-3]; > d=[0,Q/2-5,H-3]; > > u=37; > w=[-Q/2+u,0]; > x=[Q/2-u,0]; > y=[0,-Q/2+u]; > z=[0,Q/2-u]; > j=[0,0]; > > > > difference() > { > schale(); > for(i=[a,b,c,d,]) translate(i) color ("blue")cylinder(r=1,h=7.5); > }; > > > > module schale() > > { > union() > { > rotate_extrude($fn=4) > { > difference() > { > stroke(path, width=1,closed=false); > translate([0,-100]) > square([100,200]); > } > } > for(i=[a,b,c,d]) translate(i) color ("green") > cylinder(r=4,h=3); > > for(a=[j,w,x,y,z]) translate(a) color ("red") > cylinder(h=7,r1=4,r2=6,$fn=8); > } > > } > > > ---------------------------------until here > --------------------------------------------------------------------- > > > > Am 15.04.23 um 17:52 schrieb Jordan Brown: > > I get a reasonable result from chopping off the +X part... > > rotate_extrude() { > difference() { > stroke(path, closed=false); > translate([0,-100]) > square([100,200]); > } > } > > > > _______________________________________________ > 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 >
AM
Adrian Mariano
Sun, Apr 16, 2023 12:55 PM

The problem appears to be due to a bug in BOSL2.  If I examine the stroke
under F6 I see this:

[image: image.png]
The extra internal segments are causing the problem.  A quick work-around
for this is to replace stroke with offset_stroke.  This requires including
BOSL2/rounding.scad.

On Sun, Apr 16, 2023 at 8:38 AM Michael Möller private2michael@gmail.com
wrote:

I get the "opposite". Some strange artifacts in F5 preview
[image: image.png]
like partially "transparent". That changes as one rotates

But I get a nice result in F6
[image: image.png]
unless there are pieces missing I do not see in either view

Vanilla version OpenSCAD 2021.01 and the BOSL2 is a year old.

On Sun, 16 Apr 2023 at 12:57, Karl Exler karl.exler@meinklang.cc wrote:

Dear all!

So my seed cup is finished. ..nearly... now I have the funny situation
that F5 preview shows my creation. But F6 (render) does only show less
parts. No error message. I am really very gratefull about the many helping
hands here  in this group but on the long run I would like to get more
independent ;-)

And when there even is no error message I have absolutly no idea where
and how to search.. Until now I tried to uncomment parts of my code, but
this did not lead to a solution.

---------------------------------from here

$fn=50;
include <bosl2/std.scad>
Q=170; //Quadrat
H=45;

f=1.08;
f2=0.7;

A=[-Q/2,H];
B=[-Q/2+10,H];
C=[-Q/2+20,0];
D=[-0,0];
path=[A,B,C,D];

a=[-Q/2+5,0,H-3];
b=[Q/2-5,0,H-3];
c=[0,-Q/2+5,H-3];
d=[0,Q/2-5,H-3];

u=37;
w=[-Q/2+u,0];
x=[Q/2-u,0];
y=[0,-Q/2+u];
z=[0,Q/2-u];
j=[0,0];

difference()
{
schale();
for(i=[a,b,c,d,]) translate(i) color ("blue")cylinder(r=1,h=7.5);
};

module schale()

{
union()
{
rotate_extrude($fn=4)
{
difference()
{
stroke(path, width=1,closed=false);
translate([0,-100])
square([100,200]);
}
}
for(i=[a,b,c,d]) translate(i) color ("green")
cylinder(r=4,h=3);

         for(a=[j,w,x,y,z]) translate(a) color ("red")

cylinder(h=7,r1=4,r2=6,$fn=8);
}

}

---------------------------------until here

Am 15.04.23 um 17:52 schrieb Jordan Brown:

I get a reasonable result from chopping off the +X part...

rotate_extrude() {
difference() {
stroke(path, closed=false);
translate([0,-100])
square([100,200]);
}
}


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

The problem appears to be due to a bug in BOSL2. If I examine the stroke under F6 I see this: [image: image.png] The extra internal segments are causing the problem. A quick work-around for this is to replace stroke with offset_stroke. This requires including BOSL2/rounding.scad. On Sun, Apr 16, 2023 at 8:38 AM Michael Möller <private2michael@gmail.com> wrote: > I get the "opposite". Some strange artifacts in F5 preview > [image: image.png] > like partially "transparent". That changes as one rotates > > But I get a nice result in F6 > [image: image.png] > unless there are pieces missing I do not see in either view > > Vanilla version OpenSCAD 2021.01 and the BOSL2 is a year old. > > On Sun, 16 Apr 2023 at 12:57, Karl Exler <karl.exler@meinklang.cc> wrote: > >> Dear all! >> >> So my seed cup is finished. ..nearly... now I have the funny situation >> that F5 preview shows my creation. But F6 (render) does only show less >> parts. No error message. I am really very gratefull about the many helping >> hands here in this group but on the long run I would like to get more >> independent ;-) >> >> And when there even is no error message I have absolutly no idea where >> and how to search.. Until now I tried to uncomment parts of my code, but >> this did not lead to a solution. >> >> ---------------------------------from here >> --------------------------------------------------------------------- >> >> >> $fn=50; >> include <bosl2/std.scad> >> Q=170; //Quadrat >> H=45; >> >> f=1.08; >> f2=0.7; >> >> A=[-Q/2,H]; >> B=[-Q/2+10,H]; >> C=[-Q/2+20,0]; >> D=[-0,0]; >> path=[A,B,C,D]; >> >> a=[-Q/2+5,0,H-3]; >> b=[Q/2-5,0,H-3]; >> c=[0,-Q/2+5,H-3]; >> d=[0,Q/2-5,H-3]; >> >> u=37; >> w=[-Q/2+u,0]; >> x=[Q/2-u,0]; >> y=[0,-Q/2+u]; >> z=[0,Q/2-u]; >> j=[0,0]; >> >> >> >> difference() >> { >> schale(); >> for(i=[a,b,c,d,]) translate(i) color ("blue")cylinder(r=1,h=7.5); >> }; >> >> >> >> module schale() >> >> { >> union() >> { >> rotate_extrude($fn=4) >> { >> difference() >> { >> stroke(path, width=1,closed=false); >> translate([0,-100]) >> square([100,200]); >> } >> } >> for(i=[a,b,c,d]) translate(i) color ("green") >> cylinder(r=4,h=3); >> >> for(a=[j,w,x,y,z]) translate(a) color ("red") >> cylinder(h=7,r1=4,r2=6,$fn=8); >> } >> >> } >> >> >> ---------------------------------until here >> --------------------------------------------------------------------- >> >> >> >> Am 15.04.23 um 17:52 schrieb Jordan Brown: >> >> I get a reasonable result from chopping off the +X part... >> >> rotate_extrude() { >> difference() { >> stroke(path, closed=false); >> translate([0,-100]) >> square([100,200]); >> } >> } >> >> >> >> _______________________________________________ >> 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 >
K
Ken
Sun, Apr 16, 2023 1:01 PM

Karl, I'm only a beginner with openscad, but I found if I comment out
the difference (as shown at the bottom of the code now) it F6's ok- but
of course you now have studs instead of holes.

Why the difference makes the code misbehave I have no idea.


$fn=50;
include <bosl2/std.scad>
Q=170; //Quadrant
H=45;

f=1.08;
f2=0.7;

A=[-Q/2,H];
B=[-Q/2+10,H];
C=[-Q/2+20,0];
D=[-0,0];
path=[A,B,C,D];

a=[-Q/2+5,0,H-3];
b=[Q/2-5,0,H-3];
c=[0,-Q/2+5,H-3];
d=[0,Q/2-5,H-3];

u=37;
w=[-Q/2+u,0];
x=[Q/2-u,0];
y=[0,-Q/2+u];
z=[0,Q/2-u];
j=[0,0];

module schale()
{
rotate_extrude($fn=4)
{
difference()
{
stroke(path, width=1,closed=false);
translate([0,-100])
square([100,200]);
}
}
}

module holes()
{
for(i=[a,b,c,d,])
translate(i)
color ("blue")
cylinder(r=1,h=7.5);
}

for(i=[a,b,c,d]) translate(i) color ("green") cylinder(r=4,h=3);

for(a=[j,w,x,y,z]) translate(a) color ("red") cylinder(h=7,r1=4,r2=6,$fn=8);

//difference()
//{
schale();
holes();
//}


--
Cheers, Ken
bats059@gmail.com
https://vk7krj.com
https://vk7krj.com/running.html

A baby can be defined as an ego with a noise at one end and a smell at the other.
Your job as parents is to teach them to control all three.
My job as a grandad is to tell you how you are doing it all wrong!

Karl, I'm only a beginner with openscad, but I found if I comment out the difference (as shown at the bottom of the code now) it F6's ok- but of course you now have studs instead of holes. Why the difference makes the code misbehave I have no idea. ************************************************ $fn=50; include <bosl2/std.scad> Q=170; //Quadrant H=45; f=1.08; f2=0.7; A=[-Q/2,H]; B=[-Q/2+10,H]; C=[-Q/2+20,0]; D=[-0,0]; path=[A,B,C,D]; a=[-Q/2+5,0,H-3]; b=[Q/2-5,0,H-3]; c=[0,-Q/2+5,H-3]; d=[0,Q/2-5,H-3]; u=37; w=[-Q/2+u,0]; x=[Q/2-u,0]; y=[0,-Q/2+u]; z=[0,Q/2-u]; j=[0,0]; module schale() { rotate_extrude($fn=4) { difference() { stroke(path, width=1,closed=false); translate([0,-100]) square([100,200]); } } } module holes() { for(i=[a,b,c,d,]) translate(i) color ("blue") cylinder(r=1,h=7.5); } for(i=[a,b,c,d]) translate(i) color ("green") cylinder(r=4,h=3); for(a=[j,w,x,y,z]) translate(a) color ("red") cylinder(h=7,r1=4,r2=6,$fn=8); //difference() //{ schale(); holes(); //} *********************************************************** -- Cheers, Ken bats059@gmail.com https://vk7krj.com https://vk7krj.com/running.html ---------------------------------------- A baby can be defined as an ego with a noise at one end and a smell at the other. Your job as parents is to teach them to control all three. My job as a grandad is to tell you how you are doing it all wrong!
AM
Adrian Mariano
Sun, Apr 16, 2023 1:15 PM

When you have invalid geometry in your model, you never know exactly when
or how it's going to fail to render.  A single invalid object will
generally render OK, with problems only arising when you have at least two
objects.  You can find that the object(s) just don't appear, or you get
cryptic errors from CGAL in the console.  When this happens you need to go
through your model part by part, one object at a time, unioning with a
cube, to identify the bad object.

I posted a fix for the BOSL2 stroke bug---it may take a day to get into the
main version.

The problem of erratic transparency in the preview is fixed by adding
convexity=4 to the rotate_extrude call.

On Sun, Apr 16, 2023 at 9:02 AM Ken bats059@gmail.com wrote:

Karl, I'm only a beginner with openscad, but I found if I comment out
the difference (as shown at the bottom of the code now) it F6's ok- but
of course you now have studs instead of holes.

Why the difference makes the code misbehave I have no idea.


$fn=50;
include <bosl2/std.scad>
Q=170; //Quadrant
H=45;

f=1.08;
f2=0.7;

A=[-Q/2,H];
B=[-Q/2+10,H];
C=[-Q/2+20,0];
D=[-0,0];
path=[A,B,C,D];

a=[-Q/2+5,0,H-3];
b=[Q/2-5,0,H-3];
c=[0,-Q/2+5,H-3];
d=[0,Q/2-5,H-3];

u=37;
w=[-Q/2+u,0];
x=[Q/2-u,0];
y=[0,-Q/2+u];
z=[0,Q/2-u];
j=[0,0];

module schale()
{
rotate_extrude($fn=4)
{
difference()
{
stroke(path, width=1,closed=false);
translate([0,-100])
square([100,200]);
}
}
}

module holes()
{
for(i=[a,b,c,d,])
translate(i)
color ("blue")
cylinder(r=1,h=7.5);
}

for(i=[a,b,c,d]) translate(i) color ("green") cylinder(r=4,h=3);

for(a=[j,w,x,y,z]) translate(a) color ("red")
cylinder(h=7,r1=4,r2=6,$fn=8);

//difference()
//{
schale();
holes();
//}


--
Cheers, Ken
bats059@gmail.com
https://vk7krj.com
https://vk7krj.com/running.html

A baby can be defined as an ego with a noise at one end and a smell at the
other.
Your job as parents is to teach them to control all three.
My job as a grandad is to tell you how you are doing it all wrong!


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

When you have invalid geometry in your model, you never know exactly when or how it's going to fail to render. A single invalid object will generally render OK, with problems only arising when you have at least two objects. You can find that the object(s) just don't appear, or you get cryptic errors from CGAL in the console. When this happens you need to go through your model part by part, one object at a time, unioning with a cube, to identify the bad object. I posted a fix for the BOSL2 stroke bug---it may take a day to get into the main version. The problem of erratic transparency in the preview is fixed by adding convexity=4 to the rotate_extrude call. On Sun, Apr 16, 2023 at 9:02 AM Ken <bats059@gmail.com> wrote: > Karl, I'm only a beginner with openscad, but I found if I comment out > the difference (as shown at the bottom of the code now) it F6's ok- but > of course you now have studs instead of holes. > > Why the difference makes the code misbehave I have no idea. > > ************************************************ > > $fn=50; > include <bosl2/std.scad> > Q=170; //Quadrant > H=45; > > f=1.08; > f2=0.7; > > A=[-Q/2,H]; > B=[-Q/2+10,H]; > C=[-Q/2+20,0]; > D=[-0,0]; > path=[A,B,C,D]; > > a=[-Q/2+5,0,H-3]; > b=[Q/2-5,0,H-3]; > c=[0,-Q/2+5,H-3]; > d=[0,Q/2-5,H-3]; > > u=37; > w=[-Q/2+u,0]; > x=[Q/2-u,0]; > y=[0,-Q/2+u]; > z=[0,Q/2-u]; > j=[0,0]; > > module schale() > { > rotate_extrude($fn=4) > { > difference() > { > stroke(path, width=1,closed=false); > translate([0,-100]) > square([100,200]); > } > } > } > > module holes() > { > for(i=[a,b,c,d,]) > translate(i) > color ("blue") > cylinder(r=1,h=7.5); > } > > for(i=[a,b,c,d]) translate(i) color ("green") cylinder(r=4,h=3); > > for(a=[j,w,x,y,z]) translate(a) color ("red") > cylinder(h=7,r1=4,r2=6,$fn=8); > > //difference() > //{ > schale(); > holes(); > //} > > *********************************************************** > > -- > Cheers, Ken > bats059@gmail.com > https://vk7krj.com > https://vk7krj.com/running.html > ---------------------------------------- > A baby can be defined as an ego with a noise at one end and a smell at the > other. > Your job as parents is to teach them to control all three. > My job as a grandad is to tell you how you are doing it all wrong! > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
JB
Jordan Brown
Sun, Apr 16, 2023 3:06 PM

OpenSCAD caches rendered parts, and sometimes that doesn't behave well -
it will cache the results of a failing render, and then a subsequent
F6 won't attempt to render that subassembly and so won't encounter and
report the error.

When you're needing to track down that kind of error, use Design / Flush
Caches before every F6.

OpenSCAD caches rendered parts, and sometimes that doesn't behave well - it will cache the results of a *failing* render, and then a subsequent F6 won't attempt to render that subassembly and so won't encounter and report the error. When you're needing to track down that kind of error, use Design / Flush Caches before every F6.