Giter Club home page Giter Club logo

open_scad's Introduction

OpenSCAD

Interactive Elixir based CAD Modeling with OpenSCAD

OpenSCAD provides a programatic interface for generating CAD models which can ultimately be 3D printed. While it's syntax makes sense for rendering, it leaves something to be desired when it comes to automating large sets of objects. The language also reads, in my opinion, backwards. I found Elixir's pipe operator to be an elegant way to express these models.

## Draw a 3mm cube, with it's bottom left corner at 0,0,0
cube(size: 3) 
## rotate it 90 degrees around the x axis
|> rotate(v: {90, 0, 0}) 
## move it 10 mm along the y axis (depth)
|> translate(v: {0, 10, 0}) 

# a 1x2x3mm cube, with its center at 0,0,0
cube(size: {1, 2, 3}, center: true) 

Features

  • Models defined in Elixir
  • Reusable components can be included as mix dependencies
  • iex -S mix will watch for changes in a project's ./models directory, and run those scripts.
  • an escript can also be built that watches for changes in the directory specified by the command line, but that version won't import modules from a project's ./lib dir.

OpenSCAD Documentation

Documentation

CheatSheet

Installation

OpenSCAD

You'll need OpenSCAD.

brew cask install openscad

Or download it for your platform here

Adding to your project

Add to your project by putting the following in mix.exs:

  def application do
    [extra_applications: [:logger, :open_scad]]
  end
  def deps do
    [{:open_scad, "~> 0.5.0"}]
  end

This includes the OpenSCAD language and a watcher for filesystem changes.

Creating Models

In your projects' ./models directory, create exs scripts. They can output any number of .scad files.

Your ./lib directory, you can define modules that represent complex, reusable objects. These are things that you might want to include in other project, which you can do by including your project as a dependency in that projects' mix file.

Examples

My Keyboards repo is built with this library, and is a full working example.

open_scad's People

Contributors

joedevivo avatar

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.