bug!

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

bug!

Triffid Hunter
hey, just found something really strange:

difference() {

rotate_extrude(convexity=10)

difference() {

circle(80);

circle(77);

translate([-100,-200]) square(200);

}

cylinder(r=30, h=100);

}


makes something pretty broken! in F5, there are clearly faces missing where the cylinder cuts out the hemisphere, and F6 gives the cylinder only

there's also some weird distortion that's visible from certain angles near the crown of the hemisphere in F5

using 7470a7 (Wed May 8 00:12:54 2013 +0200), CGAL-4.1 and opencsg-1.3.2


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: bug!

Triffid Hunter
the roughly equivalent

difference() {

sphere(80);

sphere(77);

translate([-100, -100, -200]) cube(200);

cylinder(r=30, h=100);

}


works fine. I tend to prefer to rotate 2d shapes so my computer doesn't choke as much when I reduce $fs



On 13 May 2013 22:47, Triffid Hunter <[hidden email]> wrote:
hey, just found something really strange:

difference() {

rotate_extrude(convexity=10)

difference() {

circle(80);

circle(77);

translate([-100,-200]) square(200);

}

cylinder(r=30, h=100);

}


makes something pretty broken! in F5, there are clearly faces missing where the cylinder cuts out the hemisphere, and F6 gives the cylinder only

there's also some weird distortion that's visible from certain angles near the crown of the hemisphere in F5

using 7470a7 (Wed May 8 00:12:54 2013 +0200), CGAL-4.1 and opencsg-1.3.2



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: bug!

nophead
Is it because you rotate half a ring to get a hemisphere but it should be just a quarter of a ring?


On 13 May 2013 13:53, Triffid Hunter <[hidden email]> wrote:
the roughly equivalent

difference() {

sphere(80);

sphere(77);

translate([-100, -100, -200]) cube(200);

cylinder(r=30, h=100);

}


works fine. I tend to prefer to rotate 2d shapes so my computer doesn't choke as much when I reduce $fs



On 13 May 2013 22:47, Triffid Hunter <[hidden email]> wrote:
hey, just found something really strange:

difference() {

rotate_extrude(convexity=10)

difference() {

circle(80);

circle(77);

translate([-100,-200]) square(200);

}

cylinder(r=30, h=100);

}


makes something pretty broken! in F5, there are clearly faces missing where the cylinder cuts out the hemisphere, and F6 gives the cylinder only

there's also some weird distortion that's visible from certain angles near the crown of the hemisphere in F5

using 7470a7 (Wed May 8 00:12:54 2013 +0200), CGAL-4.1 and opencsg-1.3.2



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: bug!

Triffid Hunter
On 13 May 2013 23:00, nop head <[hidden email]> wrote:
Is it because you rotate half a ring to get a hemisphere but it should be just a quarter of a ring?

hm, that might have something to do with it, let me have a look.. surely that shouldn't make the whole thing disappear though?

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: bug!

nophead
Well if it rotates it 360 degrees you will have exactly coincident faces as it overlaps itself, which tends to not work in CSG.


On 13 May 2013 14:13, Triffid Hunter <[hidden email]> wrote:
On 13 May 2013 23:00, nop head <[hidden email]> wrote:
Is it because you rotate half a ring to get a hemisphere but it should be just a quarter of a ring?

hm, that might have something to do with it, let me have a look.. surely that shouldn't make the whole thing disappear though?

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: bug!

Peter Falke
In reply to this post by nophead
This already looks strange:

#difference() {


circle(80);


circle(60);


translate([-100,-200]) square(200);


}


There is a lid/botton of zero hight were the square was subtracted.

If you cange # to % then F5 doesn't show anything, anymore.


Now, if you rotate only a quarter of a circle it works fine with F5 and F6.


But # on the 2-dim object is still funny.




On 13 May 2013 15:00, nop head <[hidden email]> wrote:
Is it because you rotate half a ring to get a hemisphere but it should be just a quarter of a ring?


On 13 May 2013 13:53, Triffid Hunter <[hidden email]> wrote:
the roughly equivalent

difference() {

sphere(80);

sphere(77);

translate([-100, -100, -200]) cube(200);

cylinder(r=30, h=100);

}


works fine. I tend to prefer to rotate 2d shapes so my computer doesn't choke as much when I reduce $fs



On 13 May 2013 22:47, Triffid Hunter <[hidden email]> wrote:
hey, just found something really strange:

difference() {

rotate_extrude(convexity=10)

difference() {

circle(80);

circle(77);

translate([-100,-200]) square(200);

}

cylinder(r=30, h=100);

}


makes something pretty broken! in F5, there are clearly faces missing where the cylinder cuts out the hemisphere, and F6 gives the cylinder only

there's also some weird distortion that's visible from certain angles near the crown of the hemisphere in F5

