discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

distribute holes on double curved surface

3
3hl3rt
Tue, Aug 15, 2017 10:57 AM

Hello,

I have a very specific task I want to solve - importing an stl file, and
distribute holes (somewhat) evenly (based on parameters)

just imagine importing half a sphere, and turning it into a meshscreen

any ideas?

Henrik

--
View this message in context: http://forum.openscad.org/distribute-holes-on-double-curved-surface-tp22062.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Hello, I have a very specific task I want to solve - importing an stl file, and distribute holes (somewhat) evenly (based on parameters) just imagine importing half a sphere, and turning it into a meshscreen any ideas? Henrik -- View this message in context: http://forum.openscad.org/distribute-holes-on-double-curved-surface-tp22062.html Sent from the OpenSCAD mailing list archive at Nabble.com.
BL
Bryan Lee
Tue, Aug 15, 2017 12:49 PM

Thus 3hl3rt hast written on Tue, Aug 15, 2017 at 03:57:24AM -0700, and, according to prophecy, it shall come to pass that:

I have a very specific task I want to solve - importing an stl file, and
distribute holes (somewhat) evenly (based on parameters)

just imagine importing half a sphere, and turning it into a meshscreen

Probably something along the lines of:

difference(){
import("blahblah.stl");
for ( l = [ 0 : length-1])
for ( w = [0 : width-1])
translate( [l * offset, w * offset, 0])
cylinder (r=2, h=50);
}

Thus 3hl3rt hast written on Tue, Aug 15, 2017 at 03:57:24AM -0700, and, according to prophecy, it shall come to pass that: > I have a very specific task I want to solve - importing an stl file, and > distribute holes (somewhat) evenly (based on parameters) > > just imagine importing half a sphere, and turning it into a meshscreen Probably something along the lines of: difference(){ import("blahblah.stl"); for ( l = [ 0 : length-1]) for ( w = [0 : width-1]) translate( [l * offset, w * offset, 0]) cylinder (r=2, h=50); }
3
3hl3rt
Tue, Aug 15, 2017 2:55 PM

But would this make the holes perpendicular to the surface?

--
View this message in context: http://forum.openscad.org/distribute-holes-on-double-curved-surface-tp22062p22064.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

But would this make the holes perpendicular to the surface? -- View this message in context: http://forum.openscad.org/distribute-holes-on-double-curved-surface-tp22062p22064.html Sent from the OpenSCAD mailing list archive at Nabble.com.
F
fred_dot_u
Tue, Aug 15, 2017 3:21 PM

The previous code would certainly provide for perpendicular holes. If you
desire radially oriented holes, here's a throw-up code I managed to create
in a few moments. The assignments are not necessarily representative of
reality, just useful words in the right place to make a sea urchin, so to
speak.

You can get some interesting results by changing the tilt angle. You could
also change the loop assignments to other increments for equally interesting
results.

This was fun.

http://forum.openscad.org/file/n22065/oscad_holy_sphere.png

--
View this message in context: http://forum.openscad.org/distribute-holes-on-double-curved-surface-tp22062p22065.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

The previous code would certainly provide for perpendicular holes. If you desire radially oriented holes, here's a throw-up code I managed to create in a few moments. The assignments are not necessarily representative of reality, just useful words in the right place to make a sea urchin, so to speak. You can get some interesting results by changing the tilt angle. You could also change the loop assignments to other increments for equally interesting results. This was fun. <http://forum.openscad.org/file/n22065/oscad_holy_sphere.png> -- View this message in context: http://forum.openscad.org/distribute-holes-on-double-curved-surface-tp22062p22065.html Sent from the OpenSCAD mailing list archive at Nabble.com.
FV
Frank van der Hulst
Tue, Aug 15, 2017 7:07 PM

Depending how important the normality is (you didn't even mention that in
your first post), cylinders will give faces that are approximately normal.
Making conical (apex at the centre of the sphere) holes rather cylindrical
would make normal holes for spherical surfaces.

