linear_extrude

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

linear_extrude

David Powell
can someone please explain how   import() child()  replaces import_extrued(height,center,convexity,twist,slices) since this function is now depreciated ? 

as used for example would be 

linear_extrude(h=10,center=true,convexity=10,twist=2.1,slices=10)gear2d(teeth,pitch,clearence);

yours David 

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: linear_extrude

kintel
Administrator
On 2013-05-24, at 23:18 , David Powell wrote:

> can someone please explain how   import() child()  replaces import_extrued(height,center,convexity,twist,slices) since this function is now depreciated ?
>
> as used for example would be
>
> linear_extrude(h=10,center=true,convexity=10,twist=2.1,slices=10)gear2d(teeth,pitch,clearence);
>
I have no idea what you're talking about..

In terms of deprecations, linear_extrude() can no longer directly import dxf files. This doesn't appear to affect your idea at all, although your code doesn't make much sense to me.

If you provide an actual example it might become more clear.

 -Marius

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: linear_extrude

David Powell

//constants
pi=3.141592;

//tooth(pitch=4);

//gear2d(teeth=77,pitch=4,clearance=0.5);

//H=10;
//teeth=77;
//pitch=4;
//clearance=0.5;
//tp=50;
//gear(H,teeth,pitch,clearance,tp);

gears();


// ************* modules ***************
module tooth(pitch){
translate([0,0,0])scale([2,1,1])circle(pitch/2,$fn=24);
}

module gear2d(teeth,pitch,clearance){
union(){
translate([0,0,0])circle(((pitch*teeth)/pi)-clearance,$fn=100);
for(n=[1:teeth]){
rotate([0,0,(360/teeth)*n])
translate([(pitch*teeth)/pi,0,0])tooth(pitch*1.1);
}
}
}

module ringblank(teeth,pitch,clearance){
difference(){
translate([0,0,0])
circle(((pitch*teeth)/pi)+clearance+pitch*2.5,$fn=100);
translate([0,0,0])
circle(((pitch*teeth)/pi)+clearance,$fn=100);
}
}

module ring2d(teeth,pitch,clearance){
union(){
translate([0,0,0])ringblank(teeth,pitch,clearance);
for(n=[1:teeth]){
rotate([0,0,(360/teeth)*n])
translate([(pitch*teeth)/pi,0,0])tooth(pitch*1.1);
}
}
}


module gear(H,teeth,pitch,clearance,tp){

echo("gear radius at pitch min =",((pitch*teeth)/pi));
echo("gear innner radius =",((pitch*teeth)/pi)-(pitch*2));
echo("gear outer radius =",((pitch*teeth)/pi)+pitch);
tw=(360/teeth)*(tp/100);
difference(){
union(){
translate([0,0,0]){
linear_extrude(H/2,center=true,convexity=10,twist=tw,slices=10)
gear2d(teeth,pitch,clearance);
}
mirror([0,0,1]){
translate([0,0,-H/2]){
linear_extrude(H/2,center=true,convexity=10,twist=tw,slices=10)
gear2d(teeth,pitch,clearance);
}
}
}
translate([0,0,0])cylinder(h=H*2,r=((pitch*teeth)/pi)-(pitch*2),center=true);
}}

module ring(H,teeth,pitch,clearance,tp){

echo("ring radius at pitch min =",((pitch*teeth)/pi));
echo("ring innner radius =",((pitch*teeth)/pi)-(pitch*2));
echo("ring outer radius =",((pitch*teeth)/pi)+(pitch*2.5));
tw=(360/teeth)*(tp/100);
union(){
translate([0,0,0]){
linear_extrude(H/2,center=true,convexity=10,twist=tw,slices=10)
ring2d(teeth,pitch,clearance);
}
mirror([0,0,1]){
translate([0,0,-H/2]){
linear_extrude(H/2,center=true,convexity=10,twist=tw,slices=10)
ring2d(teeth,pitch,clearance);
}
}
}
}
module double(){
union(){
translate([0,0,0])gear(H=10,teeth=77,pitch=4,clearance=0.5,tp=50);
translate([0,0,0])ring(H=10,teeth=54,pitch=4.77,clearance=0.5,tp=-50);
}
}

module doubleholes(){
difference(){
translate([0,0,0])double();
for(k=[1:6]){
rotate([0,0,60*k])translate([90,0,0])cylinder(h=10*2,r=4,center=true);
}
}
}

module outerholes(){
difference(){
translate([0,0,0])ring(H=10,teeth=91,pitch=4.77,clearance=0.5,tp=-50);
for(k=[1:6]){
rotate([0,0,60*k])translate([145,0,0])cylinder(h=10*2,r=4,center=true);
}
}
}

module innermount(){
difference(){
union(){
translate([0,0,0])gear(H=10,teeth=33,pitch=4,clearance=0.5,tp=50);
translate([0,0,2.5])cylinder(h=10,r=35,center=true);
}
translate([0,0,2.5])cylinder(h=15,r=20,center=true);
}
}


