discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

half sphere with pattern

KE
Karl Exler
Fri, May 31, 2024 10:38 AM

Dear all
I have an SVG file (see attachement) and I would like to attach it to a
half sphere. The idea is to put it on a LED light and have beautiful
shadows on the wall.

many thanks
Karl

Dear all I have an SVG file (see attachement) and I would like to attach it to a half sphere. The idea is to put it on a LED light and have beautiful shadows on the wall. many thanks Karl
RW
Raymond West
Fri, May 31, 2024 7:54 PM

You can map an image to a cylinder, but not to half a sphere without
some distortion. I cannot successfully import your wallpaper image into
openscad, but if you can, it will probably not appear where you expect
it to.  With your image, if successfully imported, parts are likely to
fall out, if punched right through. I've shown a bit of code, some to
generate an SVG that openscad can handle, although as usual, it is
shifted. The other uncommented code punches it through a thin dome. I
think that is the simplest solution. It may be better if your image was
distorted, so that it was compressed at the edges, and expanded in the
centre.  Of course, you could cut the image more or less into triangles,
and treat the sphere as some other shape with flat faces.

  intersection(){
difference(){
        sphere(50/2);
        sphere((50/2)-2);
           }
       pat();
 }

/*
module svg(){
            difference(){
                square(50,true);
                    translate([-10,-10])circle (d=4);
                     circle(d=3);
                        translate([10,10])circle (d=4);
                         translate([15,8])circle (d=4);
                        translate([-20,20])circle (d=4);
                        translate([-10,10])circle (d=4);
           }
}
svg();
*/

module pat(){
    translate([-25,-75,0]) // to make svg centered
       linear_extrude(30)
         import("C:/Users/ray/Documents/pat.svg");
}

On 31/05/2024 11:38, Karl Exler via Discuss wrote:

Dear all
I have an SVG file (see attachement) and I would like to attach it to
a half sphere. The idea is to put it on a LED light and have beautiful
shadows on the wall.

many thanks
Karl


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

You can map an image to a cylinder, but not to half a sphere without some distortion. I cannot successfully import your wallpaper image into openscad, but if you can, it will probably not appear where you expect it to.  With your image, if successfully imported, parts are likely to fall out, if punched right through. I've shown a bit of code, some to generate an SVG that openscad can handle, although as usual, it is shifted. The other uncommented code punches it through a thin dome. I think that is the simplest solution. It may be better if your image was distorted, so that it was compressed at the edges, and expanded in the centre.  Of course, you could cut the image more or less into triangles, and treat the sphere as some other shape with flat faces.   intersection(){ difference(){         sphere(50/2);         sphere((50/2)-2);            }        pat();  } /* module svg(){             difference(){                 square(50,true);                     translate([-10,-10])circle (d=4);                      circle(d=3);                         translate([10,10])circle (d=4);                          translate([15,8])circle (d=4);                         translate([-20,20])circle (d=4);                         translate([-10,10])circle (d=4);            } } svg(); */ module pat(){     translate([-25,-75,0]) // to make svg centered        linear_extrude(30)          import("C:/Users/ray/Documents/pat.svg"); } On 31/05/2024 11:38, Karl Exler via Discuss wrote: > Dear all > I have an SVG file (see attachement) and I would like to attach it to > a half sphere. The idea is to put it on a LED light and have beautiful > shadows on the wall. > > many thanks > Karl > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
JO
jjvb-openscad@bassklampfe.de
Fri, May 31, 2024 8:03 PM

Am 31.05.24 um 12:38 schrieb Karl Exler via Discuss:

Dear all
I have an SVG file (see attachement) and I would like to attach it to

a half sphere. The idea is to put it on a LED light and have beautiful
shadows on the wall.

many thanks
Karl


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

Maybe you should read https://en.wikipedia.org/wiki/Map_projection .
This is the reverse operation (Sphere to plane), but it may show up
possible issues with these kind of operations to you. And maybe it give
you some ideas, how to solve your problem.

Am 31.05.24 um 12:38 schrieb Karl Exler via Discuss: > Dear all > I have an SVG file (see attachement) and I would like to attach it to a half sphere. The idea is to put it on a LED light and have beautiful shadows on the wall. > > many thanks > Karl > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org Maybe you should read https://en.wikipedia.org/wiki/Map_projection . This is the reverse operation (Sphere to plane), but it may show up possible issues with these kind of operations to you. And maybe it give you some ideas, how to solve your problem.
AM
Adrian Mariano
Fri, May 31, 2024 8:34 PM