But if the surface is non-spherical, this approach won't work. Have you
looked into Voronoi patterns (e.g.
https://www.instructables.com/id/Make-Voronoi-Pattern-with-Autodesk-Meshmixer/
)?

Depending how important the normality is (you didn't even mention that in your first post), cylinders will give faces that are approximately normal. Making conical (apex at the centre of the sphere) holes rather cylindrical would make normal holes for spherical surfaces. But if the surface is non-spherical, this approach won't work. Have you looked into Voronoi patterns (e.g. https://www.instructables.com/id/Make-Voronoi-Pattern-with-Autodesk-Meshmixer/ )?
DS
Dan Shriver
Tue, Aug 15, 2017 8:15 PM

I have a feeling that this is a "not in OpenSCAD" type problem but it would
be useful if:

given an arbitrary surface, you could distribute other objects on it (for
additive or subtractive purposes), without having to calculate the
coordinates at the surface.

On Tue, Aug 15, 2017 at 3:07 PM, Frank van der Hulst <
drifter.frank@gmail.com> wrote:

Depending how important the normality is (you didn't even mention that in
your first post), cylinders will give faces that are approximately normal.
Making conical (apex at the centre of the sphere) holes rather cylindrical
would make normal holes for spherical surfaces.

But if the surface is non-spherical, this approach won't work. Have you
looked into Voronoi patterns (e.g. https://www.instructables.com/id/Make-
Voronoi-Pattern-with-Autodesk-Meshmixer/)?


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

I have a feeling that this is a "not in OpenSCAD" type problem but it would be useful if: given an arbitrary surface, you could distribute other objects on it (for additive or subtractive purposes), without having to calculate the coordinates at the surface. On Tue, Aug 15, 2017 at 3:07 PM, Frank van der Hulst < drifter.frank@gmail.com> wrote: > Depending how important the normality is (you didn't even mention that in > your first post), cylinders will give faces that are approximately normal. > Making conical (apex at the centre of the sphere) holes rather cylindrical > would make normal holes for spherical surfaces. > > But if the surface is non-spherical, this approach won't work. Have you > looked into Voronoi patterns (e.g. https://www.instructables.com/id/Make- > Voronoi-Pattern-with-Autodesk-Meshmixer/)? > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > >
T
TLC123
Thu, Aug 17, 2017 2:08 PM

use  STL files to open SCAD over at  http://jsfiddle.net/Riham/yzvGD/
http://jsfiddle.net/Riham/yzvGD/  you get some thing lie this edit the
module to two expression ,defining points and faces

From there on you can calculate center and face normal for each face in the

mesh.

From normals you find rotations for your hole cutters

use STL files to open SCAD over at http://jsfiddle.net/Riham/yzvGD/ <http://jsfiddle.net/Riham/yzvGD/> you get some thing lie this edit the module to two expression ,defining points and faces >From there on you can calculate center and face normal for each face in the mesh. >From normals you find rotations for your hole cutters You can find all necessary functions for normal and rotations on my blog: https://openscadsnippetpad.blogspot.se/search?q=normal https://openscadsnippetpad.blogspot.se/2017/05/lookat-function-and-module.html https://openscadsnippetpad.blogspot.se/2017/05/angle-between-two-vectors-in-3d.html https://openscadsnippetpad.blogspot.se/search/label/vsum. Credits to a bunch of people in math history -- View this message in context: http://forum.openscad.org/distribute-holes-on-double-curved-surface-tp22062p22114.html Sent from the OpenSCAD mailing list archive at Nabble.com.
T
TLC123
Thu, Aug 17, 2017 7:31 PM

Yeah itchy fingers had to try
http://jsfiddle.net/aaL8xfs5/ http://jsfiddle.net/aaL8xfs5/

--
View this message in context: http://forum.openscad.org/distribute-holes-on-double-curved-surface-tp22062p22116.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Yeah itchy fingers had to try http://jsfiddle.net/aaL8xfs5/ <http://jsfiddle.net/aaL8xfs5/> -- View this message in context: http://forum.openscad.org/distribute-holes-on-double-curved-surface-tp22062p22116.html Sent from the OpenSCAD mailing list archive at Nabble.com.