2019-06-11 15:35:31 +08:00
# dotSCAD 2 (beta)
2017-03-11 17:49:46 +08:00
2019-06-12 09:16:54 +08:00
> **Reduce the burden of 3D modeling in mathematics. Based on OpenSCAD 2019.05.**
2017-03-11 17:49:46 +08:00
2019-05-20 17:28:12 +08:00
![dotSCAD ](WhirlingTaiwan.JPG )
2017-05-08 17:18:56 +08:00
2017-03-17 08:39:31 +08:00
[![license/LGPL ](https://img.shields.io/badge/license-LGPL-blue.svg )](https://github.com/JustinSDK/lib-openscad/blob/master/LICENSE)
2017-03-15 15:30:24 +08:00
2017-03-27 17:36:32 +08:00
## Introduction
2017-04-23 08:47:39 +08:00
OpenSCAD uses three library locations, the installation library, built-in library, and user defined libraries. It's convenient to set `OPENSCADPATH` . Check [Setting OPENSCADPATH ](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Libraries#Setting_OPENSCADPATH ) in [OpenSCAD User Manual/Libraries ](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Libraries ) for details.
2017-03-31 13:16:00 +08:00
Every module or function is located in the file which has the same name as the module or the function. For example, if you want to use the `line2d` module to draw a line, `include <line2d.scad>;` first.
2017-03-27 17:34:32 +08:00
include < line2d.scad > ;
2017-03-27 17:35:13 +08:00
2017-03-27 17:34:32 +08:00
line2d(p1 = [0, 0], p2 = [5, 0], width = 1);
2019-06-20 14:35:53 +08:00
Some module files are organized in a directory. For example, px_circle.scad exists in `pixel` directory. You have to prefix the directory name when including `px_circle` .
include < pixel / px_circle . scad > ;
2019-06-21 17:47:00 +08:00
points = px_circle(radius = 10);
2019-06-20 14:35:53 +08:00
for(pt = points) {
2019-06-20 18:33:22 +08:00
translate(pt) square(1);
2019-06-20 14:35:53 +08:00
}
## Dependencies
2018-02-28 09:34:27 +08:00
Some modules depend on other modules. For example, the `polyline2d` module depends on the `line2d` module, so you also have to `include <line2d.scad>;` besides `include <polyline3d.scad>;` .
2017-03-27 17:34:32 +08:00
include < line2d.scad > ;
include < polyline3d.scad > ;
2017-03-27 17:35:13 +08:00
2017-03-27 17:34:32 +08:00
polyline2d(points = [[1, 2], [-5, -4], [-5, 3], [5, 5]], width = 1);
2017-03-16 20:26:15 +08:00
2019-06-20 14:35:53 +08:00
If OpenSCAD generates "WARNING: Ignoring unknown xxx function" or "WARNING: Ignoring unknown xxx module" when using one module of dotSCAD. Just try to `include <xxx.scad>;` or `include <dir/xxx.scad>` if xxx.scad exists in `dir` directory.
2017-05-01 10:20:48 +08:00
2017-05-04 14:14:06 +08:00
Too many dependencies? Because OpenSCAD doesn't provide namespace management, I personally think that exposing dependencies is better than hiding them. In this way, users can have their own way to manage dependencies. How to categorize dependencies is up to you. For example, you can include your commonly-used modules and functions in "commonly_used.scad" and then `include <commonly_used.scad>;` in the ".scad" file of your project.
2019-06-20 20:31:59 +08:00
**If you really don't want to care about dependencies, `include <dotSCAD.scad>;` or `use <dotSCAD.scad>;` come to save you.**
2019-06-17 20:25:03 +08:00
2017-03-17 08:37:19 +08:00
## Documentation
- 2D
2017-05-08 09:56:23 +08:00
- [arc ](https://openhome.cc/eGossip/OpenSCAD/lib-arc.html )
- [pie ](https://openhome.cc/eGossip/OpenSCAD/lib-pie.html )
2017-04-22 17:14:09 +08:00
- [rounded_square ](https://openhome.cc/eGossip/OpenSCAD/lib-rounded_square.html )
2017-03-17 08:37:19 +08:00
- [line2d ](https://openhome.cc/eGossip/OpenSCAD/lib-line2d.html )
- [polyline2d ](https://openhome.cc/eGossip/OpenSCAD/lib-polyline2d.html )
2017-04-24 17:32:44 +08:00
- [hull_polyline2d ](https://openhome.cc/eGossip/OpenSCAD/lib-hull_polyline2d.html )
2017-04-11 15:38:35 +08:00
- [hexagons ](https://openhome.cc/eGossip/OpenSCAD/lib-hexagons.html )
2017-04-30 16:47:23 +08:00
- [polytransversals ](https://openhome.cc/eGossip/OpenSCAD/lib-polytransversals.html )
2019-02-01 16:15:06 +08:00
- [multi_line_text ](https://openhome.cc/eGossip/OpenSCAD/lib-multi_line_text.html )
2019-06-09 11:28:30 +08:00
- [voronoi2d ](https://openhome.cc/eGossip/OpenSCAD/lib-voronoi2d.html )
2017-03-17 08:37:19 +08:00
- 3D
2017-04-23 10:52:45 +08:00
- [rounded_cube ](https://openhome.cc/eGossip/OpenSCAD/lib-rounded_cube.html )
2017-05-11 15:24:02 +08:00
- [rounded_cylinder ](https://openhome.cc/eGossip/OpenSCAD/lib-rounded_cylinder.html )
2017-05-23 08:27:36 +08:00
- [crystal_ball ](https://openhome.cc/eGossip/OpenSCAD/lib-crystal_ball.html )
2017-03-17 08:37:19 +08:00
- [line3d ](https://openhome.cc/eGossip/OpenSCAD/lib-line3d.html )
2017-03-17 08:56:47 +08:00
- [polyline3d ](https://openhome.cc/eGossip/OpenSCAD/lib-polyline3d.html )
2017-03-17 10:29:50 +08:00
- [hull_polyline3d ](https://openhome.cc/eGossip/OpenSCAD/lib-hull_polyline3d.html )
2017-04-05 11:25:08 +08:00
- [function_grapher ](https://openhome.cc/eGossip/OpenSCAD/lib-function_grapher.html )
2017-04-30 20:05:17 +08:00
- [polysections ](https://openhome.cc/eGossip/OpenSCAD/lib-polysections.html )
2019-05-20 17:37:42 +08:00
- [starburst ](https://openhome.cc/eGossip/OpenSCAD/lib-starburst.html )
2019-06-09 11:28:30 +08:00
- [voronoi3d ](https://openhome.cc/eGossip/OpenSCAD/lib-voronoi3d.html )
2017-04-05 11:25:08 +08:00
2017-03-23 08:23:33 +08:00
- Transformation
2017-04-23 11:16:34 +08:00
- [along_with ](https://openhome.cc/eGossip/OpenSCAD/lib-along_with.html )
2017-03-17 08:37:19 +08:00
- [hollow_out ](https://openhome.cc/eGossip/OpenSCAD/lib-hollow_out.html )
2017-03-19 09:11:41 +08:00
- [bend ](https://openhome.cc/eGossip/OpenSCAD/lib-bend.html )
2019-05-02 11:10:57 +08:00
- [shear ](https://openhome.cc/eGossip/OpenSCAD/lib-shear.html )
2017-03-15 15:30:24 +08:00
2017-03-28 20:56:13 +08:00
- Functon
- [rotate_p ](https://openhome.cc/eGossip/OpenSCAD/lib-rotate_p.html )
2017-03-29 11:35:41 +08:00
- [sub_str ](https://openhome.cc/eGossip/OpenSCAD/lib-sub_str.html )
2017-03-29 13:20:17 +08:00
- [split_str ](https://openhome.cc/eGossip/OpenSCAD/lib-split_str.html )
2017-03-29 13:50:43 +08:00
- [parse_number ](https://openhome.cc/eGossip/OpenSCAD/lib-parse_number.html )
2017-05-04 10:07:14 +08:00
- [cross_sections ](https://openhome.cc/eGossip/OpenSCAD/lib-cross_sections.html )
2017-06-01 13:26:02 +08:00
- [paths2sections ](https://openhome.cc/eGossip/OpenSCAD/lib-paths2sections.html )
2019-05-20 17:37:42 +08:00
- [path_scaling_sections ](https://openhome.cc/eGossip/OpenSCAD/lib-path_scaling_sections.html )
- [bijection_offset ](https://openhome.cc/eGossip/OpenSCAD/lib-bijection_offset.html )
2019-06-09 11:28:30 +08:00
- [in_polyline ](https://openhome.cc/eGossip/OpenSCAD/lib-in_polyline.html )
- [in_shape ](https://openhome.cc/eGossip/OpenSCAD/lib-in_shape.html )
- [midpt_smooth ](https://openhome.cc/eGossip/OpenSCAD/lib-midpt_smooth.html )
- [trim_shape ](https://openhome.cc/eGossip/OpenSCAD/lib-trim_shape.html )
- [triangulate ](https://openhome.cc/eGossip/OpenSCAD/lib-triangulate.html )
2017-03-29 11:35:41 +08:00
2017-03-23 08:23:33 +08:00
- Path
2018-06-10 13:49:27 +08:00
- [arc_path ](https://openhome.cc/eGossip/OpenSCAD/lib-arc_path.html )
- [circle_path ](https://openhome.cc/eGossip/OpenSCAD/lib-circle_path.html )
2017-04-08 06:48:36 +08:00
- [bezier_curve ](https://openhome.cc/eGossip/OpenSCAD/lib-bezier_curve.html )
2017-04-08 08:57:57 +08:00
- [bezier_surface ](https://openhome.cc/eGossip/OpenSCAD/lib-bezier_surface.html )
2017-05-17 18:02:57 +08:00
- [bezier_smooth ](https://openhome.cc/eGossip/OpenSCAD/lib-bezier_smooth.html )
2017-04-07 14:30:29 +08:00
- [helix ](https://openhome.cc/eGossip/OpenSCAD/lib-helix.html )
2017-04-25 20:20:05 +08:00
- [golden_spiral ](https://openhome.cc/eGossip/OpenSCAD/lib-golden_spiral.html )
2017-03-27 15:32:36 +08:00
- [archimedean_spiral ](https://openhome.cc/eGossip/OpenSCAD/lib-archimedean_spiral.html )
2017-03-29 17:51:57 +08:00
- [sphere_spiral ](https://openhome.cc/eGossip/OpenSCAD/lib-sphere_spiral.html )
2019-05-20 17:37:42 +08:00
- [torus_knot ](https://openhome.cc/eGossip/OpenSCAD/lib-torus_knot.html )
2017-03-26 16:51:41 +08:00
2017-05-04 15:39:04 +08:00
- Extrusion
2017-03-27 17:34:32 +08:00
- [box_extrude ](https://openhome.cc/eGossip/OpenSCAD/lib-box_extrude.html )
2017-04-21 10:59:49 +08:00
- [ellipse_extrude ](https://openhome.cc/eGossip/OpenSCAD/lib-ellipse_extrude.html )
2017-03-28 09:09:37 +08:00
- [stereographic_extrude ](https://openhome.cc/eGossip/OpenSCAD/lib-stereographic_extrude.html )
2017-05-14 17:07:52 +08:00
- [rounded_extrude ](https://openhome.cc/eGossip/OpenSCAD/lib-rounded_extrude.html )
2017-05-06 14:03:17 +08:00
2017-05-14 17:07:52 +08:00
- 2D Shape
2017-05-12 20:25:18 +08:00
- [shape_taiwan ](https://openhome.cc/eGossip/OpenSCAD/lib-shape_taiwan.html )
- [shape_arc ](https://openhome.cc/eGossip/OpenSCAD/lib-shape_arc.html )
2017-05-09 17:18:09 +08:00
- [shape_pie ](https://openhome.cc/eGossip/OpenSCAD/lib-shape_pie.html )
2017-05-08 09:56:23 +08:00
- [shape_ellipse ](https://openhome.cc/eGossip/OpenSCAD/lib-shape_ellipse.html )
2017-05-06 14:03:17 +08:00
- [shape_square ](https://openhome.cc/eGossip/OpenSCAD/lib-shape_square.html )
2017-05-14 13:38:24 +08:00
- [shape_trapezium ](https://openhome.cc/eGossip/OpenSCAD/lib-shape_trapezium.html )
2017-05-15 08:31:54 +08:00
- [shape_cyclicpolygon ](https://openhome.cc/eGossip/OpenSCAD/lib-shape_cyclicpolygon.html )
2017-05-10 13:23:57 +08:00
- [shape_pentagram ](https://openhome.cc/eGossip/OpenSCAD/lib-shape_pentagram.html )
2018-12-11 18:06:47 +08:00
- [shape_starburst ](https://openhome.cc/eGossip/OpenSCAD/lib-shape_starburst.html )
2017-05-24 11:41:14 +08:00
- [shape_superformula ](https://openhome.cc/eGossip/OpenSCAD/lib-shape_superformula.html )
2017-06-03 15:12:36 +08:00
- [shape_glued2circles ](https://openhome.cc/eGossip/OpenSCAD/lib-shape_glued2circles.html )
2017-05-24 11:41:14 +08:00
- [shape_path_extend ](https://openhome.cc/eGossip/OpenSCAD/lib-shape_path_extend.html )
2017-05-14 17:07:52 +08:00
- 2D Shape Extrusion
2019-06-09 11:28:30 +08:00
- [bend_extrude ](https://openhome.cc/eGossip/OpenSCAD/lib-bend_extrude.html )
2017-05-14 17:07:52 +08:00
- [path_extrude ](https://openhome.cc/eGossip/OpenSCAD/lib-path_extrude.html )
- [ring_extrude ](https://openhome.cc/eGossip/OpenSCAD/lib-ring_extrude.html )
- [helix_extrude ](https://openhome.cc/eGossip/OpenSCAD/lib-helix_extrude.html )
- [golden_spiral_extrude ](https://openhome.cc/eGossip/OpenSCAD/lib-golden_spiral_extrude.html )
- [archimedean_spiral_extrude ](https://openhome.cc/eGossip/OpenSCAD/lib-archimedean_spiral_extrude.html )
- [sphere_spiral_extrude ](https://openhome.cc/eGossip/OpenSCAD/lib-sphere_spiral_extrude.html )
2019-05-02 11:10:57 +08:00
- Matrix
2019-06-22 14:28:21 +08:00
- [matrix/m_cumulate ](https://openhome.cc/eGossip/OpenSCAD/lib2-m_cumulate.html )
- [matrix/m_translation ](https://openhome.cc/eGossip/OpenSCAD/lib2-m_translation.html )
- [matrix/m_rotation ](https://openhome.cc/eGossip/OpenSCAD/lib2-m_rotation.html )
- [matrix/m_scaling ](https://openhome.cc/eGossip/OpenSCAD/lib2-m_scaling.html )
- [matrix/m_mirror ](https://openhome.cc/eGossip/OpenSCAD/lib2-m_mirror.html )
- [matrix/m_shearing ](https://openhome.cc/eGossip/OpenSCAD/lib2-m_shearing.html )
2019-05-02 11:10:57 +08:00
2019-06-20 09:21:10 +08:00
- Turtle
2019-06-20 20:29:58 +08:00
- [turtle/turtle2d ](https://openhome.cc/eGossip/OpenSCAD/lib2-turtle2d.html )
- [turtle/turtle3d ](https://openhome.cc/eGossip/OpenSCAD/lib2-turtle3d.html )
2017-03-27 17:34:32 +08:00
2019-06-20 09:27:55 +08:00
- Pixel
2019-06-20 20:29:58 +08:00
- pixel/px_line
- pixel/px_polyline
- pixel/px_circle
- pixel/px_cylinder
2019-06-21 20:23:15 +08:00
- pixel/px_sphere
2019-06-20 09:27:55 +08:00
2017-03-29 11:52:52 +08:00
## Bugs and Feedback
For bugs, questions and discussions please use the [Github Issues ](https://github.com/JustinSDK/dotSCAD/issues ).
2017-03-27 17:34:32 +08:00
## About dotSCAD
2017-03-30 14:46:10 +08:00
I've been using OpenSCAD for years and created some funny things. Some of them include several important ideas and details. To prevent forgetfulness, I decided to [write them down ](https://openhome.cc/eGossip/OpenSCAD/ ). Some examples developed in the documentation are useful so I elaborate them into this library.
The idea of the name dotSCAD comes from the filename extension ".scad" of OpenSCAD.