method of creating surfaces with 2 sketches
Nice. Though I think that you need to add an operator function argument, because there's more than one way to combine those waves. You show what appears to be a multiplicative surface, but an additive surface is another valid interpretation, yet has a rather different result:

include <BOSL2/std.scad>
function surface_from_2_waves(xwave, ywave, oper = function(x,y) x*y) = [
for(ypt = ywave) [
for(xpt = xwave)
[xpt.x, ypt.y, oper(xpt.z,ypt.z)]
]
];
function surf_extrude(surfpts, height) =
vnf_vertex_array(
[for (row=surfpts) concat(row, down(height, p=reverse(row)))],
caps=true, col_wrap=true, row_wrap=false
);
xywave = [for (i = [0:2:100]) [i,2sin(3i*360/100)]];
xzwave = xrot(90, p=path3d(xywave));
yzwave = zrot(90, p=xzwave);
surfpts = surface_from_2_waves(xzwave, yzwave, function(x,y) x+y);
vnf = surf_extrude(surfpts, 0.1);
vnf_polyhedron(vnf, convexity=10);
-Revar
On Oct 27, 2023, at 11:31 PM, Sanjeev Prabhakar sprabhakar2006@gmail.com wrote:
method of creating surfaces with 2 sketches
<creating_surfaces.pdf>_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Thanks
Will try this
On Sun, 29 Oct, 2023, 2:11 am Revar Desmera, revarbat@gmail.com wrote:
Nice. Though I think that you need to add an operator function argument,
because there's more than one way to combine those waves. You show what
appears to be a multiplicative surface, but an additive surface is another
valid interpretation, yet has a rather different result:
[image: Screenshot 2023-10-28 at 1.38.51 PM.png]
include <BOSL2/std.scad>
function surface_from_2_waves(xwave, ywave, oper = function(x,y) x*y) = [
for(ypt = ywave) [
for(xpt = xwave)
[xpt.x, ypt.y, oper(xpt.z,ypt.z)]
]
];
function surf_extrude(surfpts, height) =
vnf_vertex_array(
[for (row=surfpts) concat(row, down(height, p=reverse(row)))],
caps=true, col_wrap=true, row_wrap=false
);
xywave = [for (i = [0:2:100]) [i,2sin(3i*360/100)]];
xzwave = xrot(90, p=path3d(xywave));
yzwave = zrot(90, p=xzwave);
surfpts = surface_from_2_waves(xzwave, yzwave, function(x,y) x+y);
vnf = surf_extrude(surfpts, 0.1);
vnf_polyhedron(vnf, convexity=10);
-Revar
On Oct 27, 2023, at 11:31 PM, Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:
method of creating surfaces with 2 sketches
<creating_surfaces.pdf>_______________________________________________
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
You can get interesting effects using min() or max() on combinations of sine and triangle wave inputs.

