Since I have been working on a way to design shoes with OpenSCAD I have been experimenting with ways to make the outside of the shoe have a more appealing look to it, here is one of the ideas I was messing around with that also comes in handy for making ventilation holes in project cases so I called it the ventilator.
Here is the code:
/*[VentilatorV2]*/
Path_to_stl=("");
Line_width=.1;//[.01:.01:3]
Line_Spacing=1;//[.1:.01:10]
/*[Cube]*/
UseCube=true;
ViewCube=false;
Cube_sizeX=100;//[1:.01:400]
Cube_sizeY=100;//[1:.01:400]
Cube_sizeZ=100;//[1:1:400]
Move_cubeX=0;//[-400:.01:400]
Move_cubeY=0;//[-400:.01:400]
Move_cubeZ=0;//[-400:.01:400]
Rotate_CubeX=0;//[0:.01:360]
Rotate_CubeY=0;//[0:.01:360]
Rotate_CubeZ=0;//[0:.01:360]
/*[Square]*/
UseSquare=true;
ViewSquare=false;
Square_sizeX=100;//[1:.01:400]
Square_sizeY=100;//[1:.01:400]
Square_sizeZ=100;//[1:.01:400]
Move_SquareX=0;//[-400:.01:400]
Move_SquareY=0;//[-400:.01:400]
Move_SquareZ=0;//[-400:.01:400]
Rotate_SquareX=0;//[0:.01:360]
Rotate_SquareY=0;//[0:.01:360]
Rotate_SquareZ=0;//[0:.01:360]
module Cube(){
if(ViewCube){
%#color("blue",.1)
for(i=[0:Line_Spacing:Cube_sizeZ-1])
translate([Move_cubeX,Move_cubeY,Move_cubeZ])
rotate([Rotate_CubeX,Rotate_CubeY,Rotate_CubeZ])
translate([0,0,i])
cube([Cube_sizeX,Cube_sizeY,Line_width],center=true);
color("white")
import(Path_to_stl,convexity=6);
}
else{
difference(){
color("white")
import(Path_to_stl,convexity=6);
for(i=[0:Line_Spacing:Cube_sizeZ-1])
translate([Move_cubeX,Move_cubeY,Move_cubeZ])
rotate([Rotate_CubeX,Rotate_CubeY,Rotate_CubeZ])
translate([0,0,i])
cube([Cube_sizeX,Cube_sizeY,Line_width],center=true);
}}}
module Square(){
if(ViewSquare){
%#color("blue",.1)
for(i=[0:Line_Spacing:Square_sizeZ-1])
translate([Move_SquareX,Move_SquareY,Move_SquareZ])
rotate([Rotate_SquareX,Rotate_SquareY,Rotate_SquareZ])
translate([0,0,i])
linear_extrude(1)
square([Square_sizeX,Square_sizeY],center=true);
color("white")
import(Path_to_stl,convexity=6);
}
else{
difference(){
color("white")
import(Path_to_stl,convexity=6);
for(i=[0:Line_Spacing:Cube_sizeZ-1])
translate([Move_SquareX,Move_SquareY,Move_SquareZ])
rotate([Rotate_SquareX,Rotate_SquareY,Rotate_SquareZ])
translate([0,0,i])
linear_extrude(1)
square([Square_sizeX,Square_sizeY],center=true);
}}}
if(UseCube)
Cube();
if(UseSquare)
Square();
And here are some examples:
I added a way to visualize where the two intersecting shapes are at so they can be precisely positioned:
Note: you will need to un-select the "view cube" and "view square" options to render it.