discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

error preparing boat propeller

J
jon
Sat, Feb 25, 2017 12:31 PM

The following code seems fine using F5, but blows up as shown using F6.
When F6 completes, the propeller hub is visible, but the blades are
gone. Comments?

===

Compiling design (CSG Tree generation)...

Rendering Polygon Mesh using CGAL...

PolySet has nonplanar faces. Attempting alternate construction

ERROR: Alternate construction failed. CGAL error in
CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr:
e->incident_sface() != SFace_const_handle() File:
/opt/mxe/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_S2/SM_const_decorator.h
Line: 326

PolySet has nonplanar faces. Attempting alternate construction

ERROR: Alternate construction failed. CGAL error in
CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr:
e->incident_sface() != SFace_const_handle() File:
/opt/mxe/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_S2/SM_const_decorator.h
Line: 326

PolySet has nonplanar faces. Attempting alternate construction

ERROR: Alternate construction failed. CGAL error in
CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr:
e->incident_sface() != SFace_const_handle() File:
/opt/mxe/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_S2/SM_const_decorator.h
Line: 326

Geometries in cache: 39

Geometry cache size in bytes: 37537704

CGAL Polyhedrons in cache: 16

CGAL cache size in bytes: 101333344

Total rendering time: 0 hours, 1 minutes, 8 seconds

Top level object is a 3D object:

Simple: yes

Vertices: 2840

Halfedges: 14042

Edges: 7021

Halffacets: 8364

Facets: 4182

Volumes: 2

Rendering finished.

===

use <naca4.scad>      // see http://www.thingiverse.com/thing:898554
use <shortcuts.scad>  // see http://www.thingiverse.com/thing:644830
use <naca_sweep.scad> // see http://www.thingiverse.com/thing:900137
use <splines.scad>

// some parameters
N = 100;        // refinement
R_axis = 100;  // radius of axle
r_bore = 37.5;    // radius of axle bore
size = .1;      // sizing factor
slices = false;  // set true to view interpolation slices
ty = 50;        // common y-distancing of blades

// core data to be interpolated by nSpline()
//      transform data            airfoil nacaXYZZ
//--------------------------------------------------
A = [ // Tx    Ty  Tz  Rz  Ry  |  L    X    ZZ
[0,    ty,  60, -25,  0,  300,  .12,  .1],
[-50,  ty,  200, -50,  0,  600,  .2,  .08],
[-100, ty,  500, -75,  0,  450,  .1,  .06],
[00,  ty,  660, -82,  10,  10,  .01,  .1],
];

// Main object
module MyProp()
Rz(180)
S(size, size, size)
boat_prop(3);

difference() {
MyProp();
// drill out center hole
rotate([0, 90, 0])
cylinder(h = 100, r = 3.75, $fn = 100);
// dog slot
cube([3.75, 20, 3.75], center = true);
}

module boat_prop(M = 2)
{
m = slices?1:M; // used for slices view
$fn = N;        // refinement
shift = -130;  // shift for axis parts
shl = 270;      // length of axis
B = nSpline(A, 2*N);  // interpolation

D()  // difference
{
U()  // union of blades and axle
{
for(i=[0:360/m:359])
{
C = gen_dat(slices?A:B,N);
R(i)                // = Rx(); x-rotates object
sweep(C, showslices=slices);
}
if(!slices)
axis(shift, shl);
}
Tx(shift+shl*.2)  // translate
Ry(90)            // rotate
Cy(r_bore,shl*.9); // cylinder
}

// generate all data - applies transformation and airfoil params
function gen_dat(B,N) =
[for(i=[0:len(B)-1])
let(R = B[i])
Tz_(R[2],  // z-translate 2D-shape
R_(R[4], 0, 180+R[3], // rotate 2D-shape
T_(R[0],R[1], 0, // xyz-translate 2D-shape
vec3D(airfoil_data(N=N, L=R[5], naca=[R[6],.5,R[7]], open=true)
))))
];
}

module axis(shift = 0, shl = 200)
{
T(shift)        // = Tx()
Ry(90)
Cy(R_axis,shl);
T(-shl/2+shift)
Ry(90)
Sp(R_axis);    // sphere
}

