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

#824 in Development tools

Download history 24/week @ 2024-06-17 27/week @ 2024-06-24 15/week @ 2024-07-01 23/week @ 2024-07-08 23/week @ 2024-07-15 21/week @ 2024-07-22 79/week @ 2024-07-29 58/week @ 2024-08-05 68/week @ 2024-08-12 61/week @ 2024-08-19 25/week @ 2024-08-26 9/week @ 2024-09-02 25/week @ 2024-09-09 15/week @ 2024-09-16 33/week @ 2024-09-23 37/week @ 2024-09-30

112 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