discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

alternative to hull?

D
dkesler
Thu, Feb 16, 2017 3:34 AM

Hi, and thank you already for thinking about helping. I need it!

This is a sculpture by Antoine Pevsner, that I've been trying to recreate.

http://forum.openscad.org/file/n20461/IMG_3113.jpg

A little inspiration (mostly perspiration) got me [x,y,z] coordinates for
the end points of each of the straight lines. So I have an array with all
the coordinates of the endpoints and here's what I've done:

Place spheres at the ends of a line.
Hull() them to make that line.
Place spheres at the ends of the next line.
Hull() them to make that next line.
Put n spheres at regular intervals along each line.
Hull() three at a time to make thick triangular faces to fill in the space
between the skew lines.
Repeat with the second line and the third line.
And so on.

So admittedly it's a ton of lines and hull() ing to do, and I'm not
surprised that it takes a while given my slow computer, but I'm hoping
someone can say something like, "Erik worked on this three years ago, ask
him," or, "try switching this with that or looping this other way." I'm
improving the code kind of steadily, but when I have to wait three hours for
the lowest of the lowest quality renderings, I lose a little steam. When
it's done rendering, I get some steam back because the thing just looks so
cool.

http://forum.openscad.org/file/n20461/pevsner2.jpg

The only other idea I had was to individually crop and individually rotate
individually twisted linearly extruded rectangles, but that math was scary
to me compared to the nice loop I've got I've got below.

I set up the code below to handle two lines and do it with fairly good
looks. If you have a minute to render it and think about how you'd do it
that might be faster or more efficient, I'd truly appreciate any feedback.
It takes about 45 seconds to render on my laptop (Lenovo Thinkpad X201T,
dual i7). It's no speed demon and doesn't have anything really special.

Thanks if you feel like helping! Drew

//beginning of abridged code

module web(p1,p2,p3,p4,slabs){
$fn=8;
hull(){
translate(p1)    //places spheres at line
sphere(.2);  //ends to be hulled
translate(p2)
sphere(.2);}
hull(){
translate(p3)    //places spheres at line
sphere(.2);  //ends to be hulled
translate(p4)
sphere(.2);}

/* This next loop places smaller spheres at even intervals along each line.
It hulls three spheres (two from one side and one from the other) to create
a triangular face, and then it hulls two from the other side and one from
this side, etc, and works its way up the gap.*/

for (n=[1:1:slabs]){
hull(){

translate([p1[0]+(n-1)(p2[0]-p1[0])/slabs,p1[1]+(n-1)(p2[1]-p1[1])/slabs,p1[2]+(n-1)*(p2[2]-p1[2])/slabs])
sphere(.1);

translate([p3[0]+(n-1)(p4[0]-p3[0])/slabs,p3[1]+(n-1)(p4[1]-p3[1])/slabs,p3[2]+(n-1)*(p4[2]-p3[2])/slabs])
sphere(.1);

translate([p3[0]+n*(p4[0]-p3[0])/slabs,p3[1]+n*(p4[1]-p3[1])/slabs,p3[2]+n*(p4[2]-p3[2])/slabs])
sphere(.1);}
hull(){

translate([p1[0]+(n-1)(p2[0]-p1[0])/slabs,p1[1]+(n-1)(p2[1]-p1[1])/slabs,p1[2]+(n-1)*(p2[2]-p1[2])/slabs])
sphere(.1);

translate([p1[0]+n*(p2[0]-p1[0])/slabs,p1[1]+n*(p2[1]-p1[1])/slabs,p1[2]+n*(p2[2]-p1[2])/slabs])
sphere(.1);

translate([p3[0]+n*(p4[0]-p3[0])/slabs,p3[1]+n*(p4[1]-p3[1])/slabs,p3[2]+n*(p4[2]-p3[2])/slabs])
sphere(.1);}}}

web(p1=[0,0,0],p2=[-2,3,10],p3=[3,3,-5],p4=[12,0,12],slabs=32);

