stereographic projections

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

stereographic projections

jon_bondy
Anyone know how to do stereographic projections?  Threonin on
Thingiverse has some OpenSCAD code to map a pixel array (image) onto a
sphere, but that would not produce nice curves.  Examples:

http://www.thingiverse.com/thing:294899

http://www.thingiverse.com/thing:295281

http://www.thingiverse.com/thing:418129

Is there a way to create geometry and then methodically warp each point
on each triangle to conform to the sphere?

Jon


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: stereographic projections

Ronaldo
jon_bondy wrote
Is there a way to create geometry and then methodically warp each point
on each triangle to conform to the sphere?
Yes, if you have access to the points of the geometry. That means you need to generate the points of the polygons and not producing them by 2D primitives and 2D operators. Function project() in Threonin's code does exactly what you want. However, to get a good approximation of the projected polygon edges you should refine the edges by inserting points in it before the projection.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: stereographic projections

Neon22
In reply to this post by jon_bondy
Not really stereo but:
another approach is to look at problem as solids and booleans.
I.e. assume point light source and a surrounding shell of a sphere which you want to cut into just as in the example links you sent.

So make the (say maze object - perhaps out of individual bloacks perhaps as one object),
then extrude it and use scale param down to a very small size at the point light's location,
then do a boolean difference with the sphere shell.

The result is the same.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: stereographic projections

jon_bondy
Neon:

Not sure I get what you're saying.

Start with a planar object of some complex design (say a maze).

When you extrude it, it goes straight up, not towards the light source
or the surface of the sphere.

It seems that this might be easier in an external language than in OpenSCAD.

But perhaps I'm missing your point.

Jon


On 2/6/2017 7:11 PM, Neon22 wrote:

> Not really stereo but:
> another approach is to look at problem as solids and booleans.
> I.e. assume point light source and a surrounding shell of a sphere which you
> want to cut into just as in the example links you sent.
>
> So make the (say maze object - perhaps out of individual bloacks perhaps as
> one object),
> then extrude it and use scale param down to a very small size at the point
> light's location,
> then do a boolean difference with the sphere shell.
>
> The result is the same.
>
>
>
> --
> View this message in context: http://forum.openscad.org/stereographic-projections-tp20339p20354.html
> Sent from the OpenSCAD mailing list archive at Nabble.com.
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2016.0.7998 / Virus Database: 4756/13899 - Release Date: 02/06/17
>
>


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: stereographic projections

Neon22
Here is an example using the (seldom used?) scale param to linear_extrude.

```
$fn=30;
module 2D_shape() {
        difference() {
                offset(r=3) {
                        square(size=[20,30], center=true);
                }
                square(size=[20,30], center=true);
        }
}

module 3D_projection (dist) {
        linear_extrude(height = dist, center = true, convexity = 4, scale=0.1) {
                children();
        }
}

module shell (rad, thick) {
        difference() {
                sphere(r=rad, center=true);
                sphere(r=rad-thick, center=true);
                translate([0,0,rad/2])
                        cube([rad*2,rad*2,rad],center=true);
        }
}
module result () {
        difference() {
                translate([0,0,24])
                        shell(20,1);
                %3D_projection (30) 2D_shape();

        }
}

result();
// shell(20,3);
```
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: stereographic projections

jon_bondy
I'm not sure I understand it at first glance, but I love it! Thank you!

Jon


On 2/6/2017 9:58 PM, Neon22 wrote:

> $fn=30;
> module 2D_shape() {
> difference() {
> offset(r=3) {
> square(size=[20,30], center=true);
> }
> square(size=[20,30], center=true);
> }
> }
>
> module 3D_projection (dist) {
> linear_extrude(height = dist, center = true, convexity = 4, scale=0.1) {
> children();
> }
> }
>
> module shell (rad, thick) {
> difference() {
> sphere(r=rad, center=true);
> sphere(r=rad-thick, center=true);
> translate([0,0,rad/2])
> cube([rad*2,rad*2,rad],center=true);
> }
> }
> module result () {
> difference() {
> translate([0,0,24])
> shell(20,1);
> %3D_projection (30) 2D_shape();
>
> }
> }
>
> result();
> // shell(20,3);


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Loading...