discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

stereographic projections

J
jon
Mon, Feb 6, 2017 1:15 PM

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

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
R
Ronaldo
Mon, Feb 6, 2017 2:03 PM

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.

--
View this message in context: http://forum.openscad.org/stereographic-projections-tp20339p20343.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

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. -- View this message in context: http://forum.openscad.org/stereographic-projections-tp20339p20343.html Sent from the OpenSCAD mailing list archive at Nabble.com.
N
Neon22
Tue, Feb 7, 2017 12:11 AM

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.

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.
J
jon
Tue, Feb 7, 2017 2:24 AM

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
Discuss@lists.openscad.org
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

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 > Discuss@lists.openscad.org > 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 > >
N
Neon22
Tue, Feb 7, 2017 2:58 AM

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);

http://forum.openscad.org/file/n20356/sample-_scale_extrude.png

--
View this message in context: http://forum.openscad.org/stereographic-projections-tp20339p20356.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

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); ``` <http://forum.openscad.org/file/n20356/sample-_scale_extrude.png> -- View this message in context: http://forum.openscad.org/stereographic-projections-tp20339p20356.html Sent from the OpenSCAD mailing list archive at Nabble.com.
J
jon
Tue, Feb 7, 2017 3:06 AM

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([rad2,rad2,rad],center=true);
}
}
module result () {
difference() {
translate([0,0,24])
shell(20,1);
%3D_projection (30) 2D_shape();

}

}

result();
// shell(20,3);

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);