--
View this message in context: http://forum.openscad.org/alternative-to-hull-tp20461.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Hi, and thank you already for thinking about helping. I need it! This is a sculpture by Antoine Pevsner, that I've been trying to recreate. <http://forum.openscad.org/file/n20461/IMG_3113.jpg> A little inspiration (mostly perspiration) got me [x,y,z] coordinates for the end points of each of the straight lines. So I have an array with all the coordinates of the endpoints and here's what I've done: Place spheres at the ends of a line. Hull() them to make that line. Place spheres at the ends of the next line. Hull() them to make that next line. Put n spheres at regular intervals along each line. Hull() three at a time to make thick triangular faces to fill in the space between the skew lines. Repeat with the second line and the third line. And so on. So admittedly it's a ton of lines and hull() ing to do, and I'm not surprised that it takes a while given my slow computer, but I'm hoping someone can say something like, "Erik worked on this three years ago, ask him," or, "try switching this with that or looping this other way." I'm improving the code kind of steadily, but when I have to wait three hours for the lowest of the lowest quality renderings, I lose a little steam. When it's done rendering, I get some steam back because the thing just looks so cool. <http://forum.openscad.org/file/n20461/pevsner2.jpg> The only other idea I had was to individually crop and individually rotate individually twisted linearly extruded rectangles, but that math was scary to me compared to the nice loop I've got I've got below. I set up the code below to handle two lines and do it with fairly good looks. If you have a minute to render it and think about how *you'd* do it that might be faster or more efficient, I'd truly appreciate any feedback. It takes about 45 seconds to render on my laptop (Lenovo Thinkpad X201T, dual i7). It's no speed demon and doesn't have anything really special. Thanks if you feel like helping! Drew //beginning of abridged code module web(p1,p2,p3,p4,slabs){ $fn=8; hull(){ translate(p1) //places spheres at line sphere(.2); //ends to be hulled translate(p2) sphere(.2);} hull(){ translate(p3) //places spheres at line sphere(.2); //ends to be hulled translate(p4) sphere(.2);} /* This next loop places smaller spheres at even intervals along each line. It hulls three spheres (two from one side and one from the other) to create a triangular face, and then it hulls two from the other side and one from this side, etc, and works its way up the gap.*/ for (n=[1:1:slabs]){ hull(){ translate([p1[0]+(n-1)*(p2[0]-p1[0])/slabs,p1[1]+(n-1)*(p2[1]-p1[1])/slabs,p1[2]+(n-1)*(p2[2]-p1[2])/slabs]) sphere(.1); translate([p3[0]+(n-1)*(p4[0]-p3[0])/slabs,p3[1]+(n-1)*(p4[1]-p3[1])/slabs,p3[2]+(n-1)*(p4[2]-p3[2])/slabs]) sphere(.1); translate([p3[0]+n*(p4[0]-p3[0])/slabs,p3[1]+n*(p4[1]-p3[1])/slabs,p3[2]+n*(p4[2]-p3[2])/slabs]) sphere(.1);} hull(){ translate([p1[0]+(n-1)*(p2[0]-p1[0])/slabs,p1[1]+(n-1)*(p2[1]-p1[1])/slabs,p1[2]+(n-1)*(p2[2]-p1[2])/slabs]) sphere(.1); translate([p1[0]+n*(p2[0]-p1[0])/slabs,p1[1]+n*(p2[1]-p1[1])/slabs,p1[2]+n*(p2[2]-p1[2])/slabs]) sphere(.1); translate([p3[0]+n*(p4[0]-p3[0])/slabs,p3[1]+n*(p4[1]-p3[1])/slabs,p3[2]+n*(p4[2]-p3[2])/slabs]) sphere(.1);}}} web(p1=[0,0,0],p2=[-2,3,10],p3=[3,3,-5],p4=[12,0,12],slabs=32); -- View this message in context: http://forum.openscad.org/alternative-to-hull-tp20461.html Sent from the OpenSCAD mailing list archive at Nabble.com.
RP
Ronaldo Persiano
Thu, Feb 16, 2017 4:46 AM

