Giter Site home page Giter Site logo

scadbuild's Introduction

scadbuild

This allows scad files to be built in batch which will produce a preview .PNG and optionally a .OBJ and .STL output for each.

Tip Make sure the development version of Open Scad is installed as it has needed options for exporting.

Tip If first time set the source and destination directories.

Author

Kiweed Software Dean B. White aka "Hoek67" Kiweed Software 2023

If you like this Software and it saves you time feel free to donate anything as I'm open to improvements.

Building

The build is a single project that should build a 64 bit version and executable.

Example Scad File "lib_rotor.scad"

// measure in mm and scale final results

use <utility.scad>  

module lib_rotor
(
    blades = 3,
    rad = 20, 
    base_h = 6,  
    bl_l = 60, 
    bl_w = 10, 
    bl_angle = 15, 
    blade_segs = 9, 
    detail = 1, 
    cap = 1
)
{
    csegs = blades < 3 ? 8 : blades;
    crot =  360.0 / (blade_segs * detail) * .5;

    // Draw a single rotor blade
    module draw_blade()
    {
      rotate([bl_angle, 0,0]) 
      translate([bl_l  ,0,0])  
      scale([bl_l, bl_w, 1])   
      linear_extrude(height = 2, center = true)  
      rotate([0,0,crot]) 
      circle(1, $fn = blade_segs * detail);
    }
        
    // draw cap on top if wanted   
    if (cap == 1)
    {
        sphere(r = rad * .5, $fn = 8 * detail);
    }

    // Draw the base
    chamfer(r = rad * 0.25, $fn = 6 * detail)
    {
        cylinder(h = base_h, r = rad, $fn = csegs);
    }

    // Draw each blade around the base
    st = 360.0 / blades;

    for (i = [0:st:360])
    {
        rotate([0,0, i]) draw_blade();
    }
}

// Outputs sample usage ... this is the preview and default .STL .OBJ

mm2m()
{
    translate([0, 0, 0]) lib_rotor();
    translate([300, 0, 0]) lib_rotor(blades = 5, base_h = 4);
    translate([600, 0, 0]) lib_rotor(blades = 2, base_h = 4, rad = 15, blade_segs = 6);
};

Sample output

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.