discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

polyhedron to a 3D printing from

C
Cole
Thu, Oct 13, 2016 5:11 PM

i have a polyhedron on openscad and i want to 3D print it but it is not
coming up as a solid.

--
View this message in context: http://forum.openscad.org/polyhedron-to-a-3D-printing-from-tp18692.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

i have a polyhedron on openscad and i want to 3D print it but it is not coming up as a solid. -- View this message in context: http://forum.openscad.org/polyhedron-to-a-3D-printing-from-tp18692.html Sent from the OpenSCAD mailing list archive at Nabble.com.
J
jon
Thu, Oct 13, 2016 5:15 PM

Where is it not "coming up as a solid"?  Do you have an STL which you
can share with us?  Do you have source code that you can share with us?

Jon

On 10/13/2016 1:11 PM, Cole wrote:

i have a polyhedron on openscad and i want to 3D print it but it is not
coming up as a solid.

Where is it not "coming up as a solid"? Do you have an STL which you can share with us? Do you have source code that you can share with us? Jon On 10/13/2016 1:11 PM, Cole wrote: > i have a polyhedron on openscad and i want to 3D print it but it is not > coming up as a solid. >
CH
Cole Herbert
Thu, Oct 13, 2016 5:20 PM

polyhedron(
points=[
[0,0,0],  //0
[5,0,0],  //1
[5,100,0],  //2
[0,100,0],  //3
[0,0,10],  //4
[5,0,10],  //5
[5,100,10],  //6
[0,100,10],  //7
[2.5,100,20],//8
[2.5,0,20],//9
[2.5,120,0],//10
[0,0,0]],//11

faces = [
[0,1,2,3], //bottom
[0,3,7,4], //left
[1,2,6,5], //right
[1,0,4,5], //front
[3,2,6,7], //back
[4,7,8,9], //left blade
[5,9,8,6], //right blade
[4,9,5], // back 2
[7,8,6], //front 2
[3,10,7], //piont left
[7,8,10], //tip
[10,6,2],
[10,8,6]]

);
}