On Oct 28, 2023, at 6:19 PM, Sanjeev Prabhakar sprabhakar2006@gmail.com wrote:
Thanks
Will try this
On Sun, 29 Oct, 2023, 2:11 am Revar Desmera, <revarbat@gmail.com mailto:revarbat@gmail.com> wrote:
Nice. Though I think that you need to add an operator function argument, because there's more than one way to combine those waves. You show what appears to be a multiplicative surface, but an additive surface is another valid interpretation, yet has a rather different result:
include <BOSL2/std.scad>
function surface_from_2_waves(xwave, ywave, oper = function(x,y) x*y) = [
for(ypt = ywave) [
for(xpt = xwave)
[xpt.x, ypt.y, oper(xpt.z,ypt.z)]
]
];
function surf_extrude(surfpts, height) =
vnf_vertex_array(
[for (row=surfpts) concat(row, down(height, p=reverse(row)))],
caps=true, col_wrap=true, row_wrap=false
);
xywave = [for (i = [0:2:100]) [i,2sin(3i*360/100)]];
xzwave = xrot(90, p=path3d(xywave));
yzwave = zrot(90, p=xzwave);
surfpts = surface_from_2_waves(xzwave, yzwave, function(x,y) x+y);
vnf = surf_extrude(surfpts, 0.1);
vnf_polyhedron(vnf, convexity=10);
-Revar
On Oct 27, 2023, at 11:31 PM, Sanjeev Prabhakar <sprabhakar2006@gmail.com mailto:sprabhakar2006@gmail.com> wrote:
method of creating surfaces with 2 sketches
<creating_surfaces.pdf>_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org
<Screenshot 2023-10-28 at 1.38.51 PM.png><Screenshot 2023-10-28 at 1.38.51 PM.png>_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
very nice.
other interesting shapes
[image: Screenshot 2023-10-29 at 3.21.18 PM.png]
On Sun, 29 Oct 2023 at 11:08, Revar Desmera revarbat@gmail.com wrote:
You can get interesting effects using min() or max() on combinations
of sine and triangle wave inputs.
[image: Screenshot 2023-10-28 at 10.37.21 PM.png]
On Oct 28, 2023, at 6:19 PM, Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:
Thanks
Will try this
On Sun, 29 Oct, 2023, 2:11 am Revar Desmera, revarbat@gmail.com wrote:
Nice. Though I think that you need to add an operator function argument,
because there's more than one way to combine those waves. You show what
appears to be a multiplicative surface, but an additive surface is another
valid interpretation, yet has a rather different result:
[image: Screenshot 2023-10-28 at 1.38.51 PM.png]
include <BOSL2/std.scad>
function surface_from_2_waves(xwave, ywave, oper = function(x,y) x*y) = [
for(ypt = ywave) [
for(xpt = xwave)
[xpt.x, ypt.y, oper(xpt.z,ypt.z)]
]
];
function surf_extrude(surfpts, height) =
vnf_vertex_array(
[for (row=surfpts) concat(row, down(height, p=reverse(row)))],
caps=true, col_wrap=true, row_wrap=false
);
xywave = [for (i = [0:2:100]) [i,2sin(3i*360/100)]];
xzwave = xrot(90, p=path3d(xywave));
yzwave = zrot(90, p=xzwave);
surfpts = surface_from_2_waves(xzwave, yzwave, function(x,y) x+y);
vnf = surf_extrude(surfpts, 0.1);
vnf_polyhedron(vnf, convexity=10);
-Revar
On Oct 27, 2023, at 11:31 PM, Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:
method of creating surfaces with 2 sketches
<creating_surfaces.pdf>_______________________________________________
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
<Screenshot 2023-10-28 at 1.38.51 PM.png><Screenshot 2023-10-28 at
1.38.51 PM.png>_______________________________________________
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
another one
[image: Screenshot 2023-10-29 at 3.44.57 PM.png]
Square waves multiplied together get a checkerboard, but add them instead and you get this:
Good learning
I could reproduce the same
[image: Screenshot 2023-10-30 at 7.57.42 PM.png]
Found a fun one! You can do a quilted looking surface by getting the norm() of two sine waves:
On Oct 30, 2023, at 7:29 AM, Sanjeev Prabhakar sprabhakar2006@gmail.com wrote:
Good learning
I could reproduce the same
<Screenshot 2023-10-30 at 7.57.42 PM.png>
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
It would be great to have a library of these shapes. I'm sure they
will come in handy from time to time.
On 10/30/2023 4:59 PM, Revar Desmera wrote:
Found a fun one! You can do a quilted looking surface by getting the
norm() of two sine waves:
Very nice
Lot to play with
Technically that surface isn't quilted, exactly. When you make a blanket
by securing the layers at single points you do that by tying. It's a less
secure technique than real quilting, where the layers are sewn together
along lines.
It seems like the BOSL2 texture library does collect patterns like this.
https://github.com/BelfrySCAD/BOSL2/wiki/skin.scad#subsection-vnf-textures
On Mon, Oct 30, 2023 at 8:31 PM Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:
Very nice
Lot to play with
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Wonderful textures, but how did you create these?
Is it with the 2 waves method?
On Tue, 31 Oct, 2023, 6:54 am Adrian Mariano, avm4@cornell.edu wrote:
Technically that surface isn't quilted, exactly. When you make a blanket
by securing the layers at single points you do that by tying. It's a less
secure technique than real quilting, where the layers are sewn together
along lines.
It seems like the BOSL2 texture library does collect patterns like this.
https://github.com/BelfrySCAD/BOSL2/wiki/skin.scad#subsection-vnf-textures
On Mon, Oct 30, 2023 at 8:31 PM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:
Very nice
Lot to play with
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
Another question: I wonder if it is faster to do it with the 2 waves
method or SDF? E.g. with libfive integration in python.
On 31/10/2023 09:36, Sanjeev Prabhakar wrote:
Wonderful textures, but how did you create these?
Is it with the 2 waves method?
On Tue, 31 Oct, 2023, 6:54 am Adrian Mariano, avm4@cornell.edu wrote:
Technically that surface isn't quilted, exactly. When you make a
blanket by securing the layers at single points you do that by
tying. It's a less secure technique than real quilting, where the
layers are sewn together along lines.
It seems like the BOSL2 texture library does collect patterns like
this.
https://github.com/BelfrySCAD/BOSL2/wiki/skin.scad#subsection-vnf-textures
On Mon, Oct 30, 2023 at 8:31 PM Sanjeev Prabhakar
<sprabhakar2006@gmail.com> wrote:
Very nice
Lot to play with
_______________________________________________
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
Can you share some examples as to how this works?
On Tue, 31 Oct, 2023, 7:29 am Chun Kit LAM, john.lck40@gmail.com wrote:
Another question: I wonder if it is faster to do it with the 2 waves
method or SDF? E.g. with libfive integration in python.
On 31/10/2023 09:36, Sanjeev Prabhakar wrote:
Wonderful textures, but how did you create these?
Is it with the 2 waves method?
On Tue, 31 Oct, 2023, 6:54 am Adrian Mariano, avm4@cornell.edu wrote:
Technically that surface isn't quilted, exactly. When you make a blanket
by securing the layers at single points you do that by tying. It's a less
secure technique than real quilting, where the layers are sewn together
along lines.
It seems like the BOSL2 texture library does collect patterns like this.
https://github.com/BelfrySCAD/BOSL2/wiki/skin.scad#subsection-vnf-textures
On Mon, Oct 30, 2023 at 8:31 PM Sanjeev Prabhakar <
sprabhakar2006@gmail.com> wrote:
Very nice
Lot to play with
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 to discuss-leave@lists.openscad.org
Just something like abs(z - sin(x) - sin(y)) <= d/2, where d is the
desired thickness.
I don't have time to compile the python integration for now so I just
tried it with manifold sdf. The surface is not very smooth due to
marching cubes used. It is probably better to do it with the method in
BOSL2.
On 31/10/2023 10:24, Sanjeev Prabhakar wrote:
Can you share some examples as to how this works?
On Tue, 31 Oct, 2023, 7:29 am Chun Kit LAM, john.lck40@gmail.com wrote:
Another question: I wonder if it is faster to do it with the 2
waves method or SDF? E.g. with libfive integration in python.
On 31/10/2023 09:36, Sanjeev Prabhakar wrote:
Wonderful textures, but how did you create these?
Is it with the 2 waves method?
On Tue, 31 Oct, 2023, 6:54 am Adrian Mariano, <avm4@cornell.edu>
wrote:
Technically that surface isn't quilted, exactly. When you
make a blanket by securing the layers at single points you do
that by tying. It's a less secure technique than real
quilting, where the layers are sewn together along lines.
It seems like the BOSL2 texture library does collect patterns
like this.
https://github.com/BelfrySCAD/BOSL2/wiki/skin.scad#subsection-vnf-textures
On Mon, Oct 30, 2023 at 8:31 PM Sanjeev Prabhakar
<sprabhakar2006@gmail.com> wrote:
Very nice
Lot to play with
_______________________________________________
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
_______________________________________________
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
All the BOSL2 textures were created by hand, I'm afraid. I had a need to do things like knurling on some parts, and that generalized into textures. Since heightfields were insufficient to make some textures cleanly, I expanded the system out to allow more precise VNF based textures. I just made a bunch of standard textures that seemed useful. Textures can be applied to cyl()s, rotate_sweep()s, and linear_sweep()s.
You CAN use the two-wave technique to generate heightfields or VNFs that are useable as textures, but you have to beware how many vertices you introduce.
The fact that you can generate the diamonds I originally needed for knurling via the 2-wave method was actually an interesting surprise to me, though it's far more expensive in vertex counts. The manually created heightfield texture for diamonds in BOSL2 is actually just [[0,1], [1,0]].
On Oct 30, 2023, at 6:36 PM, Sanjeev Prabhakar sprabhakar2006@gmail.com wrote:
Wonderful textures, but how did you create these?
Is it with the 2 waves method?
On Tue, 31 Oct, 2023, 6:54 am Adrian Mariano, <avm4@cornell.edu mailto:avm4@cornell.edu> wrote:
Technically that surface isn't quilted, exactly. When you make a blanket by securing the layers at single points you do that by tying. It's a less secure technique than real quilting, where the layers are sewn together along lines.
It seems like the BOSL2 texture library does collect patterns like this.
https://github.com/BelfrySCAD/BOSL2/wiki/skin.scad#subsection-vnf-textures
On Mon, Oct 30, 2023 at 8:31 PM Sanjeev Prabhakar <sprabhakar2006@gmail.com mailto:sprabhakar2006@gmail.com> wrote:
Very nice
Lot to play with
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
textured box
[image: Screenshot 2023-10-31 at 9.52.16 PM.png]
scad file link is here (4.6 mb):
https://github.com/sprabhakar2006/openSCAD/blob/main/textured_box.scad