Are you trying to make a cutout or apply a texture to make something with
thin and thick regions?  You can probably apply a texture using the BOSL2
texturing capability with rotate_sweep().  I feel like this specific topic
(maybe even with a world map example) was discussed here kind of
recently.  This would require converting the SVG to a bitmap which you
then use as the texture input.

https://github.com/BelfrySCAD/BOSL2/wiki/skin.scad#functionmodule-rotate_sweep

On Fri, May 31, 2024 at 6:39 AM Karl Exler via Discuss <
discuss@lists.openscad.org> wrote:

Dear all
I have an SVG file (see attachement) and I would like to attach it to a
half sphere. The idea is to put it on a LED light and have beautiful
shadows on the wall.

many thanks
Karl


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

Are you trying to make a cutout or apply a texture to make something with thin and thick regions? You can probably apply a texture using the BOSL2 texturing capability with rotate_sweep(). I feel like this specific topic (maybe even with a world map example) was discussed here kind of recently. This would require converting the SVG to a bitmap which you then use as the texture input. https://github.com/BelfrySCAD/BOSL2/wiki/skin.scad#functionmodule-rotate_sweep On Fri, May 31, 2024 at 6:39 AM Karl Exler via Discuss < discuss@lists.openscad.org> wrote: > Dear all > I have an SVG file (see attachement) and I would like to attach it to a > half sphere. The idea is to put it on a LED light and have beautiful > shadows on the wall. > > many thanks > Karl > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
SP
Sanjeev Prabhakar
Sat, Jun 1, 2024 11:59 AM

I tried this today:
file can be downloaded from here:
https://github.com/sprabhakar2006/openSCAD/blob/main/points_on_sphere.scad

[image: Screenshot 2024-06-01 at 5.26.51 PM.png]

On Fri, 31 May 2024 at 16:09, Karl Exler via Discuss <
discuss@lists.openscad.org> wrote:

Dear all
I have an SVG file (see attachement) and I would like to attach it to a
half sphere. The idea is to put it on a LED light and have beautiful
shadows on the wall.

many thanks
Karl


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

I tried this today: file can be downloaded from here: https://github.com/sprabhakar2006/openSCAD/blob/main/points_on_sphere.scad [image: Screenshot 2024-06-01 at 5.26.51 PM.png] On Fri, 31 May 2024 at 16:09, Karl Exler via Discuss < discuss@lists.openscad.org> wrote: > Dear all > I have an SVG file (see attachement) and I would like to attach it to a > half sphere. The idea is to put it on a LED light and have beautiful > shadows on the wall. > > many thanks > Karl > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
SP
Sanjeev Prabhakar
Sat, Jun 1, 2024 12:27 PM

this makes a little more sense:

[image: Screenshot 2024-06-01 at 5.55.21 PM.png]

On Sat, 1 Jun 2024 at 17:29, Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

I tried this today:
file can be downloaded from here:
https://github.com/sprabhakar2006/openSCAD/blob/main/points_on_sphere.scad

[image: Screenshot 2024-06-01 at 5.26.51 PM.png]

On Fri, 31 May 2024 at 16:09, Karl Exler via Discuss <
discuss@lists.openscad.org> wrote:

Dear all
I have an SVG file (see attachement) and I would like to attach it to a
half sphere. The idea is to put it on a LED light and have beautiful
shadows on the wall.

many thanks
Karl


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

this makes a little more sense: [image: Screenshot 2024-06-01 at 5.55.21 PM.png] On Sat, 1 Jun 2024 at 17:29, Sanjeev Prabhakar <sprabhakar2006@gmail.com> wrote: > I tried this today: > file can be downloaded from here: > https://github.com/sprabhakar2006/openSCAD/blob/main/points_on_sphere.scad > > [image: Screenshot 2024-06-01 at 5.26.51 PM.png] > > On Fri, 31 May 2024 at 16:09, Karl Exler via Discuss < > discuss@lists.openscad.org> wrote: > >> Dear all >> I have an SVG file (see attachement) and I would like to attach it to a >> half sphere. The idea is to put it on a LED light and have beautiful >> shadows on the wall. >> >> many thanks >> Karl >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> >
GS
Guenther Sohler
Sat, Jun 1, 2024 8:53 PM