module innerholes(){
difference(){
translate([0,0,0])innermount();
for(k=[1:6]){
rotate([0,0,60*k])translate([30,0,0])cylinder(h=10*2,r=4,center=true);
}
}
}

module gears(){
//outer  to inner
// ring inner dia = 98.0395+15.2789+0.5+pitch(=4) = 117.8184
// cercumfernce 434.6
   translate([0,0,0])outerholes();
planets=7;
for ( planet = [1:planets]){
rotate([0,0,(360/planets)*planet])
translate([(102.039+15.2789+0.5),0,0])
rotate([0,0,(360/24)])
gear(H=10,teeth=12,pitch=4,clearance=0.5,tp=-50);
}
doubleholes();
planetsi=3;
for ( planet = [1:planetsi]){
rotate([0,0,(360/planetsi)*planet])
translate([(75.8-15.2789+0.5),0,0])
rotate([0,0,(360/24)])
gear(H=10,teeth=12,pitch=4,clearance=0.5,tp=-50);
}
innerholes();
}
------------------------------------------------------------------------------------------------------------------------------------

that returns 

Module cache size: 0 modules

Compiling design (CSG Tree generation)...

ECHO: "ring radius at pitch min =", 138.169

ECHO: "ring innner radius =", 128.629

ECHO: "ring outer radius =", 150.094

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

ECHO: "gear radius at pitch min =", 15.2789

ECHO: "gear innner radius =", 7.27888

ECHO: "gear outer radius =", 19.2789

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

ECHO: "gear radius at pitch min =", 15.2789

ECHO: "gear innner radius =", 7.27888

ECHO: "gear outer radius =", 19.2789

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

ECHO: "gear radius at pitch min =", 15.2789

ECHO: "gear innner radius =", 7.27888

ECHO: "gear outer radius =", 19.2789

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

ECHO: "gear radius at pitch min =", 15.2789

ECHO: "gear innner radius =", 7.27888

ECHO: "gear outer radius =", 19.2789

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

ECHO: "gear radius at pitch min =", 15.2789

ECHO: "gear innner radius =", 7.27888

ECHO: "gear outer radius =", 19.2789

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

ECHO: "gear radius at pitch min =", 15.2789

ECHO: "gear innner radius =", 7.27888

ECHO: "gear outer radius =", 19.2789

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

ECHO: "gear radius at pitch min =", 15.2789

ECHO: "gear innner radius =", 7.27888

ECHO: "gear outer radius =", 19.2789

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

ECHO: "gear radius at pitch min =", 98.0395

ECHO: "gear innner radius =", 90.0395

ECHO: "gear outer radius =", 102.039

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

ECHO: "ring radius at pitch min =", 81.9903

ECHO: "ring innner radius =", 72.4503

ECHO: "ring outer radius =", 93.9153

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

ECHO: "gear radius at pitch min =", 15.2789

ECHO: "gear innner radius =", 7.27888

ECHO: "gear outer radius =", 19.2789

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

ECHO: "gear radius at pitch min =", 15.2789

ECHO: "gear innner radius =", 7.27888

ECHO: "gear outer radius =", 19.2789

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

ECHO: "gear radius at pitch min =", 15.2789

ECHO: "gear innner radius =", 7.27888

ECHO: "gear outer radius =", 19.2789

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

ECHO: "gear radius at pitch min =", 42.0169

ECHO: "gear innner radius =", 34.0169

ECHO: "gear outer radius =", 46.0169

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.

Compiling design (CSG Products generation)...

WARNING: Can't open DXF file 'C:/Users/david/Documents\5'.

WARNING: Can't open DXF file 'C:/Users/david/Documents\5'.

WARNING: Can't open DXF file 'C:/Users/david/Documents\5'.

WARNING: Can't open DXF file 'C:/Users/david/Documents\5'.

WARNING: Can't open DXF file 'C:/Users/david/Documents\5'.

PolySets in cache: 11

PolySet cache size in bytes: 32256

CGAL Polyhedrons in cache: 0

CGAL cache size in bytes: 0

Compiling design (CSG Products normalization)...

Normalized CSG tree has 90 elements

CSG generation finished.

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




this produces a valid output on preview on one version of openscad but on the latest version 

produces all the warnings and fails to compile ,  


since theres the WARNING: Can't open DXF file 'C:/Users/david/Documents\5'. message that only appears on compile on the current version of openscad and the other warnings that also there's no external file reference to do so 

, it suggests that  the linear_extrude needs to be replaced with child import()   but the documentation on the site suggests that it should be a file import not embedded modules and gives no clue how to go about it 

my question is how do you go about this and still "extrude" and twist  the items to produce a solid  using the child import() method  without just getting a stack of a few 2d objects that are not a solid 


David 






On Sat, May 25, 2013 at 5:37 AM, Marius Kintel <[hidden email]> wrote:
On 2013-05-24, at 23:18 , David Powell wrote:

