https://github.com/elerac/stl-creator
Create and edit STL files in C++
https://github.com/elerac/stl-creator
3d-models cpp stl-files
Last synced: 12 months ago
JSON representation
Create and edit STL files in C++
- Host: GitHub
- URL: https://github.com/elerac/stl-creator
- Owner: elerac
- License: mit
- Created: 2020-05-20T03:25:25.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-17T15:32:06.000Z (almost 6 years ago)
- Last Synced: 2025-03-24T13:21:26.032Z (about 1 year ago)
- Topics: 3d-models, cpp, stl-files
- Language: C++
- Homepage: https://www.slideshare.net/RyotaMaeda/how-to-use-stl-creator
- Size: 122 KB
- Stars: 10
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# STL creator
create and edit STL files in C++ (Version of C++ is 11 or higher.)
You can see how to use STL-creator from [here](https://www.slideshare.net/secret/LV0MNJfI1xszLl).
```cpp
#include "vec3.h"
#include "triangle.h"
#include "mesh.h"
int main() {
Vec3 p1(0, 0, 1), p2(1, 0, 1), p3(1, 1, 1), p4(0, 1, 1);
Mesh mesh1, mesh2, mesh3, mesh4;
Mesh mesh_dst;
//三角形の追加
Triangle triangle(p1, p2, p3);
mesh1.add(triangle);
//四角形の作成
mesh2 = create_quadrilateral(p1, p2, p3, p4);
mesh2.translate(Vec3(0, 0, -1.5));
//立方体の作成
mesh3 = create_cube();
mesh3.scale(Vec3(1, 0.5, 2.5));
mesh3.rotate(30, Vec3(0, 0, 1));
//STLファイルの入力
mesh4 = stl_read("sphere-ascii.stl");
//メッシュの統合
mesh_dst = mesh1 + mesh2 + mesh3 + mesh4;
//STLファイルの出力
mesh_dst.stl_write("example.stl");
}
```
## duplicate.cpp

## flip.cpp

## heightfield.cpp

## stamp.cpp

## function.cpp