(it is only sowing up as a 2D sides instated of the 3D shape i wan to print
out or diffreance out of somthing.

On 13 October 2016 at 13:15, jon jon@jonbondy.com wrote:

Where is it not "coming up as a solid"?  Do you have an STL which you can
share with us?  Do you have source code that you can share with us?

Jon

On 10/13/2016 1:11 PM, Cole wrote:

i have a polyhedron on openscad and i want to 3D print it but it is not
coming up as a solid.

polyhedron( points=[ [0,0,0], //0 [5,0,0], //1 [5,100,0], //2 [0,100,0], //3 [0,0,10], //4 [5,0,10], //5 [5,100,10], //6 [0,100,10], //7 [2.5,100,20],//8 [2.5,0,20],//9 [2.5,120,0],//10 [0,0,0]],//11 faces = [ [0,1,2,3], //bottom [0,3,7,4], //left [1,2,6,5], //right [1,0,4,5], //front [3,2,6,7], //back [4,7,8,9], //left blade [5,9,8,6], //right blade [4,9,5], // back 2 [7,8,6], //front 2 [3,10,7], //piont left [7,8,10], //tip [10,6,2], [10,8,6]] ); } (it is only sowing up as a 2D sides instated of the 3D shape i wan to print out or diffreance out of somthing. On 13 October 2016 at 13:15, jon <jon@jonbondy.com> wrote: > Where is it not "coming up as a solid"? Do you have an STL which you can > share with us? Do you have source code that you can share with us? > > Jon > > On 10/13/2016 1:11 PM, Cole wrote: > >> i have a polyhedron on openscad and i want to 3D print it but it is not >> coming up as a solid. >> >> > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
J
jon
Thu, Oct 13, 2016 5:25 PM

It shows up as a 3D object in OpenSCAD after I remove the trailing "}"

Jon

On 10/13/2016 1:20 PM, Cole Herbert wrote:

polyhedron(
points=[
[0,0,0],  //0
[5,0,0],  //1
[5,100,0],  //2
[0,100,0],  //3
[0,0,10],  //4
[5,0,10],  //5
[5,100,10],  //6
[0,100,10],  //7
[2.5,100,20],//8
[2.5,0,20],//9
[2.5,120,0],//10
[0,0,0]],//11

faces = [
[0,1,2,3], //bottom
[0,3,7,4], //left
[1,2,6,5], //right
[1,0,4,5], //front
[3,2,6,7], //back
[4,7,8,9], //left blade
[5,9,8,6], //right blade
[4,9,5], // back 2
[7,8,6], //front 2
[3,10,7], //piont left
[7,8,10], //tip
[10,6,2],
[10,8,6]]

);
}

(it is only sowing up as a 2D sides instated of the 3D shape i wan to
print out or diffreance out of somthing.

It shows up as a 3D object in OpenSCAD after I remove the trailing "}" Jon On 10/13/2016 1:20 PM, Cole Herbert wrote: > polyhedron( > points=[ > [0,0,0], //0 > [5,0,0], //1 > [5,100,0], //2 > [0,100,0], //3 > [0,0,10], //4 > [5,0,10], //5 > [5,100,10], //6 > [0,100,10], //7 > [2.5,100,20],//8 > [2.5,0,20],//9 > [2.5,120,0],//10 > [0,0,0]],//11 > > > faces = [ > [0,1,2,3], //bottom > [0,3,7,4], //left > [1,2,6,5], //right > [1,0,4,5], //front > [3,2,6,7], //back > [4,7,8,9], //left blade > [5,9,8,6], //right blade > [4,9,5], // back 2 > [7,8,6], //front 2 > [3,10,7], //piont left > [7,8,10], //tip > [10,6,2], > [10,8,6]] > > ); > } > > (it is only sowing up as a 2D sides instated of the 3D shape i wan to > print out or diffreance out of somthing. >
CH
Cole Herbert
Thu, Oct 13, 2016 5:35 PM

i have it showing but when i go to export it is well not show up my cube
well show up but the polyhedron well not show.

On 13 October 2016 at 13:25, jon jon@jonbondy.com wrote:

It shows up as a 3D object in OpenSCAD after I remove the trailing "}"

Jon

On 10/13/2016 1:20 PM, Cole Herbert wrote:

polyhedron(
points=[
[0,0,0],  //0
[5,0,0],  //1
[5,100,0],  //2
[0,100,0],  //3
[0,0,10],  //4
[5,0,10],  //5
[5,100,10],  //6
[0,100,10],  //7
[2.5,100,20],//8
[2.5,0,20],//9
[2.5,120,0],//10
[0,0,0]],//11

faces = [
[0,1,2,3], //bottom
[0,3,7,4], //left
[1,2,6,5], //right
[1,0,4,5], //front
[3,2,6,7], //back
[4,7,8,9], //left blade
[5,9,8,6], //right blade
[4,9,5], // back 2
[7,8,6], //front 2
[3,10,7], //piont left
[7,8,10], //tip
[10,6,2],
[10,8,6]]

);
}

(it is only sowing up as a 2D sides instated of the 3D shape i wan to
print out or diffreance out of somthing.

i have it showing but when i go to export it is well not show up my cube well show up but the polyhedron well not show. On 13 October 2016 at 13:25, jon <jon@jonbondy.com> wrote: > It shows up as a 3D object in OpenSCAD after I remove the trailing "}" > > Jon > > > On 10/13/2016 1:20 PM, Cole Herbert wrote: > >> polyhedron( >> points=[ >> [0,0,0], //0 >> [5,0,0], //1 >> [5,100,0], //2 >> [0,100,0], //3 >> [0,0,10], //4 >> [5,0,10], //5 >> [5,100,10], //6 >> [0,100,10], //7 >> [2.5,100,20],//8 >> [2.5,0,20],//9 >> [2.5,120,0],//10 >> [0,0,0]],//11 >> >> >> faces = [ >> [0,1,2,3], //bottom >> [0,3,7,4], //left >> [1,2,6,5], //right >> [1,0,4,5], //front >> [3,2,6,7], //back >> [4,7,8,9], //left blade >> [5,9,8,6], //right blade >> [4,9,5], // back 2 >> [7,8,6], //front 2 >> [3,10,7], //piont left >> [7,8,10], //tip >> [10,6,2], >> [10,8,6]] >> >> ); >> } >> >> (it is only sowing up as a 2D sides instated of the 3D shape i wan to >> print out or diffreance out of somthing. >> >> > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
TP
Torsten Paul
Thu, Oct 13, 2016 5:39 PM

On 10/13/2016 07:35 PM, Cole Herbert wrote:

i have it showing but when i go to export it is well not show
up my cube well show up but the polyhedron well not show.

Some of the faces look into the wrong direction. Basically
reverse the point order of faces showing up in pink in
"Thrown Together" display mode.

See: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/FAQ#Why_is_my_model_showing_up_with_F5_but_not_F6.3F

ciao,
Torsten.

On 10/13/2016 07:35 PM, Cole Herbert wrote: > i have it showing but when i go to export it is well not show > up my cube well show up but the polyhedron well not show. > Some of the faces look into the wrong direction. Basically reverse the point order of faces showing up in pink in "Thrown Together" display mode. See: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/FAQ#Why_is_my_model_showing_up_with_F5_but_not_F6.3F ciao, Torsten.
F
fred_dot_u
Thu, Oct 13, 2016 7:56 PM

I'm not sure if you want the answers beyond the explanation provided, but for
my own exercise, I found them.

1, 2, 6, 5 > 1, 5, 6, 2
7, 8, 10 > 7, 10, 8
10, 6, 2 > 10, 2, 6
10, 8, 6 > 10, 6, 8

remove:
3, 2, 6, 7
7, 8, 6

add:
10, 3, 2

not being particularly proficient in OpenSCAD, I can't guess what the two
faces would do to your model, as they become internal "bulkheads" once you
close the non-manifold with 10, 3, 2, so it's probably a good idea to make
that change.

--
View this message in context: http://forum.openscad.org/polyhedron-to-a-3D-printing-from-tp18692p18699.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I'm not sure if you want the answers beyond the explanation provided, but for my own exercise, I found them. 1, 2, 6, 5 > 1, 5, 6, 2 7, 8, 10 > 7, 10, 8 10, 6, 2 > 10, 2, 6 10, 8, 6 > 10, 6, 8 remove: 3, 2, 6, 7 7, 8, 6 add: 10, 3, 2 not being particularly proficient in OpenSCAD, I can't guess what the two faces would do to your model, as they become internal "bulkheads" once you close the non-manifold with 10, 3, 2, so it's probably a good idea to make that change. -- View this message in context: http://forum.openscad.org/polyhedron-to-a-3D-printing-from-tp18692p18699.html Sent from the OpenSCAD mailing list archive at Nabble.com.
K
kitwallace
Mon, Apr 10, 2017 7:10 PM

Bit late to the scene on this one but its useful to be able to orient faces
when 'thrown-together' shows some faces are the wrong way round.  This is
the code I use:

// ensure that all faces have a lhs orientation
function reverse(l) =
[for (i=[1:len(l)]) l[len(l)-i]];

function orthogonal(v0,v1,v2) =  cross(v1-v0,v2-v1);

function normal(face) =
let (n=orthogonal(face[0],face[1],face[2]))
- n / norm(n);
function vsum(points,i=0) =
i < len(points)
?  (points[i] + vsum(points,i+1))
:  [0,0,0];
function centroid(points) =
vsum(points) / len(points);

function as_points(indexes,points) =
[for (i=[0:len(indexes)-1])
points[indexes[i]]
];
function cosine_between(u, v) =(u * v) / (norm(u) * norm(v));

function lhs_faces(faces,vertices) =
[for (face = faces)
let(points = as_points(face,vertices))
cosine_between(normal(points), centroid(points)) < 0
?  reverse(face)  :  face
];

//original data
points=[
[0,0,0],  //0
[5,0,0],  //1
[5,100,0],  //2
[0,100,0],  //3
[0,0,10],  //4
[5,0,10],  //5
[5,100,10],  //6
[0,100,10],  //7
[2.5,100,20],//8
[2.5,0,20],//9
[2.5,120,0],//10
[0,0,0]];

faces = [
[0,1,2,3], //bottom
[0,3,7,4], //left
[1,2,6,5], //right
[1,0,4,5], //front
[3,2,6,7], //back
[4,7,8,9], //left blade
[5,9,8,6], //right blade
[4,9,5], // back 2
[7,8,6], //front 2
[3,10,7], //piont left
[7,8,10], //tip
[10,6,2],
[10,8,6]]
;

oriented_faces = lhs_faces(faces,points);
polyhedron(points=points,faces=oriented_faces);

--
View this message in context: http://forum.openscad.org/polyhedron-to-a-3D-printing-from-tp18692p21162.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Bit late to the scene on this one but its useful to be able to orient faces when 'thrown-together' shows some faces are the wrong way round. This is the code I use: // ensure that all faces have a lhs orientation function reverse(l) = [for (i=[1:len(l)]) l[len(l)-i]]; function orthogonal(v0,v1,v2) = cross(v1-v0,v2-v1); function normal(face) = let (n=orthogonal(face[0],face[1],face[2])) - n / norm(n); function vsum(points,i=0) = i < len(points) ? (points[i] + vsum(points,i+1)) : [0,0,0]; function centroid(points) = vsum(points) / len(points); function as_points(indexes,points) = [for (i=[0:len(indexes)-1]) points[indexes[i]] ]; function cosine_between(u, v) =(u * v) / (norm(u) * norm(v)); function lhs_faces(faces,vertices) = [for (face = faces) let(points = as_points(face,vertices)) cosine_between(normal(points), centroid(points)) < 0 ? reverse(face) : face ]; //original data points=[ [0,0,0], //0 [5,0,0], //1 [5,100,0], //2 [0,100,0], //3 [0,0,10], //4 [5,0,10], //5 [5,100,10], //6 [0,100,10], //7 [2.5,100,20],//8 [2.5,0,20],//9 [2.5,120,0],//10 [0,0,0]]; faces = [ [0,1,2,3], //bottom [0,3,7,4], //left [1,2,6,5], //right [1,0,4,5], //front [3,2,6,7], //back [4,7,8,9], //left blade [5,9,8,6], //right blade [4,9,5], // back 2 [7,8,6], //front 2 [3,10,7], //piont left [7,8,10], //tip [10,6,2], [10,8,6]] ; oriented_faces = lhs_faces(faces,points); polyhedron(points=points,faces=oriented_faces); -- View this message in context: http://forum.openscad.org/polyhedron-to-a-3D-printing-from-tp18692p21162.html Sent from the OpenSCAD mailing list archive at Nabble.com.
RP
Ronaldo Persiano
Mon, Apr 10, 2017 7:38 PM

It doesn't work with:

//original data
p=[
[0,0,0],  //0
[5,0,0],  //1
[5,100,0],  //2
[0,100,0],  //3
[0,0,10],  //4
[5,0,10],  //5
[5,100,10],  //6
[0,100,10],  //7
[2.5,100,20],//8
[2.5,0,20],//9
[2.5,120,0],//10
[0,0,0]];

points = [for(pi=p) pi-[0,200,0]];

2017-04-10 16:10 GMT-03:00 kitwallace kit.wallace@gmail.com:

Bit late to the scene on this one but its useful to be able to orient faces
when 'thrown-together' shows some faces are the wrong way round.  This is
the code I use:

It doesn't work with: //original data p=[ [0,0,0], //0 [5,0,0], //1 [5,100,0], //2 [0,100,0], //3 [0,0,10], //4 [5,0,10], //5 [5,100,10], //6 [0,100,10], //7 [2.5,100,20],//8 [2.5,0,20],//9 [2.5,120,0],//10 [0,0,0]]; points = [for(pi=p) pi-[0,200,0]]; 2017-04-10 16:10 GMT-03:00 kitwallace <kit.wallace@gmail.com>: > Bit late to the scene on this one but its useful to be able to orient faces > when 'thrown-together' shows some faces are the wrong way round. This is > the code I use: >
K
kitwallace
Mon, Apr 10, 2017 7:44 PM

Odd - works for me.

--
View this message in context: http://forum.openscad.org/polyhedron-to-a-3D-printing-from-tp18692p21164.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Odd - works for me. -- View this message in context: http://forum.openscad.org/polyhedron-to-a-3D-printing-from-tp18692p21164.html Sent from the OpenSCAD mailing list archive at Nabble.com.