6 stable releases

Uses old Rust 2015

1.2.2 Dec 3, 2019
1.2.1 Sep 26, 2019
1.1.0 Sep 3, 2019
1.0.3 Nov 3, 2018
1.0.1 Sep 7, 2018

#852 in Development tools

Download history 32/week @ 2024-07-24 73/week @ 2024-07-31 78/week @ 2024-08-07 65/week @ 2024-08-14 42/week @ 2024-08-21 18/week @ 2024-08-28 13/week @ 2024-09-04 22/week @ 2024-09-11 23/week @ 2024-09-18 31/week @ 2024-09-25 36/week @ 2024-10-02 40/week @ 2024-10-09 25/week @ 2024-10-16 28/week @ 2024-10-23 26/week @ 2024-10-30 17/week @ 2024-11-06

100 downloads per month

LGPL-2.0-or-later

3MB
873 lines

Contains (WOFF font, 120KB) docs/doc/Heuristica-Italic.woff, (WOFF font, 90KB) docs/doc/FiraSans-Medium.woff, (WOFF font, 92KB) docs/doc/FiraSans-Regular.woff, (WOFF font, 56KB) docs/doc/SourceCodePro-Regular.woff, (WOFF font, 56KB) docs/doc/SourceCodePro-Semibold.woff, (WOFF font, 49KB) docs/doc/SourceSerifPro-Bold.woff and 1 more.

Rust scad generator

A library for creating openscad models using rust. I created this project partly because I wanted to learn more about rust and partly because openscad handles variables in a weird way. Variables in a single scope get assigned the last value they had in that scope at all points in that scope. This means that the following code

current_value = 0;
for( i = [0: 3])
{
    current_value = current_value + i;
    echo(current_value);
}
echo(current_value);

would print

0
1
2
3
0

instead of

0
1
3
5
5

as you would expect in most programming languages.

My library works around this issue by using rust to do all logic and generate simple scad code which accomplishes the same thing as more complex scad code would.

Using rust rather than the scad language also comes with other advantages such as being able to store scad objects in variables, static types and being able to use cargo for adding libraries with common objects.

Usage

Add the crate to your cargo.toml

[dependencies]
scad = "1.2"

And import the crate.

#[macro_use]
extern crate scad;
use scad::*;

Then read the documentation for a quick introduction to the library

Documentation

The documentation can be found at docs.rs/scad

Utility repo

Since including dependencies in rust projects using cargo is so simple, I have a repository with some standard objects like nuts, screws and some RC things like servos in a separate repo which you can also include using cargo. For now it's undocumented but I will get around to that eventually.

https://github.com/TheZoq2/Rust-scad-util

Dependencies