The following code seems fine using F5, but blows up as shown using F6. When F6 completes, the propeller hub is visible, but the blades are gone. Comments? === Compiling design (CSG Tree generation)... Rendering Polygon Mesh using CGAL... PolySet has nonplanar faces. Attempting alternate construction ERROR: Alternate construction failed. CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr: e->incident_sface() != SFace_const_handle() File: /opt/mxe/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_S2/SM_const_decorator.h Line: 326 PolySet has nonplanar faces. Attempting alternate construction ERROR: Alternate construction failed. CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr: e->incident_sface() != SFace_const_handle() File: /opt/mxe/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_S2/SM_const_decorator.h Line: 326 PolySet has nonplanar faces. Attempting alternate construction ERROR: Alternate construction failed. CGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation! Expr: e->incident_sface() != SFace_const_handle() File: /opt/mxe/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_S2/SM_const_decorator.h Line: 326 Geometries in cache: 39 Geometry cache size in bytes: 37537704 CGAL Polyhedrons in cache: 16 CGAL cache size in bytes: 101333344 Total rendering time: 0 hours, 1 minutes, 8 seconds Top level object is a 3D object: Simple: yes Vertices: 2840 Halfedges: 14042 Edges: 7021 Halffacets: 8364 Facets: 4182 Volumes: 2 Rendering finished. === use <naca4.scad> // see http://www.thingiverse.com/thing:898554 use <shortcuts.scad> // see http://www.thingiverse.com/thing:644830 use <naca_sweep.scad> // see http://www.thingiverse.com/thing:900137 use <splines.scad> // some parameters N = 100; // refinement R_axis = 100; // radius of axle r_bore = 37.5; // radius of axle bore size = .1; // sizing factor slices = false; // set true to view interpolation slices ty = 50; // common y-distancing of blades // core data to be interpolated by nSpline() // transform data airfoil nacaXYZZ //-------------------------------------------------- A = [ // Tx Ty Tz Rz Ry | L X ZZ [0, ty, 60, -25, 0, 300, .12, .1], [-50, ty, 200, -50, 0, 600, .2, .08], [-100, ty, 500, -75, 0, 450, .1, .06], [00, ty, 660, -82, 10, 10, .01, .1], ]; // Main object module MyProp() Rz(180) S(size, size, size) boat_prop(3); difference() { MyProp(); // drill out center hole rotate([0, 90, 0]) cylinder(h = 100, r = 3.75, $fn = 100); // dog slot cube([3.75, 20, 3.75], center = true); } module boat_prop(M = 2) { m = slices?1:M; // used for slices view $fn = N; // refinement shift = -130; // shift for axis parts shl = 270; // length of axis B = nSpline(A, 2*N); // interpolation D() // difference { U() // union of blades and axle { for(i=[0:360/m:359]) { C = gen_dat(slices?A:B,N); R(i) // = Rx(); x-rotates object sweep(C, showslices=slices); } if(!slices) axis(shift, shl); } Tx(shift+shl*.2) // translate Ry(90) // rotate Cy(r_bore,shl*.9); // cylinder } // generate all data - applies transformation and airfoil params function gen_dat(B,N) = [for(i=[0:len(B)-1]) let(R = B[i]) Tz_(R[2], // z-translate 2D-shape R_(R[4], 0, 180+R[3], // rotate 2D-shape T_(R[0],R[1], 0, // xyz-translate 2D-shape vec3D(airfoil_data(N=N, L=R[5], naca=[R[6],.5,R[7]], open=true) )))) ]; } module axis(shift = 0, shl = 200) { T(shift) // = Tx() Ry(90) Cy(R_axis,shl); T(-shl/2+shift) Ry(90) Sp(R_axis); // sphere }
RP
Ronaldo Persiano
Sat, Feb 25, 2017 4:21 PM

jon,

The error you have goten is caused by non-planar faces in the sweep model.
Parkinbot has recently updated the Naca_sweep.scad in Thingiverse with a
version that triangulates all swept facets. You should download the more
recent version which works fine for me:

jon, The error you have goten is caused by non-planar faces in the sweep model. Parkinbot has recently updated the Naca_sweep.scad in Thingiverse with a version that triangulates all swept facets. You should download the more recent version which works fine for me: ​
P
Parkinbot
Sat, Feb 25, 2017 6:09 PM

Jon,

I uploaded the newest version of Naca_sweep.scad to
http://www.thingiverse.com/thing:1208001. The sweep() in this version has
new parameters:

sweep(dat, convexity = 5, showslices = false, close = false, planar_caps =
false)

Using the default "planar_caps=false" triangulates the caps, as Ronaldo
already stated. Actually, I didn't have any problems to F6-render the code
with planar_caps set to true or false, using OpenSCAD 2017.01.20. Let me
anote that it might be a good idea to strengthen the blade at its root by
altering the last column ZZ in the matrix A. Try e.g.:

