# [OpenSCAD] Polyhedron tube with irregular sides -- is it possible ?

runsun runsun at gmail.com
Mon Sep 14 02:26:25 EDT 2015

```I wanna make some tube-like shape with irregular sides, similar like one
below:

<http://forum.openscad.org/file/n13813/20150914_irregular_tube_by_extrude.png>

This is made with a polygon + linear_extrude out of

> pts_out =  [ [0,0],[6,0],[6,5],[0,5] ];
> pts_in =  [ [2,1],[5,2], [3,4]];

To make a polyhedron, I convert pts to 3D:

> pts =  [[0, 0, 0], [6, 0, 0], [6, 5, 0], [0, 5, 0], [2, 1, 0], [5, 2, 0],
> [3, 4, 0], [0, 0, 3], [6, 0, 3], [6, 5, 3], [0, 5, 3], [2, 1, 3], [5, 2,
> 3], [3, 4, 3]];

Their indices are placed on the extruded shape as follow:

<http://forum.openscad.org/file/n13813/150914_irregular_tube_marked.png>

I tried several combinations of faces but couldn't get a polyhedron. Here
are two tries:

>
> faces1= [[0, 7, 8, 1], [1, 8, 9, 2], [2, 9, 10, 3], [3, 10, 7, 0], [4, 5,
> 12, 11], [5, 6, 13, 12], [6, 4, 11, 13], [0, 1, 2, 3], [4, 5, 6], [7, 8,
> 9, 10], [11, 12, 13]];
> polyhedron( points = pts, faces = faces1  );

<http://forum.openscad.org/file/n13813/20150914_irregular_tube_faces1.png>

>
> faces2 = [[0, 7, 8, 1], [1, 8, 9, 2], [2, 9, 10, 3], [3, 10, 7, 0], [4, 5,
> 12, 11], [5, 6, 13, 12], [6, 4, 11, 13], [0, 1, 2, 3, 4, 5, 6], [7, 8, 9,
> 10, 11, 12, 13]];
> color(undef,0.8)
> polyhedron( points = pts , faces = faces2 );

-----

\$  Runsun Pan, PhD

\$ -- libs: doctest , faces ( git ), offliner ( git );

tips: hash( 1 , 2 ), sweep , var

\$ -- Linux Mint 17.1 Rebecca x64  + OpenSCAD 2015.03.15/2015.04.01.nightly

--
View this message in context: http://forum.openscad.org/Polyhedron-tube-with-irregular-sides-is-it-possible-tp13813.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

```

More information about the Discuss mailing list