using 7470a7 (Wed May 8 00:12:54 2013 +0200), CGAL-4.1 and opencsg-1.3.2



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566



--
[hidden email]

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: bug!

Peter Falke
Why is rotate_extrude faster then using a sphere?


On 13 May 2013 15:23, Peter Falke <[hidden email]> wrote:
This already looks strange:

#difference() {


circle(80);


circle(60);


translate([-100,-200]) square(200);


}


There is a lid/botton of zero hight were the square was subtracted.

If you cange # to % then F5 doesn't show anything, anymore.


Now, if you rotate only a quarter of a circle it works fine with F5 and F6.


But # on the 2-dim object is still funny.




On 13 May 2013 15:00, nop head <[hidden email]> wrote:
Is it because you rotate half a ring to get a hemisphere but it should be just a quarter of a ring?


On 13 May 2013 13:53, Triffid Hunter <[hidden email]> wrote:
the roughly equivalent

difference() {

sphere(80);

sphere(77);

translate([-100, -100, -200]) cube(200);

cylinder(r=30, h=100);

}


works fine. I tend to prefer to rotate 2d shapes so my computer doesn't choke as much when I reduce $fs



On 13 May 2013 22:47, Triffid Hunter <[hidden email]> wrote:
hey, just found something really strange:

difference() {

rotate_extrude(convexity=10)

difference() {

circle(80);

circle(77);

translate([-100,-200]) square(200);

}

cylinder(r=30, h=100);

}


makes something pretty broken! in F5, there are clearly faces missing where the cylinder cuts out the hemisphere, and F6 gives the cylinder only

there's also some weird distortion that's visible from certain angles near the crown of the hemisphere in F5

using 7470a7 (Wed May 8 00:12:54 2013 +0200), CGAL-4.1 and opencsg-1.3.2



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566



--
[hidden email]

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!



--
[hidden email]

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: bug!

Triffid Hunter
On 13 May 2013 23:30, Peter Falke <[hidden email]> wrote:
Why is rotate_extrude faster then using a sphere?

because when I cut the 2d shape down before rotating it, openscad has to handle a LOT fewer facets. I've used this technique on several models, and it makes a very significant difference in processing time.

I designed a volume knob with a shallow dome on top, which made an extremely poignant example of this; here's the relevant section:

$fa = 1;

$fs = 0.5;


two_d = 1; // change me to see MASSIVE difference in speed and ram usage despite identical result!


h = 3; // height of dome

r = 30; // radius of dome


a = ((h * h) + (r * r)) / (2 * h); // find the radius of the sphere that forms the dome


echo(a);


if (two_d) {

rotate_extrude(convexity = 5)

translate([0, -a + h])

difference() {

circle(a);

translate([-a - a - 2, -a - 1]) square(a + a + 2);

translate([-1, -a -h]) square(a * 2);

}

}

else {

translate([0, 0, -a + h])

difference() {

sphere(a);

translate([a * -1.5, a * -1.5, a * -2 - h]) cube([a * 3, a * 3, a * 3]);

}

}



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: bug!

kintel
Administrator
In reply to this post by Triffid Hunter
On 2013-05-13, at 09:13 , Triffid Hunter wrote:

> hm, that might have something to do with it, let me have a look.. surely that shouldn't make the whole thing disappear though?

nophead is right - overlapping facets cause rendering artifacts, which can make the object partially disappear where the overlaps happen. Making it a quarter circle makes it look good.

 -Marius

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: bug!

kintel
Administrator
In reply to this post by Peter Falke
On 2013-05-13, at 09:23 , Peter Falke wrote:
>
> There is a lid/botton of zero hight were the square was subtracted.
> If you cange # to % then F5 doesn't show anything, anymore.
>
Using % when there is only one object in the scene doesn't work. Perhaps we should allow this though..

The # issue is just a rendering artifact - we render different modifiers with different Z sizes. It's not damaging to the actual object as it's just visible in F5 mode.

 -Marius

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: bug!

Peter Falke
Ah, now I understand.

Yes, allowing % on all objects would be nice,Just because of the confusion it causes when nothing is displayed.


On 13 May 2013 16:20, Marius Kintel <[hidden email]> wrote:
On 2013-05-13, at 09:23 , Peter Falke wrote:
>
> There is a lid/botton of zero hight were the square was subtracted.
> If you cange # to % then F5 doesn't show anything, anymore.
>
Using % when there is only one object in the scene doesn't work. Perhaps we should allow this though..

The # issue is just a rendering artifact - we render different modifiers with different Z sizes. It's not damaging to the actual object as it's just visible in F5 mode.

 -Marius

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566



--
[hidden email]

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: bug!

kintel
Administrator
On 2013-05-13, at 10:38 , Peter Falke wrote:
>
> Yes, allowing % on all objects would be nice,Just because of the confusion it causes when nothing is displayed.
>
See https://github.com/openscad/openscad/issues/304

 -Marius

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566