Coder Social home page Coder Social logo

qbox's Introduction

qbox

Quickly create boxes in OpenSCAD.

The whole project is geared toward the 3D printing of boxes, though it could be used elsewhere.

Not quite ready for prime time yet -- documentation being the major missing piece.

If you want to get started anyway, I suggest starting with examples/intercom.scad This is a real world example of a box that holds an ESP8266-based intercom. The CPU itself is on a solderless breadboard, with its USB port lining up with the USB slot in the model.

A quick guide to qbox

Choose one of simple_box or filleted_box.

At the top of the source code of your chosen box, there is a comment containing lines of OpenSCAD code. Use this as your template. You can also start with one of the files in examples.

In the examples for these boxes you will see functions that create the box, the lid, etc.

Each of these functions (called modules by OpenSCAD), has code of this form:

    difference() {
        union() {
            box(); // Create the box or lid or body...
            left(d/2, 2*(h/3)) component(); // Create a component on the left workplane.
						// Other components THAT ARE NOT HOLES OR MARKERS GO here.
        }
				// Holes and Markers go here.
        right(d/2, h-15) horizontal_slot_hole(12, 7); // Slot for micro-usb
        left(d/2, 2*(h/3)) bme280_hole();
        left(d/2, 2*(h/3)) bme280_marker();
    }

Functions ending with _hole() or _holes() or _marker() must appear in the difference section as they are removed. All other components are drawn (rather than subtracted) and appear in the union.

Workplanes

Workplanes are a concept from most cad systems and represent the 2D drawings you'll make when you design your box.

Look at your box from its width (called 'w' in the code), with its depth (called 'd') extending away from you. The OpenSCAD x, y, and z origin is the left, front, bottom corner inside the box.

Workplanes left, right, front, back and bottom for boxes are the corresponding planes inside the box.

It works the same way for lids, but as the lids are shown as if they are boxes (i.e. the lid's "top" is downward when you view the model in OpenSCAD) the "bottom" plane refers to the underside of the lids top.

For bodies, they are the same as boxes but have a separate bottom (to allow printing in a different color).

Components

Draw all components at the origin. Round (and a few exceptions) are centered over the origin. All others are drawn with origin at its bottom left corner.

Components that need to make a hole, are drawn inverse. In other words, you draw a solid that will used as the shape of what is to be removed.

Markers are for components that are on the side, but are too complex to be 3d printed there without supports. Essentially a marker is a tiny hole used to mark the position where the separately printed component will be glued (use super glue with PLA).

utility.scad vs components.scad

Both of these files contain components (utility has a few additional functions). The components in utility.scad are intended for use in boxes (like filleted_box.scad) and projects (such as found in examples). The ones in components.scad are intended for projects only.

qbox's People

Contributors

briansturgill avatar

Watchers

 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.