Instead of getting just coordinates, it would be interesting to learn, how
you map the coordinates onto the sphere.
Another promising idea could be to blow up  8 equiliteral triangles of an
octaeder to 8 eight's of a sphere.

On Sat, Jun 1, 2024 at 2:28 PM Sanjeev Prabhakar via Discuss <
discuss@lists.openscad.org> wrote:

this makes a little more sense:

[image: Screenshot 2024-06-01 at 5.55.21 PM.png]

On Sat, 1 Jun 2024 at 17:29, Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

I tried this today:
file can be downloaded from here:
https://github.com/sprabhakar2006/openSCAD/blob/main/points_on_sphere.scad

[image: Screenshot 2024-06-01 at 5.26.51 PM.png]

On Fri, 31 May 2024 at 16:09, Karl Exler via Discuss <
discuss@lists.openscad.org> wrote:

Dear all
I have an SVG file (see attachement) and I would like to attach it to a
half sphere. The idea is to put it on a LED light and have beautiful
shadows on the wall.

many thanks
Karl


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

Instead of getting just coordinates, it would be interesting to learn, how you map the coordinates onto the sphere. Another promising idea could be to blow up 8 equiliteral triangles of an octaeder to 8 eight's of a sphere. On Sat, Jun 1, 2024 at 2:28 PM Sanjeev Prabhakar via Discuss < discuss@lists.openscad.org> wrote: > this makes a little more sense: > > [image: Screenshot 2024-06-01 at 5.55.21 PM.png] > > On Sat, 1 Jun 2024 at 17:29, Sanjeev Prabhakar <sprabhakar2006@gmail.com> > wrote: > >> I tried this today: >> file can be downloaded from here: >> https://github.com/sprabhakar2006/openSCAD/blob/main/points_on_sphere.scad >> >> [image: Screenshot 2024-06-01 at 5.26.51 PM.png] >> >> On Fri, 31 May 2024 at 16:09, Karl Exler via Discuss < >> discuss@lists.openscad.org> wrote: >> >>> Dear all >>> I have an SVG file (see attachement) and I would like to attach it to a >>> half sphere. The idea is to put it on a LED light and have beautiful >>> shadows on the wall. >>> >>> many thanks >>> Karl >>> _______________________________________________ >>> 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 >
SP
Sanjeev Prabhakar
Sun, Jun 2, 2024 12:46 AM

Main idea is to be able to find intersection points.
Straight lines upwards are drawn from each point and then the intersection
is found.

On Sun, 2 Jun, 2024, 2:24 am Guenther Sohler via Discuss, <
discuss@lists.openscad.org> wrote:

Instead of getting just coordinates, it would be interesting to learn, how
you map the coordinates onto the sphere.
Another promising idea could be to blow up  8 equiliteral triangles of an
octaeder to 8 eight's of a sphere.

On Sat, Jun 1, 2024 at 2:28 PM Sanjeev Prabhakar via Discuss <
discuss@lists.openscad.org> wrote:

this makes a little more sense:

[image: Screenshot 2024-06-01 at 5.55.21 PM.png]

On Sat, 1 Jun 2024 at 17:29, Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

I tried this today:
file can be downloaded from here:

https://github.com/sprabhakar2006/openSCAD/blob/main/points_on_sphere.scad

[image: Screenshot 2024-06-01 at 5.26.51 PM.png]

On Fri, 31 May 2024 at 16:09, Karl Exler via Discuss <
discuss@lists.openscad.org> wrote:

Dear all
I have an SVG file (see attachement) and I would like to attach it to a
half sphere. The idea is to put it on a LED light and have beautiful
shadows on the wall.

many thanks
Karl


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