> can someone please explain how   import() child()  replaces import_extrued(height,center,convexity,twist,slices) since this function is now depreciated ?
>
> as used for example would be
>
> linear_extrude(h=10,center=true,convexity=10,twist=2.1,slices=10)gear2d(teeth,pitch,clearence);
>
I have no idea what you're talking about..

In terms of deprecations, linear_extrude() can no longer directly import dxf files. This doesn't appear to affect your idea at all, although your code doesn't make much sense to me.

If you provide an actual example it might become more clear.

 -Marius

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: linear_extrude

Triffid Hunter
you've forgotten to name the height parameter. use linear_extrude(height=H/2, ...)

also, you have 3d translations and rotations on 2d primitives, that's not gonna make the engine happy! translate([x, y]) rotate(angle) circle(radius); etc works.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: linear_extrude

David Powell
thanks , will have another go and change those ,
 but still i would like to know how to change it  from linear_extrude to use the child import() method 

David
 


On Sat, May 25, 2013 at 8:12 AM, Triffid Hunter <[hidden email]> wrote:
you've forgotten to name the height parameter. use linear_extrude(height=H/2, ...)

also, you have 3d translations and rotations on 2d primitives, that's not gonna make the engine happy! translate([x, y]) rotate(angle) circle(radius); etc works.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: linear_extrude

Triffid Hunter
On 25 May 2013 17:28, David Powell <[hidden email]> wrote:
 but still i would like to know how to change it  from linear_extrude to use the child import() method 

linear_extrude(...) import("some_2d_shape.dxf");

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: linear_extrude

bobc
In reply to this post by David Powell
From: David Powell <[hidden email]>
Subject: Re: [OpenSCAD] linear_extrude

 
WARNING: Can't open DXF file 'C:/Users/david/Documents\5'.

That is your clue right there. linear_extrude()  thinks the first parameter is a filename. You need to use "height=".

From wikibooks:

Usage

linear_extrude(height = fanwidth, center = true, convexity = 10, twist = -fanrot, slices = 20) {...}
(You must use parameter names due to a backward compatability issue)

BTW, I would much prefer a forum to a mailing list.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: linear_extrude

David Powell
In reply to this post by Triffid Hunter
k, thanks , 
seems the message 
DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.
was causing me some confusion as to another method ,, although it still  fails at 80% with a  windows  run time error (and no reason given) on version 2013.01 (windows7 64bit)  just trying it with 2013.05.18  (win xp 32bit and win7 64bit ) will give the linux version a go later also  but it takes about 1 hour each time 

Dave



On Sat, May 25, 2013 at 9:18 AM, Triffid Hunter <[hidden email]> wrote:
On 25 May 2013 17:28, David Powell <[hidden email]> wrote:
 but still i would like to know how to change it  from linear_extrude to use the child import() method 

linear_extrude(...) import("some_2d_shape.dxf");

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: linear_extrude

Lampbus
The clue was near the end -

WARNING: Can't open DXF file 'C:/Users/david/Documents\5'.

and as you are not opening DXF files...there is obviously something wrong in the command that historically opened them as an option (linear_extrude).

As previously pointed out, it used the filename '5' as this is H/2. rather than as parameter Height=.

Richard.

On 25/05/2013 10:23, David Powell wrote:
k, thanks , 
seems the message 
DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.
was causing me some confusion as to another method ,, although it still  fails at 80% with a  windows  run time error (and no reason given) on version 2013.01 (windows7 64bit)  just trying it with 2013.05.18  (win xp 32bit and win7 64bit ) will give the linux version a go later also  but it takes about 1 hour each time 

Dave



On Sat, May 25, 2013 at 9:18 AM, Triffid Hunter <[hidden email]> wrote:
On 25 May 2013 17:28, David Powell <[hidden email]> wrote:
 but still i would like to know how to change it  from linear_extrude to use the child import() method 

linear_extrude(...) import("some_2d_shape.dxf");

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: linear_extrude

donbright
In reply to this post by David Powell
The confusing message should not appear in newer versions. The updated code will detect the first arg is a number and won't assume it's an invalid filename. Thanks.

-DB



On Sat, May 25, 2013 at 4:23 AM, David Powell <[hidden email]> wrote:
k, thanks , 
seems the message 
DEPRECATED: Support for reading files in linear_extrude will be removed in future releases. Use a child import() instead.
was causing me some confusion as to another method ,, although it still  fails at 80% with a  windows  run time error (and no reason given) on version 2013.01 (windows7 64bit)  just trying it with 2013.05.18  (win xp 32bit and win7 64bit ) will give the linux version a go later also  but it takes about 1 hour each time 

Dave



On Sat, May 25, 2013 at 9:18 AM, Triffid Hunter <[hidden email]> wrote:
On 25 May 2013 17:28, David Powell <[hidden email]> wrote:
 but still i would like to know how to change it  from linear_extrude to use the child import() method 

linear_extrude(...) import("some_2d_shape.dxf");

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566