I would follow a very different path: polyhedron. However, it is very hard
to sew all faces of a polyhedron. So I would use something like Parkinbot's
sweep (see http://www.thingiverse.com/thing:900137). You will have to
compute points but the render will be very quick.

Em 16 de fev de 2017 01:35, "dkesler" dkesler@newarka.edu escreveu:

Hi, and thank you already for thinking about helping. I need it!

This is a sculpture by Antoine Pevsner, that I've been trying to recreate.

http://forum.openscad.org/file/n20461/IMG_3113.jpg

A little inspiration (mostly perspiration) got me [x,y,z] coordinates for
the end points of each of the straight lines. So I have an array with all
the coordinates of the endpoints and here's what I've done:

Place spheres at the ends of a line.
Hull() them to make that line.
Place spheres at the ends of the next line.
Hull() them to make that next line.
Put n spheres at regular intervals along each line.
Hull() three at a time to make thick triangular faces to fill in the space
between the skew lines.
Repeat with the second line and the third line.
And so on.

So admittedly it's a ton of lines and hull() ing to do, and I'm not
surprised that it takes a while given my slow computer, but I'm hoping
someone can say something like, "Erik worked on this three years ago, ask
him," or, "try switching this with that or looping this other way." I'm
improving the code kind of steadily, but when I have to wait three hours
for
the lowest of the lowest quality renderings, I lose a little steam. When
it's done rendering, I get some steam back because the thing just looks so
cool.

http://forum.openscad.org/file/n20461/pevsner2.jpg

The only other idea I had was to individually crop and individually rotate
individually twisted linearly extruded rectangles, but that math was scary
to me compared to the nice loop I've got I've got below.

I set up the code below to handle two lines and do it with fairly good
looks. If you have a minute to render it and think about how you'd do it
that might be faster or more efficient, I'd truly appreciate any feedback.
It takes about 45 seconds to render on my laptop (Lenovo Thinkpad X201T,
dual i7). It's no speed demon and doesn't have anything really special.

Thanks if you feel like helping! Drew

//beginning of abridged code

module web(p1,p2,p3,p4,slabs){
$fn=8;
hull(){
translate(p1)    //places spheres at line
sphere(.2);  //ends to be hulled
translate(p2)
sphere(.2);}
hull(){
translate(p3)    //places spheres at line
sphere(.2);  //ends to be hulled
translate(p4)
sphere(.2);}

/* This next loop places smaller spheres at even intervals along each line.
It hulls three spheres (two from one side and one from the other) to create
a triangular face, and then it hulls two from the other side and one from
this side, etc, and works its way up the gap.*/

for (n=[1:1:slabs]){
hull(){

translate([p1[0]+(n-1)(p2[0]-p1[0])/slabs,p1[1]+(n-1)(p2[
1]-p1[1])/slabs,p1[2]+(n-1)*(p2[2]-p1[2])/slabs])
sphere(.1);

translate([p3[0]+(n-1)(p4[0]-p3[0])/slabs,p3[1]+(n-1)(p4[
1]-p3[1])/slabs,p3[2]+(n-1)*(p4[2]-p3[2])/slabs])
sphere(.1);

translate([p3[0]+n*(p4[0]-p3[0])/slabs,p3[1]+n*(p4[1]-p3[1]
)/slabs,p3[2]+n*(p4[2]-p3[2])/slabs])
sphere(.1);}
hull(){

translate([p1[0]+(n-1)(p2[0]-p1[0])/slabs,p1[1]+(n-1)(p2[
1]-p1[1])/slabs,p1[2]+(n-1)*(p2[2]-p1[2])/slabs])
sphere(.1);

translate([p1[0]+n*(p2[0]-p1[0])/slabs,p1[1]+n*(p2[1]-p1[1]
)/slabs,p1[2]+n*(p2[2]-p1[2])/slabs])
sphere(.1);

translate([p3[0]+n*(p4[0]-p3[0])/slabs,p3[1]+n*(p4[1]-p3[1]
)/slabs,p3[2]+n*(p4[2]-p3[2])/slabs])
sphere(.1);}}}

web(p1=[0,0,0],p2=[-2,3,10],p3=[3,3,-5],p4=[12,0,12],slabs=32);

--
View this message in context: http://forum.openscad.org/
alternative-to-hull-tp20461.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

I would follow a very different path: polyhedron. However, it is very hard to sew all faces of a polyhedron. So I would use something like Parkinbot's sweep (see http://www.thingiverse.com/thing:900137). You will have to compute points but the render will be very quick. Em 16 de fev de 2017 01:35, "dkesler" <dkesler@newarka.edu> escreveu: > Hi, and thank you already for thinking about helping. I need it! > > This is a sculpture by Antoine Pevsner, that I've been trying to recreate. > > <http://forum.openscad.org/file/n20461/IMG_3113.jpg> > > A little inspiration (mostly perspiration) got me [x,y,z] coordinates for > the end points of each of the straight lines. So I have an array with all > the coordinates of the endpoints and here's what I've done: > > Place spheres at the ends of a line. > Hull() them to make that line. > Place spheres at the ends of the next line. > Hull() them to make that next line. > Put n spheres at regular intervals along each line. > Hull() three at a time to make thick triangular faces to fill in the space > between the skew lines. > Repeat with the second line and the third line. > And so on. > > So admittedly it's a ton of lines and hull() ing to do, and I'm not > surprised that it takes a while given my slow computer, but I'm hoping > someone can say something like, "Erik worked on this three years ago, ask > him," or, "try switching this with that or looping this other way." I'm > improving the code kind of steadily, but when I have to wait three hours > for > the lowest of the lowest quality renderings, I lose a little steam. When > it's done rendering, I get some steam back because the thing just looks so > cool. > > <http://forum.openscad.org/file/n20461/pevsner2.jpg> > > The only other idea I had was to individually crop and individually rotate > individually twisted linearly extruded rectangles, but that math was scary > to me compared to the nice loop I've got I've got below. > > I set up the code below to handle two lines and do it with fairly good > looks. If you have a minute to render it and think about how *you'd* do it > that might be faster or more efficient, I'd truly appreciate any feedback. > It takes about 45 seconds to render on my laptop (Lenovo Thinkpad X201T, > dual i7). It's no speed demon and doesn't have anything really special. > > Thanks if you feel like helping! Drew > > > //beginning of abridged code > > module web(p1,p2,p3,p4,slabs){ > $fn=8; > hull(){ > translate(p1) //places spheres at line > sphere(.2); //ends to be hulled > translate(p2) > sphere(.2);} > hull(){ > translate(p3) //places spheres at line > sphere(.2); //ends to be hulled > translate(p4) > sphere(.2);} > > /* This next loop places smaller spheres at even intervals along each line. > It hulls three spheres (two from one side and one from the other) to create > a triangular face, and then it hulls two from the other side and one from > this side, etc, and works its way up the gap.*/ > > for (n=[1:1:slabs]){ > hull(){ > > translate([p1[0]+(n-1)*(p2[0]-p1[0])/slabs,p1[1]+(n-1)*(p2[ > 1]-p1[1])/slabs,p1[2]+(n-1)*(p2[2]-p1[2])/slabs]) > sphere(.1); > > translate([p3[0]+(n-1)*(p4[0]-p3[0])/slabs,p3[1]+(n-1)*(p4[ > 1]-p3[1])/slabs,p3[2]+(n-1)*(p4[2]-p3[2])/slabs]) > sphere(.1); > > translate([p3[0]+n*(p4[0]-p3[0])/slabs,p3[1]+n*(p4[1]-p3[1] > )/slabs,p3[2]+n*(p4[2]-p3[2])/slabs]) > sphere(.1);} > hull(){ > > translate([p1[0]+(n-1)*(p2[0]-p1[0])/slabs,p1[1]+(n-1)*(p2[ > 1]-p1[1])/slabs,p1[2]+(n-1)*(p2[2]-p1[2])/slabs]) > sphere(.1); > > translate([p1[0]+n*(p2[0]-p1[0])/slabs,p1[1]+n*(p2[1]-p1[1] > )/slabs,p1[2]+n*(p2[2]-p1[2])/slabs]) > sphere(.1); > > translate([p3[0]+n*(p4[0]-p3[0])/slabs,p3[1]+n*(p4[1]-p3[1] > )/slabs,p3[2]+n*(p4[2]-p3[2])/slabs]) > sphere(.1);}}} > > web(p1=[0,0,0],p2=[-2,3,10],p3=[3,3,-5],p4=[12,0,12],slabs=32); > > > > -- > View this message in context: http://forum.openscad.org/ > alternative-to-hull-tp20461.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 >
D
dkesler
Sat, Feb 18, 2017 2:57 AM

Thanks Ronaldo,

I've been working on using polyhedron, but it's taking me a while since two polyhedra can't share an edge! So I'm using all kinds of cross products to push the edges apart.

I looked at sweep. I'll try that if I'm not good enough with the polyhedra math. Rendering sure is fast, though, so thanks a lot!

-Drew

On Feb 15, 2017, at 11:47 PM, Ronaldo [via OpenSCAD] ml-node+s1091067n20462h78@n5.nabble.com wrote:

I would follow a very different path: polyhedron. However, it is very hard to sew all faces of a polyhedron. So I would use something like Parkinbot's sweep (see http://www.thingiverse.com/thing:900137). You will have to compute points but the render will be very quick.

Em 16 de fev de 2017 01:35, "dkesler" <[hidden email]> escreveu:

Hi, and thank you already for thinking about helping. I need it!

This is a sculpture by Antoine Pevsner, that I've been trying to recreate.

http://forum.openscad.org/file/n20461/IMG_3113.jpg

A little inspiration (mostly perspiration) got me [x,y,z] coordinates for
the end points of each of the straight lines. So I have an array with all
the coordinates of the endpoints and here's what I've done:

Place spheres at the ends of a line.
Hull() them to make that line.
Place spheres at the ends of the next line.
Hull() them to make that next line.
Put n spheres at regular intervals along each line.
Hull() three at a time to make thick triangular faces to fill in the space
between the skew lines.
Repeat with the second line and the third line.
And so on.

So admittedly it's a ton of lines and hull() ing to do, and I'm not
surprised that it takes a while given my slow computer, but I'm hoping
someone can say something like, "Erik worked on this three years ago, ask
him," or, "try switching this with that or looping this other way." I'm
improving the code kind of steadily, but when I have to wait three hours for
the lowest of the lowest quality renderings, I lose a little steam. When
it's done rendering, I get some steam back because the thing just looks so
cool.

http://forum.openscad.org/file/n20461/pevsner2.jpg

The only other idea I had was to individually crop and individually rotate
individually twisted linearly extruded rectangles, but that math was scary
to me compared to the nice loop I've got I've got below.

I set up the code below to handle two lines and do it with fairly good
looks. If you have a minute to render it and think about how you'd do it
that might be faster or more efficient, I'd truly appreciate any feedback.
It takes about 45 seconds to render on my laptop (Lenovo Thinkpad X201T,
dual i7). It's no speed demon and doesn't have anything really special.

Thanks if you feel like helping! Drew

//beginning of abridged code

module web(p1,p2,p3,p4,slabs){
$fn=8;
hull(){
translate(p1)    //places spheres at line
sphere(.2);  //ends to be hulled
translate(p2)
sphere(.2);}
hull(){
translate(p3)    //places spheres at line
sphere(.2);  //ends to be hulled
translate(p4)
sphere(.2);}

/* This next loop places smaller spheres at even intervals along each line.
It hulls three spheres (two from one side and one from the other) to create
a triangular face, and then it hulls two from the other side and one from
this side, etc, and works its way up the gap.*/

for (n=[1:1:slabs]){
hull(){

translate([p1[0]+(n-1)(p2[0]-p1[0])/slabs,p1[1]+(n-1)(p2[1]-p1[1])/slabs,p1[2]+(n-1)*(p2[2]-p1[2])/slabs])
sphere(.1);

translate([p3[0]+(n-1)(p4[0]-p3[0])/slabs,p3[1]+(n-1)(p4[1]-p3[1])/slabs,p3[2]+(n-1)*(p4[2]-p3[2])/slabs])
sphere(.1);

translate([p3[0]+n*(p4[0]-p3[0])/slabs,p3[1]+n*(p4[1]-p3[1])/slabs,p3[2]+n*(p4[2]-p3[2])/slabs])
sphere(.1);}
hull(){

translate([p1[0]+(n-1)(p2[0]-p1[0])/slabs,p1[1]+(n-1)(p2[1]-p1[1])/slabs,p1[2]+(n-1)*(p2[2]-p1[2])/slabs])
sphere(.1);

translate([p1[0]+n*(p2[0]-p1[0])/slabs,p1[1]+n*(p2[1]-p1[1])/slabs,p1[2]+n*(p2[2]-p1[2])/slabs])
sphere(.1);

translate([p3[0]+n*(p4[0]-p3[0])/slabs,p3[1]+n*(p4[1]-p3[1])/slabs,p3[2]+n*(p4[2]-p3[2])/slabs])
sphere(.1);}}}

web(p1=[0,0,0],p2=[-2,3,10],p3=[3,3,-5],p4=[12,0,12],slabs=32);

--
View this message in context: http://forum.openscad.org/alternative-to-hull-tp20461.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


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

If you reply to this email, your message will be added to the discussion below:
http://forum.openscad.org/alternative-to-hull-tp20461p20462.html
To unsubscribe from alternative to hull?, click here.
NAML

--
View this message in context: http://forum.openscad.org/alternative-to-hull-tp20461p20470.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Thanks Ronaldo, I've been working on using polyhedron, but it's taking me a while since two polyhedra can't share an edge! So I'm using all kinds of cross products to push the edges apart. I looked at sweep. I'll try that if I'm not good enough with the polyhedra math. Rendering sure is fast, though, so thanks a lot! -Drew > On Feb 15, 2017, at 11:47 PM, Ronaldo [via OpenSCAD] <ml-node+s1091067n20462h78@n5.nabble.com> wrote: > > I would follow a very different path: polyhedron. However, it is very hard to sew all faces of a polyhedron. So I would use something like Parkinbot's sweep (see http://www.thingiverse.com/thing:900137). You will have to compute points but the render will be very quick. > > Em 16 de fev de 2017 01:35, "dkesler" <[hidden email]> escreveu: >> Hi, and thank you already for thinking about helping. I need it! >> >> This is a sculpture by Antoine Pevsner, that I've been trying to recreate. >> >> <http://forum.openscad.org/file/n20461/IMG_3113.jpg> >> >> A little inspiration (mostly perspiration) got me [x,y,z] coordinates for >> the end points of each of the straight lines. So I have an array with all >> the coordinates of the endpoints and here's what I've done: >> >> Place spheres at the ends of a line. >> Hull() them to make that line. >> Place spheres at the ends of the next line. >> Hull() them to make that next line. >> Put n spheres at regular intervals along each line. >> Hull() three at a time to make thick triangular faces to fill in the space >> between the skew lines. >> Repeat with the second line and the third line. >> And so on. >> >> So admittedly it's a ton of lines and hull() ing to do, and I'm not >> surprised that it takes a while given my slow computer, but I'm hoping >> someone can say something like, "Erik worked on this three years ago, ask >> him," or, "try switching this with that or looping this other way." I'm >> improving the code kind of steadily, but when I have to wait three hours for >> the lowest of the lowest quality renderings, I lose a little steam. When >> it's done rendering, I get some steam back because the thing just looks so >> cool. >> >> <http://forum.openscad.org/file/n20461/pevsner2.jpg> >> >> The only other idea I had was to individually crop and individually rotate >> individually twisted linearly extruded rectangles, but that math was scary >> to me compared to the nice loop I've got I've got below. >> >> I set up the code below to handle two lines and do it with fairly good >> looks. If you have a minute to render it and think about how *you'd* do it >> that might be faster or more efficient, I'd truly appreciate any feedback. >> It takes about 45 seconds to render on my laptop (Lenovo Thinkpad X201T, >> dual i7). It's no speed demon and doesn't have anything really special. >> >> Thanks if you feel like helping! Drew >> >> >> //beginning of abridged code >> >> module web(p1,p2,p3,p4,slabs){ >> $fn=8; >> hull(){ >> translate(p1) //places spheres at line >> sphere(.2); //ends to be hulled >> translate(p2) >> sphere(.2);} >> hull(){ >> translate(p3) //places spheres at line >> sphere(.2); //ends to be hulled >> translate(p4) >> sphere(.2);} >> >> /* This next loop places smaller spheres at even intervals along each line. >> It hulls three spheres (two from one side and one from the other) to create >> a triangular face, and then it hulls two from the other side and one from >> this side, etc, and works its way up the gap.*/ >> >> for (n=[1:1:slabs]){ >> hull(){ >> >> translate([p1[0]+(n-1)*(p2[0]-p1[0])/slabs,p1[1]+(n-1)*(p2[1]-p1[1])/slabs,p1[2]+(n-1)*(p2[2]-p1[2])/slabs]) >> sphere(.1); >> >> translate([p3[0]+(n-1)*(p4[0]-p3[0])/slabs,p3[1]+(n-1)*(p4[1]-p3[1])/slabs,p3[2]+(n-1)*(p4[2]-p3[2])/slabs]) >> sphere(.1); >> >> translate([p3[0]+n*(p4[0]-p3[0])/slabs,p3[1]+n*(p4[1]-p3[1])/slabs,p3[2]+n*(p4[2]-p3[2])/slabs]) >> sphere(.1);} >> hull(){ >> >> translate([p1[0]+(n-1)*(p2[0]-p1[0])/slabs,p1[1]+(n-1)*(p2[1]-p1[1])/slabs,p1[2]+(n-1)*(p2[2]-p1[2])/slabs]) >> sphere(.1); >> >> translate([p1[0]+n*(p2[0]-p1[0])/slabs,p1[1]+n*(p2[1]-p1[1])/slabs,p1[2]+n*(p2[2]-p1[2])/slabs]) >> sphere(.1); >> >> translate([p3[0]+n*(p4[0]-p3[0])/slabs,p3[1]+n*(p4[1]-p3[1])/slabs,p3[2]+n*(p4[2]-p3[2])/slabs]) >> sphere(.1);}}} >> >> web(p1=[0,0,0],p2=[-2,3,10],p3=[3,3,-5],p4=[12,0,12],slabs=32); >> >> >> >> -- >> View this message in context: http://forum.openscad.org/alternative-to-hull-tp20461.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 > > _______________________________________________ > OpenSCAD mailing list > [hidden email] > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > > If you reply to this email, your message will be added to the discussion below: > http://forum.openscad.org/alternative-to-hull-tp20461p20462.html > To unsubscribe from alternative to hull?, click here. > NAML -- View this message in context: http://forum.openscad.org/alternative-to-hull-tp20461p20470.html Sent from the OpenSCAD mailing list archive at Nabble.com.