Main idea is to be able to find intersection points. Straight lines upwards are drawn from each point and then the intersection is found. On Sun, 2 Jun, 2024, 2:24 am Guenther Sohler via Discuss, < discuss@lists.openscad.org> wrote: > Instead of getting just coordinates, it would be interesting to learn, how > you map the coordinates onto the sphere. > Another promising idea could be to blow up 8 equiliteral triangles of an > octaeder to 8 eight's of a sphere. > > > On Sat, Jun 1, 2024 at 2:28 PM Sanjeev Prabhakar via Discuss < > discuss@lists.openscad.org> wrote: > >> this makes a little more sense: >> >> [image: Screenshot 2024-06-01 at 5.55.21 PM.png] >> >> On Sat, 1 Jun 2024 at 17:29, Sanjeev Prabhakar <sprabhakar2006@gmail.com> >> wrote: >> >>> I tried this today: >>> file can be downloaded from here: >>> >>> https://github.com/sprabhakar2006/openSCAD/blob/main/points_on_sphere.scad >>> >>> [image: Screenshot 2024-06-01 at 5.26.51 PM.png] >>> >>> On Fri, 31 May 2024 at 16:09, Karl Exler via Discuss < >>> discuss@lists.openscad.org> wrote: >>> >>>> Dear all >>>> I have an SVG file (see attachement) and I would like to attach it to a >>>> half sphere. The idea is to put it on a LED light and have beautiful >>>> shadows on the wall. >>>> >>>> many thanks >>>> Karl >>>> _______________________________________________ >>>> 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 >
RW
Raymond West
Sun, Jun 2, 2024 8:27 AM

That is what my earlier code snippet did, except my openscad would not
handle op's .SVG file. However, a more precise method would be to
'paint' the pattern on the walls and ceiling, position the led where you
want it, then ray-trace from that point to the pattern, and intersect
whatever shape of 'lamp shade' you wanted (figuratively speaking). I
can't do that in 'pure' openscad.

On 02/06/2024 01:46, Sanjeev Prabhakar via Discuss wrote:

Main idea is to be able to find intersection points.
Straight lines upwards are drawn from each point and then the
intersection is found.

On Sun, 2 Jun, 2024, 2:24 am Guenther Sohler via Discuss,
discuss@lists.openscad.org wrote:

 Instead of getting just coordinates, it would be interesting to
 learn, how you map the coordinates onto the sphere.
 Another promising idea could be to blow up  8
 equiliteral triangles of an octaeder to 8 eight's of a sphere.


 On Sat, Jun 1, 2024 at 2:28 PM Sanjeev Prabhakar via Discuss
 <discuss@lists.openscad.org> wrote:

     this makes a little more sense:

     Screenshot 2024-06-01 at 5.55.21 PM.png

     On Sat, 1 Jun 2024 at 17:29, Sanjeev Prabhakar
     <sprabhakar2006@gmail.com> wrote:

         I tried this today:
         file can be downloaded from here:
         https://github.com/sprabhakar2006/openSCAD/blob/main/points_on_sphere.scad

         Screenshot 2024-06-01 at 5.26.51 PM.png

         On Fri, 31 May 2024 at 16:09, Karl Exler via Discuss
         <discuss@lists.openscad.org> wrote:

             Dear all
             I have an SVG file (see attachement) and I would like
             to attach it to a
             half sphere. The idea is to put it on a LED light and
             have beautiful
             shadows on the wall.

             many thanks
             Karl
             _______________________________________________
             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

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

That is what my earlier code snippet did, except my openscad would not handle op's .SVG file. However, a more precise method would be to 'paint' the pattern on the walls and ceiling, position the led where you want it, then ray-trace from that point to the pattern, and intersect whatever shape of 'lamp shade' you wanted (figuratively speaking). I can't do that in 'pure' openscad. On 02/06/2024 01:46, Sanjeev Prabhakar via Discuss wrote: > > Main idea is to be able to find intersection points. > Straight lines upwards are drawn from each point and then the > intersection is found. > > > On Sun, 2 Jun, 2024, 2:24 am Guenther Sohler via Discuss, > <discuss@lists.openscad.org> wrote: > > Instead of getting just coordinates, it would be interesting to > learn, how you map the coordinates onto the sphere. > Another promising idea could be to blow up  8 > equiliteral triangles of an octaeder to 8 eight's of a sphere. > > > On Sat, Jun 1, 2024 at 2:28 PM Sanjeev Prabhakar via Discuss > <discuss@lists.openscad.org> wrote: > > this makes a little more sense: > > Screenshot 2024-06-01 at 5.55.21 PM.png > > On Sat, 1 Jun 2024 at 17:29, Sanjeev Prabhakar > <sprabhakar2006@gmail.com> wrote: > > I tried this today: > file can be downloaded from here: > https://github.com/sprabhakar2006/openSCAD/blob/main/points_on_sphere.scad > > Screenshot 2024-06-01 at 5.26.51 PM.png > > On Fri, 31 May 2024 at 16:09, Karl Exler via Discuss > <discuss@lists.openscad.org> wrote: > > Dear all > I have an SVG file (see attachement) and I would like > to attach it to a > half sphere. The idea is to put it on a LED light and > have beautiful > shadows on the wall. > > many thanks > Karl > _______________________________________________ > 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 > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email todiscuss-leave@lists.openscad.org
SP
Sanjeev Prabhakar
Mon, Jun 3, 2024 3:34 PM

