3D Part design with Inkscape and OpenScad #54: DXF dimples

An example of how to add a DXF made in Inkscape to the surface of a sphere

2 min read
By Bob
3D Part design with Inkscape and OpenScad #54: DXF dimples

I was experimenting with coating the surface of a sphere with different designs so I can experiment and  what it does to the aerodynamic properties of the sphere, since I already had the code written I made a few changes so I could design a shape in Inkscape and put it on the sphere. Be aware that this can become pretty compute intensive if you add too many rows but it is fun to see what can be made.

Here is the code I used, just copy and paste it into the editor in OpenScad to try it out:

/* [Dimpled Sphere] */
Path_to_DXF_File="/home/none3/Desktop/drawing.dxf";
Layer_name="";
Show_Sphere = true;
Show_DXF_dimples = false;
Dimple_size = .10; //[.01:.01:1]
Dimple_depth = 10; //[0:.01:10]
Rows = 14; //[1:.01:30]
Spacing = 72;//[1:.1:100]
Diameter = 50; //[1:.1:200]
Sphere_shape =100;//[3:1:100]
Rotate_DXF = 50; //[0:.1:360]
Rotate_All_X = 0; //[0:.1:360]
Rotate_All_Y = 0; //[0:.1:360]
Rotate_All_Z = 0; //[0:.1:360]
Move_X = 0; //[-200:.1:200]
Move_Y = 0; //[-200:.1:200]
Move_Z = 0; //[-200:.1:200]

module Dimples(){
   rotate([Rotate_All_X,Rotate_All_Y,Rotate_All_Z])
   rotate([90,0,0])
   translate([Move_X,Move_Y,Move_Z]) 
for(h=[1:Rows])  
   rotate([0,0,h*-360/Rows]) 
   translate([0,Diameter/2-.7,0])
   scale([Dimple_size,Dimple_size,Dimple_size]) 
   rotate([270,Rotate_DXF,0])
   linear_extrude(Dimple_depth,convexity=10)
   import(Path_to_DXF_File, layer = Layer_name);
}

if(Show_Sphere)
difference(){
  sphere(Diameter/2-(.5*Dimple_size),$fn=Sphere_shape);
   for (R=[0:Spacing:360])
   rotate([0,0,R])
   Dimples(); 
} 

if (Show_DXF_dimples){
   for (R=[0:Spacing:360])
   rotate([0,0,R])
   Dimples();
}

And here are a few examples:

If you aren't already using the newest build I highly recommend giving it a try, the rendering speeds are super fast. https://openscad.org/downloads.html< scroll down to development builds