discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Texture

M
mikeonenine@web.de
Mon, Jul 21, 2025 7:48 PM

Hi,

Can texture be applied to a surface other than the extruded surface?

For instance for a gear machined from a casting, where the recesses on both sides are rough.

Hi, Can texture be applied to a surface other than the extruded surface? For instance for a gear machined from a casting, where the recesses on both sides are rough.
M
mikeonenine@web.de
Mon, Jul 21, 2025 11:06 PM

If it is possible to roughen with linear_extrude, it should be possible to do the same with rotate_extrude - like with the annular recesses in the following:

module gear(n, r, t,)

{

radii = [0.995*r-t, 0.995*r+0.10*t, 0.995*r+t, 0.995*r+t, 0.995*r+0.10*t, 0.995*r-t];

num = n*len(radii); // len(radii) = 6

function r(a) = (floor(a/ 10) % 2) ? 10:8;

polygon([

for (i=[0:num-1], a=i*360/num, r=radii[i%len(radii)])

[r*cos(a), r*sin(a)]

]);

}

difference(){

linear_extrude(15, center=true, convexity=4)

gear(25, 30, 2.2);

for ( i = [-1, 1])

mirror([0, 0, (1-i)/2])

translate([0, 0, 6.5])

rotate_extrude()

translate([19, 0])

offset(2)

//square([5, 2], center=true);

polygon([

[3.5, 1.5],

[2.5, -1.5],

[-2.5, -1.5],

[-3.5, 1.5],

]);

cylinder(r=10, h=16, center=true);

}

If it is possible to roughen with linear_extrude, it should be possible to do the same with rotate_extrude - like with the annular recesses in the following: `module gear(n, r, t,)` `{` ` radii = [0.995*r-t, 0.995*r+0.10*t, 0.995*r+t, 0.995*r+t, 0.995*r+0.10*t, 0.995*r-t];` ` num = n*len(radii); // len(radii) = 6` ` function r(a) = (floor(a/ 10) % 2) ? 10:8;` ` polygon([` ` for (i=[0:num-1], a=i*360/num, r=radii[i%len(radii)])` ` [r*cos(a), r*sin(a)]` ` ]);` `}` `difference(){` `linear_extrude(15, center=true, convexity=4)` `gear(25, 30, 2.2);` `for ( i = [-1, 1])` `mirror([0, 0, (1-i)/2])` `translate([0, 0, 6.5])` `rotate_extrude()` `translate([19, 0])` `offset(2)` `//square([5, 2], center=true);` `polygon([` `[3.5, 1.5],` `[2.5, -1.5],` `[-2.5, -1.5],` `[-3.5, 1.5],` `]);` `cylinder(r=10, h=16, center=true);` `}`