tried it today once again, just to cover a larger area of sphere:
file can be downloaded from here:
https://github.com/sprabhakar2006/openSCAD/blob/main/points_on_sphere_rev1.scad
[image: Screenshot 2024-06-03 at 8.59.06 PM.png]

On Sun, 2 Jun 2024 at 06:16, Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

Main idea is to be able to find intersection points.
Straight lines upwards are drawn from each point and then the intersection
is found.

On Sun, 2 Jun, 2024, 2:24 am Guenther Sohler via Discuss, <
discuss@lists.openscad.org> wrote:

Instead of getting just coordinates, it would be interesting to learn,
how you map the coordinates onto the sphere.
Another promising idea could be to blow up  8 equiliteral triangles of an
octaeder to 8 eight's of a sphere.

On Sat, Jun 1, 2024 at 2:28 PM Sanjeev Prabhakar via Discuss <
discuss@lists.openscad.org> wrote:

this makes a little more sense:

[image: Screenshot 2024-06-01 at 5.55.21 PM.png]

On Sat, 1 Jun 2024 at 17:29, Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

I tried this today:
file can be downloaded from here:

https://github.com/sprabhakar2006/openSCAD/blob/main/points_on_sphere.scad

[image: Screenshot 2024-06-01 at 5.26.51 PM.png]

On Fri, 31 May 2024 at 16:09, Karl Exler via Discuss <
discuss@lists.openscad.org> wrote:

Dear all
I have an SVG file (see attachement) and I would like to attach it to
a
half sphere. The idea is to put it on a LED light and have beautiful
shadows on the wall.

many thanks
Karl


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

tried it today once again, just to cover a larger area of sphere: file can be downloaded from here: https://github.com/sprabhakar2006/openSCAD/blob/main/points_on_sphere_rev1.scad [image: Screenshot 2024-06-03 at 8.59.06 PM.png] On Sun, 2 Jun 2024 at 06:16, Sanjeev Prabhakar <sprabhakar2006@gmail.com> wrote: > Main idea is to be able to find intersection points. > Straight lines upwards are drawn from each point and then the intersection > is found. > > On Sun, 2 Jun, 2024, 2:24 am Guenther Sohler via Discuss, < > discuss@lists.openscad.org> wrote: > >> Instead of getting just coordinates, it would be interesting to learn, >> how you map the coordinates onto the sphere. >> Another promising idea could be to blow up 8 equiliteral triangles of an >> octaeder to 8 eight's of a sphere. >> >> >> On Sat, Jun 1, 2024 at 2:28 PM Sanjeev Prabhakar via Discuss < >> discuss@lists.openscad.org> wrote: >> >>> this makes a little more sense: >>> >>> [image: Screenshot 2024-06-01 at 5.55.21 PM.png] >>> >>> On Sat, 1 Jun 2024 at 17:29, Sanjeev Prabhakar <sprabhakar2006@gmail.com> >>> wrote: >>> >>>> I tried this today: >>>> file can be downloaded from here: >>>> >>>> https://github.com/sprabhakar2006/openSCAD/blob/main/points_on_sphere.scad >>>> >>>> [image: Screenshot 2024-06-01 at 5.26.51 PM.png] >>>> >>>> On Fri, 31 May 2024 at 16:09, Karl Exler via Discuss < >>>> discuss@lists.openscad.org> wrote: >>>> >>>>> Dear all >>>>> I have an SVG file (see attachement) and I would like to attach it to >>>>> a >>>>> half sphere. The idea is to put it on a LED light and have beautiful >>>>> shadows on the wall. >>>>> >>>>> many thanks >>>>> Karl >>>>> _______________________________________________ >>>>> 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 >> >