KeyV2/libraries/scad-utils
2017-11-11 17:32:27 -05:00
..
hull.scad some ISO enter updates 2017-11-11 17:32:27 -05:00
LICENSE some ISO enter updates 2017-11-11 17:32:27 -05:00
linalg.scad some ISO enter updates 2017-11-11 17:32:27 -05:00
lists.scad some ISO enter updates 2017-11-11 17:32:27 -05:00
mirror.scad some ISO enter updates 2017-11-11 17:32:27 -05:00
morphology.scad some ISO enter updates 2017-11-11 17:32:27 -05:00
README.md some ISO enter updates 2017-11-11 17:32:27 -05:00
se3.scad some ISO enter updates 2017-11-11 17:32:27 -05:00
shapes.scad some ISO enter updates 2017-11-11 17:32:27 -05:00
so3.scad some ISO enter updates 2017-11-11 17:32:27 -05:00
spline.scad some ISO enter updates 2017-11-11 17:32:27 -05:00
trajectory_path.scad some ISO enter updates 2017-11-11 17:32:27 -05:00
trajectory.scad some ISO enter updates 2017-11-11 17:32:27 -05:00
transformations.scad some ISO enter updates 2017-11-11 17:32:27 -05:00

scad-utils

Utility libraries for OpenSCAD

Morphology

contains basic 2D morphology operations

inset(d=1)             - creates a polygon at an offset d inside a 2D shape
outset(d=1)            - creates a polygon at an offset d outside a 2D shape
fillet(r=1)            - adds fillets of radius r to all concave corners of a 2D shape
rounding(r=1)          - adds rounding to all convex corners of a 2D shape
shell(d,center=false)  - makes a shell of width d along the edge of a 2D shape
                       - positive values of d places the shell on the outside
                       - negative values of d places the shell on the inside
                       - center=true and positive d places the shell centered on the edge

Examples

With a basic sample polygon shape,

module shape() {
    polygon([[0,0],[1,0],[1.5,1],[2.5,1],[2,-1],[0,-1]]);
}

and $fn=32;.

  • inset(d=0.3) shape();

  • outset(d=0.3) shape();

  • rounding(r=0.3) shape();

  • fillet(r=0.3) shape();

*shell(d=0.3) shape();

*shell(d=-0.3) shape();

*shell(d=0.3,center=true) shape();

Mirror

contains simple mirroring functions

mirror_x()
mirror_y()
mirror_z()

example:

module arrow(l=1,w=.6,t=0.15) {
    mirror_y() polygon([[0,0],[l,0],[l-w/2,w/2],[l-w/2-sqrt(2)*t,w/2],[l-t/2-sqrt(2)*t,t/2],[0,t/2]]);
}