// core data to be interpolated by nSpline()
//      transform data            airfoil nacaXYZZ
A = [ // Tx    Ty  Tz  Rz  Ry  |  L    X    ZZ
[0,    ty,  60, -25,  0,  300,  .12,  .2],
[-50,  ty,  200, -50,  0,  600,  .2,  .12],
[-100, ty,  500, -75,  0,  450,  .1,  .06],
[00,  ty,  660, -82,  10,  10,  .01,  .1],

--
View this message in context: http://forum.openscad.org/error-preparing-boat-propeller-tp20570p20574.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Jon, I uploaded the newest version of Naca_sweep.scad to http://www.thingiverse.com/thing:1208001. The sweep() in this version has new parameters: > sweep(dat, convexity = 5, showslices = false, close = false, planar_caps = > false) Using the default "planar_caps=false" triangulates the caps, as Ronaldo already stated. Actually, I didn't have any problems to F6-render the code with planar_caps set to true or false, using OpenSCAD 2017.01.20. Let me anote that it might be a good idea to strengthen the blade at its root by altering the last column ZZ in the matrix A. Try e.g.: > // core data to be interpolated by nSpline() > // transform data airfoil nacaXYZZ > A = [ // Tx Ty Tz Rz Ry | L X ZZ > [0, ty, 60, -25, 0, 300, .12, .2], > [-50, ty, 200, -50, 0, 600, .2, .12], > [-100, ty, 500, -75, 0, 450, .1, .06], > [00, ty, 660, -82, 10, 10, .01, .1], -- View this message in context: http://forum.openscad.org/error-preparing-boat-propeller-tp20570p20574.html Sent from the OpenSCAD mailing list archive at Nabble.com.
J
jon
Sun, Feb 26, 2017 5:50 PM

That did the trick!  Thank you!

Jon

On 2/25/2017 1:09 PM, Parkinbot wrote:

Jon,

I uploaded the newest version of Naca_sweep.scad to
http://www.thingiverse.com/thing:1208001. The sweep() in this version has
new parameters:

sweep(dat, convexity = 5, showslices = false, close = false, planar_caps =
false)

Using the default "planar_caps=false" triangulates the caps, as Ronaldo
already stated. Actually, I didn't have any problems to F6-render the code
with planar_caps set to true or false, using OpenSCAD 2017.01.20. Let me
anote that it might be a good idea to strengthen the blade at its root by
altering the last column ZZ in the matrix A. Try e.g.:

// core data to be interpolated by nSpline()
//      transform data            airfoil nacaXYZZ
A = [ // Tx    Ty  Tz  Rz  Ry  |  L    X    ZZ
[0,    ty,  60, -25,  0,  300,  .12,  .2],
[-50,  ty,  200, -50,  0,  600,  .2,  .12],
[-100, ty,  500, -75,  0,  450,  .1,  .06],
[00,  ty,  660, -82,  10,  10,  .01,  .1],

--
View this message in context: http://forum.openscad.org/error-preparing-boat-propeller-tp20570p20574.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


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7998 / Virus Database: 4756/14020 - Release Date: 02/25/17

That did the trick! Thank you! Jon On 2/25/2017 1:09 PM, Parkinbot wrote: > Jon, > > I uploaded the newest version of Naca_sweep.scad to > http://www.thingiverse.com/thing:1208001. The sweep() in this version has > new parameters: > >> sweep(dat, convexity = 5, showslices = false, close = false, planar_caps = >> false) > Using the default "planar_caps=false" triangulates the caps, as Ronaldo > already stated. Actually, I didn't have any problems to F6-render the code > with planar_caps set to true or false, using OpenSCAD 2017.01.20. Let me > anote that it might be a good idea to strengthen the blade at its root by > altering the last column ZZ in the matrix A. Try e.g.: > > >> // core data to be interpolated by nSpline() >> // transform data airfoil nacaXYZZ >> A = [ // Tx Ty Tz Rz Ry | L X ZZ >> [0, ty, 60, -25, 0, 300, .12, .2], >> [-50, ty, 200, -50, 0, 600, .2, .12], >> [-100, ty, 500, -75, 0, 450, .1, .06], >> [00, ty, 660, -82, 10, 10, .01, .1], > > > > > -- > View this message in context: http://forum.openscad.org/error-preparing-boat-propeller-tp20570p20574.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 > > > > ----- > No virus found in this message. > Checked by AVG - www.avg.com > Version: 2016.0.7998 / Virus Database: 4756/14020 - Release Date: 02/25/17 > >
J
jon
Mon, Feb 27, 2017 4:12 PM

So, now on to scaling.

We want a 1/2" shaft with a 3/16" center bore and a dog slot.  We also
want propellers that are roughly 3" in diameter.

I tried to express everything in native sizes by changing the "size"
value to 1, but that threw everything off, even after I tried to adjust
the values in the matrix by dividing them all by 10.  At the moment, the
shaft is correctly scaled, but the propellers do not touch the shaft,
and they are way too large.

I don't mean to be ungrateful for this amazing technology, but would it
be possible to allow some of these things to be adjusted in a way that
was less obscure and simpler?  If the answer is "I don't have time for
this", I completely understand.

Thanks for listening!

Jon

use <naca4.scad>      // see http://www.thingiverse.com/thing:898554
use <shortcuts.scad>  // see http://www.thingiverse.com/thing:644830
use <naca_sweep.scad> // see http://www.thingiverse.com/thing:900137
use <splines.scad>

// some parameters
inches = 25.4;
N = 100;                        // refinement
R_axis = 10inches * 0.25;        // radius of axle
r_bore = 10
inches * 3/16/2;    // radius of axle bore
size = 0.1;                        // sizing factor
slices = false;                    // set true to view interpolation slices
ty = 50;                        // common y-distancing of blades
dog = inches * 0.125;

// core data to be interpolated by nSpline()
//      transform data            airfoil nacaXYZZ
//--------------------------------------------------
A = [ // Tx    Ty  Tz  Rz  Ry  |  L    X    ZZ
[0,    ty,  60, -25,  0,  300,  .12,  .2],
[-50,  ty,  200, -50,  0,  600,  .2,  .12],
[-100, ty,  500, -75,  0,  450,  .1,  .06],
[00,  ty,  660, -82,  10,  10,  .01,  .1],
];

// Main object
module MyProp()
Rz(180)
S(size, size, size)
boat_prop(3);

difference() {
MyProp();
// drill out center hole
rotate([0, 90, 0])
cylinder(h = 100, r = 3.75, $fn = 100);
// dog slot
cube([dog, 2 * R_axis/10 + 1, dog], center = true);
}

module boat_prop(M = 2)
{
m = slices?1:M; // used for slices view
$fn = N;        // refinement
shift = -130;  // shift for axis parts
shl = 270;      // length of axis
B = nSpline(A, 2*N);  // interpolation

D()  // difference
{
U()  // union of blades and axle
{
for(i=[0:360/m:359])
{
C = gen_dat(slices?A:B,N);
R(i)                // = Rx(); x-rotates object
sweep(C, showslices=slices);
}
if(!slices)
axis(shift, shl);
}
Tx(shift+shl*.2)  // translate
Ry(90)            // rotate
Cy(r_bore,shl*.9); // cylinder
}

// generate all data - applies transformation and airfoil params
function gen_dat(B,N) =
[for(i=[0:len(B)-1])
let(R = B[i])
Tz_(R[2],  // z-translate 2D-shape
R_(R[4], 0, 180+R[3], // rotate 2D-shape
T_(R[0],R[1], 0, // xyz-translate 2D-shape
vec3D(airfoil_data(N=N, L=R[5], naca=[R[6],.5,R[7]], open=true)
))))
];
}

module axis(shift = 0, shl = 200)
{
T(shift)        // = Tx()
Ry(90)
Cy(R_axis,shl);
T(-shl/2+shift)
Ry(90)
Sp(R_axis);    // sphere
}

On 2/25/2017 1:09 PM, Parkinbot wrote:

Jon,

I uploaded the newest version of Naca_sweep.scad to
http://www.thingiverse.com/thing:1208001. The sweep() in this version has
new parameters:

sweep(dat, convexity = 5, showslices = false, close = false, planar_caps =
false)

Using the default "planar_caps=false" triangulates the caps, as Ronaldo
already stated. Actually, I didn't have any problems to F6-render the code
with planar_caps set to true or false, using OpenSCAD 2017.01.20. Let me
anote that it might be a good idea to strengthen the blade at its root by
altering the last column ZZ in the matrix A. Try e.g.:

// core data to be interpolated by nSpline()
//      transform data            airfoil nacaXYZZ
A = [ // Tx    Ty  Tz  Rz  Ry  |  L    X    ZZ
[0,    ty,  60, -25,  0,  300,  .12,  .2],
[-50,  ty,  200, -50,  0,  600,  .2,  .12],
[-100, ty,  500, -75,  0,  450,  .1,  .06],
[00,  ty,  660, -82,  10,  10,  .01,  .1],

--
View this message in context: http://forum.openscad.org/error-preparing-boat-propeller-tp20570p20574.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


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7998 / Virus Database: 4756/14020 - Release Date: 02/25/17

So, now on to scaling. We want a 1/2" shaft with a 3/16" center bore and a dog slot. We also want propellers that are roughly 3" in diameter. I tried to express everything in native sizes by changing the "size" value to 1, but that threw everything off, even after I tried to adjust the values in the matrix by dividing them all by 10. At the moment, the shaft is correctly scaled, but the propellers do not touch the shaft, and they are way too large. I don't mean to be ungrateful for this amazing technology, but would it be possible to allow some of these things to be adjusted in a way that was less obscure and simpler? If the answer is "I don't have time for this", I completely understand. Thanks for listening! Jon use <naca4.scad> // see http://www.thingiverse.com/thing:898554 use <shortcuts.scad> // see http://www.thingiverse.com/thing:644830 use <naca_sweep.scad> // see http://www.thingiverse.com/thing:900137 use <splines.scad> // some parameters inches = 25.4; N = 100; // refinement R_axis = 10*inches * 0.25; // radius of axle r_bore = 10*inches * 3/16/2; // radius of axle bore size = 0.1; // sizing factor slices = false; // set true to view interpolation slices ty = 50; // common y-distancing of blades dog = inches * 0.125; // core data to be interpolated by nSpline() // transform data airfoil nacaXYZZ //-------------------------------------------------- A = [ // Tx Ty Tz Rz Ry | L X ZZ [0, ty, 60, -25, 0, 300, .12, .2], [-50, ty, 200, -50, 0, 600, .2, .12], [-100, ty, 500, -75, 0, 450, .1, .06], [00, ty, 660, -82, 10, 10, .01, .1], ]; // Main object module MyProp() Rz(180) S(size, size, size) boat_prop(3); difference() { MyProp(); // drill out center hole rotate([0, 90, 0]) cylinder(h = 100, r = 3.75, $fn = 100); // dog slot cube([dog, 2 * R_axis/10 + 1, dog], center = true); } module boat_prop(M = 2) { m = slices?1:M; // used for slices view $fn = N; // refinement shift = -130; // shift for axis parts shl = 270; // length of axis B = nSpline(A, 2*N); // interpolation D() // difference { U() // union of blades and axle { for(i=[0:360/m:359]) { C = gen_dat(slices?A:B,N); R(i) // = Rx(); x-rotates object sweep(C, showslices=slices); } if(!slices) axis(shift, shl); } Tx(shift+shl*.2) // translate Ry(90) // rotate Cy(r_bore,shl*.9); // cylinder } // generate all data - applies transformation and airfoil params function gen_dat(B,N) = [for(i=[0:len(B)-1]) let(R = B[i]) Tz_(R[2], // z-translate 2D-shape R_(R[4], 0, 180+R[3], // rotate 2D-shape T_(R[0],R[1], 0, // xyz-translate 2D-shape vec3D(airfoil_data(N=N, L=R[5], naca=[R[6],.5,R[7]], open=true) )))) ]; } module axis(shift = 0, shl = 200) { T(shift) // = Tx() Ry(90) Cy(R_axis,shl); T(-shl/2+shift) Ry(90) Sp(R_axis); // sphere } On 2/25/2017 1:09 PM, Parkinbot wrote: > Jon, > > I uploaded the newest version of Naca_sweep.scad to > http://www.thingiverse.com/thing:1208001. The sweep() in this version has > new parameters: > >> sweep(dat, convexity = 5, showslices = false, close = false, planar_caps = >> false) > Using the default "planar_caps=false" triangulates the caps, as Ronaldo > already stated. Actually, I didn't have any problems to F6-render the code > with planar_caps set to true or false, using OpenSCAD 2017.01.20. Let me > anote that it might be a good idea to strengthen the blade at its root by > altering the last column ZZ in the matrix A. Try e.g.: > > >> // core data to be interpolated by nSpline() >> // transform data airfoil nacaXYZZ >> A = [ // Tx Ty Tz Rz Ry | L X ZZ >> [0, ty, 60, -25, 0, 300, .12, .2], >> [-50, ty, 200, -50, 0, 600, .2, .12], >> [-100, ty, 500, -75, 0, 450, .1, .06], >> [00, ty, 660, -82, 10, 10, .01, .1], > > > > > -- > View this message in context: http://forum.openscad.org/error-preparing-boat-propeller-tp20570p20574.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 > > > > ----- > No virus found in this message. > Checked by AVG - www.avg.com > Version: 2016.0.7998 / Virus Database: 4756/14020 - Release Date: 02/25/17 > >
P
Parkinbot
Mon, Feb 27, 2017 8:50 PM

Jon,

if you see what you get within less than 100 lines, everything is as simple
as can be ;-)
I admit, the design uses of some magic library stuff concerning the blades.
But the rest, hub and bore is just OpenSCAD stuff using scale, difference
and union. You should be able to work this out on your own, also the mm/inch
rescale.

The matrix describes a single blade using a series of four slices being then
interpolated by nSpline():

A = [ // Tx    Ty  Tz  Rz  Ry  |  L    X    ZZ
[0,    ty,  60, -25,  0,  300,  .12,  .2], // root slice is
translated by [0, ty, 60], pitched by 25°
[-50,  ty,  200, -50,  0,  600,  .2,  .12], //
[-100, ty,  500, -75,  0,  450,  .1,  .06], //
[00,  ty,  660, -82,  10,  10,  .01,  .1], // tip slice
];

The first line describes the root, the last line the tip profile. The second
and third are intermediate profiles to "guide" the cubic spline
interpolation. You can introduce more lines, but they have to "fit into the
scheme", otherwise the interpolation scheme will freak out. As for the
columns the meaning is
Tx = translate slice along x
Ty = translate slice along y,
Tz = translate slice along z, (distance from axis)
Rz = rotate slice around z, (pitch)
Rz = rotate slice around y
used here

Tz_(R[2],  // z-translate 2D-shape
R_(R[4], 0, 180+R[3], // rotate 2D-shape
T_(R[0],R[1], 0, // xyz-translate 2D-shape

and
L = NACA cord length
X = NACA camber
Y = NACA location of max camber = 0.5 (not interpolated in this example)
ZZ = NACA factor thickness/cord
used here:

vec3D(airfoil_data(N=N, L=R[5], naca=[R[6],.5,R[7]], open=true)

The first five parameters describe how the 2D-shape is positioned in 3D, the
last three columns describe the 2D shape itself. It is a 4 digit Naca
profile see https://en.wikipedia.org/wiki/NACA_airfoil.
The 4 digit naming scheme I used is: "nacaXYZZ", with X, Y, ZZ denoting
profile parameters. The matrix adresses the cord length L and only the X and
the ZZ parameters. The generator function calls into my naca4.scad library
to construct the 2D shape. It has a "constructor" airfoil_data() with an
overloaded "naca" parameter. One overload accepts NACA-Numbers like 1230,
and the other a vector like [.1, .2, .3]. Both result in the same profile,
NACA1230.

Hope this helps.

--
View this message in context: http://forum.openscad.org/error-preparing-boat-propeller-tp20570p20614.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Jon, if you see what you get within less than 100 lines, everything is as simple as can be ;-) I admit, the design uses of some magic library stuff concerning the blades. But the rest, hub and bore is just OpenSCAD stuff using scale, difference and union. You should be able to work this out on your own, also the mm/inch rescale. The matrix describes a single blade using a series of four slices being then interpolated by nSpline(): A = [ // Tx Ty Tz Rz Ry | L X ZZ [0, ty, 60, -25, 0, 300, .12, .2], // root slice is translated by [0, ty, 60], pitched by 25° [-50, ty, 200, -50, 0, 600, .2, .12], // [-100, ty, 500, -75, 0, 450, .1, .06], // [00, ty, 660, -82, 10, 10, .01, .1], // tip slice ]; The first line describes the root, the last line the tip profile. The second and third are intermediate profiles to "guide" the cubic spline interpolation. You can introduce more lines, but they have to "fit into the scheme", otherwise the interpolation scheme will freak out. As for the columns the meaning is Tx = translate slice along x Ty = translate slice along y, Tz = translate slice along z, (distance from axis) Rz = rotate slice around z, (pitch) Rz = rotate slice around y used here > Tz_(R[2], // z-translate 2D-shape > R_(R[4], 0, 180+R[3], // rotate 2D-shape > T_(R[0],R[1], 0, // xyz-translate 2D-shape and L = NACA cord length X = NACA camber Y = NACA location of max camber = 0.5 (not interpolated in this example) ZZ = NACA factor thickness/cord used here: > vec3D(airfoil_data(N=N, L=R[5], naca=[R[6],.5,R[7]], open=true) The first five parameters describe how the 2D-shape is positioned in 3D, the last three columns describe the 2D shape itself. It is a 4 digit Naca profile see https://en.wikipedia.org/wiki/NACA_airfoil. The 4 digit naming scheme I used is: "nacaXYZZ", with X, Y, ZZ denoting profile parameters. The matrix adresses the cord length L and only the X and the ZZ parameters. The generator function calls into my naca4.scad library to construct the 2D shape. It has a "constructor" airfoil_data() with an overloaded "naca" parameter. One overload accepts NACA-Numbers like 1230, and the other a vector like [.1, .2, .3]. Both result in the same profile, NACA1230. Hope this helps. -- View this message in context: http://forum.openscad.org/error-preparing-boat-propeller-tp20570p20614.html Sent from the OpenSCAD mailing list archive at Nabble.com.
J
jon
Mon, Feb 27, 2017 11:18 PM

Very helpful, indeed!  Thank you!  I will keep this handy going forward!

I tried to make the props smaller by using a scale(0.5) on My Prop()
[see line 34].  The result is startling.  The hub vanishes.

Jon

use <naca4.scad>      // see http://www.thingiverse.com/thing:898554
use <shortcuts.scad>  // see http://www.thingiverse.com/thing:644830
use <naca_sweep.scad> // see http://www.thingiverse.com/thing:900137
use <splines.scad>

// some parameters
inches = 25.4;
N = 100;                        // refinement
R_axis = 10inches * 0.25;        // radius of axle
r_bore = 10
inches * 3/16/2;    // radius of axle bore
size = 0.1;                        // sizing factor
slices = false;                    // set true to view interpolation slices
ty = 40;                        // common y-distancing of blades
dog = inches * 0.125;

// core data to be interpolated by nSpline()
//      transform data            airfoil nacaXYZZ
//--------------------------------------------------
A = [ // Tx    Ty  Tz  Rz  Ry  |  L    X    ZZ
[0,    ty,    0, -25,  0,  300,  .12,  .2],
[-50,  ty,  200, -50,  0,  600,  .2,  .12],
[-100, ty,  500, -75,  0,  450,  .1,  .06],
[00,  ty,  660, -82,  10,  10,  .01,  .1],
];

// Main object
module MyProp()
Rz(180)
S(size, size, size)
boat_prop(3);

difference() {
scale(0.5)
MyProp();
// drill out center hole
rotate([0, 90, 0])
cylinder(h = 100, r = 3.75, $fn = 100);
// dog slot
rotate([-40, 0, 0])
cube([dog, 2 * R_axis/10 + 1, dog], center = true);
}

module boat_prop(M = 2)
{
m = slices?1:M; // used for slices view
$fn = N;        // refinement
shift = -130;  // shift for axis parts
shl = 270;      // length of axis
B = nSpline(A, 2*N);  // interpolation

D()  // difference
{
U()  // union of blades and axle
{
for(i=[0:360/m:359])
{
C = gen_dat(slices?A:B,N);
R(i)                // = Rx(); x-rotates object
sweep(C, showslices=slices);
}
if(!slices)
axis(shift, shl);
}
// bore out the axle
Tx(shift+shl*.2)  // translate
Ry(90)            // rotate
Cy(r_bore,shl*.9); // cylinder
}

// generate all data - applies transformation and airfoil params
function gen_dat(B,N) =
[for(i=[0:len(B)-1])
let(R = B[i])
Tz_(R[2],  // z-translate 2D-shape
R_(R[4], 0, 180+R[3], // rotate 2D-shape
T_(R[0],R[1], 0, // xyz-translate 2D-shape
vec3D(airfoil_data(N=N, L=R[5], naca=[R[6],.5,R[7]], open=true)
))))
];
}

module axis(shift = 0, shl = 200)
{
T(shift)        // = Tx()
Ry(90)
Cy(R_axis,shl);
T(-shl/2+shift)
Ry(90)
Sp(R_axis);    // sphere
}

On 2/27/2017 3:50 PM, Parkinbot wrote:

Jon,

if you see what you get within less than 100 lines, everything is as simple
as can be ;-)
I admit, the design uses of some magic library stuff concerning the blades.
But the rest, hub and bore is just OpenSCAD stuff using scale, difference
and union. You should be able to work this out on your own, also the mm/inch
rescale.

The matrix describes a single blade using a series of four slices being then
interpolated by nSpline():

A = [ // Tx    Ty  Tz  Rz  Ry  |  L    X    ZZ
[0,    ty,  60, -25,  0,  300,  .12,  .2], // root slice is
translated by [0, ty, 60], pitched by 25°
[-50,  ty,  200, -50,  0,  600,  .2,  .12], //
[-100, ty,  500, -75,  0,  450,  .1,  .06], //
[00,  ty,  660, -82,  10,  10,  .01,  .1], // tip slice
];

The first line describes the root, the last line the tip profile. The second
and third are intermediate profiles to "guide" the cubic spline
interpolation. You can introduce more lines, but they have to "fit into the
scheme", otherwise the interpolation scheme will freak out. As for the
columns the meaning is
Tx = translate slice along x
Ty = translate slice along y,
Tz = translate slice along z, (distance from axis)
Rz = rotate slice around z, (pitch)
Rz = rotate slice around y
used here

Tz_(R[2],   // z-translate 2D-shape
       R_(R[4], 0, 180+R[3], // rotate 2D-shape
         T_(R[0],R[1], 0, // xyz-translate 2D-shape

and
L = NACA cord length
X = NACA camber
Y = NACA location of max camber = 0.5 (not interpolated in this example)
ZZ = NACA factor thickness/cord
used here:

vec3D(airfoil_data(N=N, L=R[5], naca=[R[6],.5,R[7]], open=true)

The first five parameters describe how the 2D-shape is positioned in 3D, the
last three columns describe the 2D shape itself. It is a 4 digit Naca
profile see https://en.wikipedia.org/wiki/NACA_airfoil.
The 4 digit naming scheme I used is: "nacaXYZZ", with X, Y, ZZ denoting
profile parameters. The matrix adresses the cord length L and only the X and
the ZZ parameters. The generator function calls into my naca4.scad library
to construct the 2D shape. It has a "constructor" airfoil_data() with an
overloaded "naca" parameter. One overload accepts NACA-Numbers like 1230,
and the other a vector like [.1, .2, .3]. Both result in the same profile,
NACA1230.

Hope this helps.

--
View this message in context: http://forum.openscad.org/error-preparing-boat-propeller-tp20570p20614.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


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7998 / Virus Database: 4756/14034 - Release Date: 02/27/17

Very helpful, indeed! Thank you! I will keep this handy going forward! I tried to make the props smaller by using a scale(0.5) on My Prop() [see line 34]. The result is startling. The hub vanishes. Jon use <naca4.scad> // see http://www.thingiverse.com/thing:898554 use <shortcuts.scad> // see http://www.thingiverse.com/thing:644830 use <naca_sweep.scad> // see http://www.thingiverse.com/thing:900137 use <splines.scad> // some parameters inches = 25.4; N = 100; // refinement R_axis = 10*inches * 0.25; // radius of axle r_bore = 10*inches * 3/16/2; // radius of axle bore size = 0.1; // sizing factor slices = false; // set true to view interpolation slices ty = 40; // common y-distancing of blades dog = inches * 0.125; // core data to be interpolated by nSpline() // transform data airfoil nacaXYZZ //-------------------------------------------------- A = [ // Tx Ty Tz Rz Ry | L X ZZ [0, ty, 0, -25, 0, 300, .12, .2], [-50, ty, 200, -50, 0, 600, .2, .12], [-100, ty, 500, -75, 0, 450, .1, .06], [00, ty, 660, -82, 10, 10, .01, .1], ]; // Main object module MyProp() Rz(180) S(size, size, size) boat_prop(3); difference() { scale(0.5) MyProp(); // drill out center hole rotate([0, 90, 0]) cylinder(h = 100, r = 3.75, $fn = 100); // dog slot rotate([-40, 0, 0]) cube([dog, 2 * R_axis/10 + 1, dog], center = true); } module boat_prop(M = 2) { m = slices?1:M; // used for slices view $fn = N; // refinement shift = -130; // shift for axis parts shl = 270; // length of axis B = nSpline(A, 2*N); // interpolation D() // difference { U() // union of blades and axle { for(i=[0:360/m:359]) { C = gen_dat(slices?A:B,N); R(i) // = Rx(); x-rotates object sweep(C, showslices=slices); } if(!slices) axis(shift, shl); } // bore out the axle Tx(shift+shl*.2) // translate Ry(90) // rotate Cy(r_bore,shl*.9); // cylinder } // generate all data - applies transformation and airfoil params function gen_dat(B,N) = [for(i=[0:len(B)-1]) let(R = B[i]) Tz_(R[2], // z-translate 2D-shape R_(R[4], 0, 180+R[3], // rotate 2D-shape T_(R[0],R[1], 0, // xyz-translate 2D-shape vec3D(airfoil_data(N=N, L=R[5], naca=[R[6],.5,R[7]], open=true) )))) ]; } module axis(shift = 0, shl = 200) { T(shift) // = Tx() Ry(90) Cy(R_axis,shl); T(-shl/2+shift) Ry(90) Sp(R_axis); // sphere } On 2/27/2017 3:50 PM, Parkinbot wrote: > Jon, > > if you see what you get within less than 100 lines, everything is as simple > as can be ;-) > I admit, the design uses of some magic library stuff concerning the blades. > But the rest, hub and bore is just OpenSCAD stuff using scale, difference > and union. You should be able to work this out on your own, also the mm/inch > rescale. > > The matrix describes a single blade using a series of four slices being then > interpolated by nSpline(): > > A = [ // Tx Ty Tz Rz Ry | L X ZZ > [0, ty, 60, -25, 0, 300, .12, .2], // root slice is > translated by [0, ty, 60], pitched by 25° > [-50, ty, 200, -50, 0, 600, .2, .12], // > [-100, ty, 500, -75, 0, 450, .1, .06], // > [00, ty, 660, -82, 10, 10, .01, .1], // tip slice > ]; > > The first line describes the root, the last line the tip profile. The second > and third are intermediate profiles to "guide" the cubic spline > interpolation. You can introduce more lines, but they have to "fit into the > scheme", otherwise the interpolation scheme will freak out. As for the > columns the meaning is > Tx = translate slice along x > Ty = translate slice along y, > Tz = translate slice along z, (distance from axis) > Rz = rotate slice around z, (pitch) > Rz = rotate slice around y > used here > >> Tz_(R[2], // z-translate 2D-shape >> R_(R[4], 0, 180+R[3], // rotate 2D-shape >> T_(R[0],R[1], 0, // xyz-translate 2D-shape > and > L = NACA cord length > X = NACA camber > Y = NACA location of max camber = 0.5 (not interpolated in this example) > ZZ = NACA factor thickness/cord > used here: > >> vec3D(airfoil_data(N=N, L=R[5], naca=[R[6],.5,R[7]], open=true) > The first five parameters describe how the 2D-shape is positioned in 3D, the > last three columns describe the 2D shape itself. It is a 4 digit Naca > profile see https://en.wikipedia.org/wiki/NACA_airfoil. > The 4 digit naming scheme I used is: "nacaXYZZ", with X, Y, ZZ denoting > profile parameters. The matrix adresses the cord length L and only the X and > the ZZ parameters. The generator function calls into my naca4.scad library > to construct the 2D shape. It has a "constructor" airfoil_data() with an > overloaded "naca" parameter. One overload accepts NACA-Numbers like 1230, > and the other a vector like [.1, .2, .3]. Both result in the same profile, > NACA1230. > > Hope this helps. > > > > > -- > View this message in context: http://forum.openscad.org/error-preparing-boat-propeller-tp20570p20614.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 > > > ----- > No virus found in this message. > Checked by AVG - www.avg.com > Version: 2016.0.7998 / Virus Database: 4756/14034 - Release Date: 02/27/17