SlideShare a Scribd company logo
1 of 7
Download to read offline
STL creator https://github.com/elerac/stl-creator
• C++ based STL file generator
• Reading and writing of STL files
• Basic three-dimensional creation (cubes and squares)
• Scaling, translation and rotation
STL creator https://github.com/elerac/stl-creator
#inlcude "vec3.h”
#include "mesh.h”
int main() {
Mesh mesh1;
mesh1.add(Vec3(0, 0, 0), Vec3(0, 0, 1), Vec3(0.5, 1, 0.5));
mesh1.stl_write(“example.stl”);
}
(0, 0, 0)
(0, 0, 1)
(0.5, 1, 0.5)
STL creator https://github.com/elerac/stl-creator
#inlcude "vec3.h”
#include "mesh.h”
int main() {
Mesh mesh1;
mesh1.add(Vec3(0, 0, 0), Vec3(0, 0, 1), Vec3(0.5, 1, 0.5));
mesh1.add(Vec3(0, 0, 1), Vec3(1, 0, 1), Vec3(0.5, 1, 0.5));
mesh1.add(Vec3(1, 0, 1), Vec3(1, 0, 0), Vec3(0.5, 1, 0.5));
mesh1.add(Vec3(1, 0, 0), Vec3(0, 0, 0), Vec3(0.5, 1, 0.5));
mesh1.stl_write(“example.stl”);
}
STL creator https://github.com/elerac/stl-creator
#inlcude "vec3.h”
#include "mesh.h”
int main() {
Mesh mesh1, mesh2;
mesh1.add(Vec3(0, 0, 0), Vec3(0, 0, 1), Vec3(0.5, 1, 0.5));
mesh1.add(Vec3(0, 0, 1), Vec3(1, 0, 1), Vec3(0.5, 1, 0.5));
mesh1.add(Vec3(1, 0, 1), Vec3(1, 0, 0), Vec3(0.5, 1, 0.5));
mesh1.add(Vec3(1, 0, 0), Vec3(0, 0, 0), Vec3(0.5, 1, 0.5));
mesh2 = create_cube();
mesh1 += mesh2;
mesh1.stl_write(“example.stl”);
}
STL creator https://github.com/elerac/stl-creator
#inlcude "vec3.h”
#include "mesh.h”
int main() {
Mesh mesh1, mesh2;
mesh1.add(Vec3(0, 0, 0), Vec3(0, 0, 1), Vec3(0.5, 1, 0.5));
mesh1.add(Vec3(0, 0, 1), Vec3(1, 0, 1), Vec3(0.5, 1, 0.5));
mesh1.add(Vec3(1, 0, 1), Vec3(1, 0, 0), Vec3(0.5, 1, 0.5));
mesh1.add(Vec3(1, 0, 0), Vec3(0, 0, 0), Vec3(0.5, 1, 0.5));
mesh2 = create_cube();
mesh2.translate(Vec3(0.5, -0.5, 0.5));
mesh1 += mesh2;
mesh1.stl_write(“example.stl”);
}
STL creator https://github.com/elerac/stl-creator
#inlcude "vec3.h”
#include "mesh.h”
int main() {
Mesh mesh;
mesh = create_cube();
mesh.translate(Vec3(0, 0, -1.5));
mesh.scale(Vec3(2, 2, 2));
mesh.rotate(30, Vec3(0, 0, 1));
}
Vec3(0, 0, -1.5)
×2
translate
scale
rotate
30°
Vec3(0, 0, 1)
STL creator https://github.com/elerac/stl-creator
#inlcude "vec3.h”
#include "mesh.h”
int main() {
Mesh mesh_src, mesh_dst;
mesh_src = stl_read("stanford_dragon_ascii.stl");
mesh_src.translate(Vec3(-5, 0, 0));
for (int i=0; i<6; i++) {
mesh_src.rotate(60, Vec3(0, 0, 1));
mesh_dst += mesh_src;
}
mesh_dst.stl_write("transformed_dragons.stl");
}
src
dst

More Related Content

What's hot

Statistical Semantic入門 ~分布仮説からword2vecまで~
Statistical Semantic入門 ~分布仮説からword2vecまで~Statistical Semantic入門 ~分布仮説からword2vecまで~
Statistical Semantic入門 ~分布仮説からword2vecまで~
Yuya Unno
 

What's hot (20)

06 第5.1節-第5.7節 ROS2に対応したツール/パッケージ
06 第5.1節-第5.7節 ROS2に対応したツール/パッケージ06 第5.1節-第5.7節 ROS2に対応したツール/パッケージ
06 第5.1節-第5.7節 ROS2に対応したツール/パッケージ
 
[DL Hacks]Semantic Instance Segmentation with a Discriminative Loss Function
[DL Hacks]Semantic Instance Segmentation with a Discriminative Loss Function[DL Hacks]Semantic Instance Segmentation with a Discriminative Loss Function
[DL Hacks]Semantic Instance Segmentation with a Discriminative Loss Function
 
Rosbag search system
Rosbag search systemRosbag search system
Rosbag search system
 
Probabilistic Graphical Models 輪読会 #1
Probabilistic Graphical Models 輪読会 #1Probabilistic Graphical Models 輪読会 #1
Probabilistic Graphical Models 輪読会 #1
 
Paper: Objects as Points(CenterNet)
Paper: Objects as Points(CenterNet)Paper: Objects as Points(CenterNet)
Paper: Objects as Points(CenterNet)
 
SSII2021 [OS3-01] 設備や環境の高品質計測点群取得と自動モデル化技術
SSII2021 [OS3-01] 設備や環境の高品質計測点群取得と自動モデル化技術SSII2021 [OS3-01] 設備や環境の高品質計測点群取得と自動モデル化技術
SSII2021 [OS3-01] 設備や環境の高品質計測点群取得と自動モデル化技術
 
事例に学ぶIE分析~動線,流れ図,作業分析表~
事例に学ぶIE分析~動線,流れ図,作業分析表~事例に学ぶIE分析~動線,流れ図,作業分析表~
事例に学ぶIE分析~動線,流れ図,作業分析表~
 
Towards Performant Video Recognition
Towards Performant Video RecognitionTowards Performant Video Recognition
Towards Performant Video Recognition
 
Jetson TK1でSemi-Global Matching
Jetson TK1でSemi-Global MatchingJetson TK1でSemi-Global Matching
Jetson TK1でSemi-Global Matching
 
統計的学習手法よる人検出
統計的学習手法よる人検出統計的学習手法よる人検出
統計的学習手法よる人検出
 
WindowsではじめるROSプログラミング
WindowsではじめるROSプログラミングWindowsではじめるROSプログラミング
WindowsではじめるROSプログラミング
 
Statistical Semantic入門 ~分布仮説からword2vecまで~
Statistical Semantic入門 ~分布仮説からword2vecまで~Statistical Semantic入門 ~分布仮説からword2vecまで~
Statistical Semantic入門 ~分布仮説からword2vecまで~
 
[DL輪読会]FaceForensics++: Learning to Detect Manipulated Facial Images
[DL輪読会]FaceForensics++: Learning to Detect Manipulated Facial Images[DL輪読会]FaceForensics++: Learning to Detect Manipulated Facial Images
[DL輪読会]FaceForensics++: Learning to Detect Manipulated Facial Images
 
大学院進学が切り拓く情報系学生のキャリア
大学院進学が切り拓く情報系学生のキャリア大学院進学が切り拓く情報系学生のキャリア
大学院進学が切り拓く情報系学生のキャリア
 
SSII2018TS: 3D物体検出とロボットビジョンへの応用
SSII2018TS: 3D物体検出とロボットビジョンへの応用SSII2018TS: 3D物体検出とロボットビジョンへの応用
SSII2018TS: 3D物体検出とロボットビジョンへの応用
 
空撮画像技術と3次元リアルタイムデータの可視化について
空撮画像技術と3次元リアルタイムデータの可視化について空撮画像技術と3次元リアルタイムデータの可視化について
空撮画像技術と3次元リアルタイムデータの可視化について
 
ディープラーニングのフレームワークと特許戦争
ディープラーニングのフレームワークと特許戦争ディープラーニングのフレームワークと特許戦争
ディープラーニングのフレームワークと特許戦争
 
MixMatch: A Holistic Approach to Semi- Supervised Learning
MixMatch: A Holistic Approach to Semi- Supervised LearningMixMatch: A Holistic Approach to Semi- Supervised Learning
MixMatch: A Holistic Approach to Semi- Supervised Learning
 
NEDO講座 MoveIt! チュートリアル 第1部
NEDO講座 MoveIt! チュートリアル 第1部NEDO講座 MoveIt! チュートリアル 第1部
NEDO講座 MoveIt! チュートリアル 第1部
 
内発的動機づけの計算モデル, 岡夏樹
内発的動機づけの計算モデル, 岡夏樹内発的動機づけの計算モデル, 岡夏樹
内発的動機づけの計算モデル, 岡夏樹
 

Similar to How to use STL creator

Os Vanrossum
Os VanrossumOs Vanrossum
Os Vanrossum
oscon2007
 
Playing with d3.js
Playing with d3.jsPlaying with d3.js
Playing with d3.js
mangoice
 
03 standard class library
03 standard class library03 standard class library
03 standard class library
eleksdev
 
ImplementingCryptoSecurityARMCortex_Doin
ImplementingCryptoSecurityARMCortex_DoinImplementingCryptoSecurityARMCortex_Doin
ImplementingCryptoSecurityARMCortex_Doin
Jonny Doin
 

Similar to How to use STL creator (20)

Modern C++
Modern C++Modern C++
Modern C++
 
2CPP16 - STL
2CPP16 - STL2CPP16 - STL
2CPP16 - STL
 
R for Pirates. ESCCONF October 27, 2011
R for Pirates. ESCCONF October 27, 2011R for Pirates. ESCCONF October 27, 2011
R for Pirates. ESCCONF October 27, 2011
 
OWC 2012 (Open Web Camp)
OWC 2012 (Open Web Camp)OWC 2012 (Open Web Camp)
OWC 2012 (Open Web Camp)
 
Blockchain - a simple implementation
Blockchain - a simple implementationBlockchain - a simple implementation
Blockchain - a simple implementation
 
Interview with Anatoliy Kuznetsov, the author of BitMagic C++ library
Interview with Anatoliy Kuznetsov, the author of BitMagic C++ libraryInterview with Anatoliy Kuznetsov, the author of BitMagic C++ library
Interview with Anatoliy Kuznetsov, the author of BitMagic C++ library
 
Os Vanrossum
Os VanrossumOs Vanrossum
Os Vanrossum
 
A Rusty introduction to Apache Arrow and how it applies to a time series dat...
A Rusty introduction to Apache Arrow and how it applies to a  time series dat...A Rusty introduction to Apache Arrow and how it applies to a  time series dat...
A Rusty introduction to Apache Arrow and how it applies to a time series dat...
 
Next Generation Indexes For Big Data Engineering (ODSC East 2018)
Next Generation Indexes For Big Data Engineering (ODSC East 2018)Next Generation Indexes For Big Data Engineering (ODSC East 2018)
Next Generation Indexes For Big Data Engineering (ODSC East 2018)
 
Cross platform Mobile development on Titanium
Cross platform Mobile development on TitaniumCross platform Mobile development on Titanium
Cross platform Mobile development on Titanium
 
Playing with d3.js
Playing with d3.jsPlaying with d3.js
Playing with d3.js
 
03 standard class library
03 standard class library03 standard class library
03 standard class library
 
Overview of the Hive Stinger Initiative
Overview of the Hive Stinger InitiativeOverview of the Hive Stinger Initiative
Overview of the Hive Stinger Initiative
 
ImplementingCryptoSecurityARMCortex_Doin
ImplementingCryptoSecurityARMCortex_DoinImplementingCryptoSecurityARMCortex_Doin
ImplementingCryptoSecurityARMCortex_Doin
 
The Ring programming language version 1.7 book - Part 44 of 196
The Ring programming language version 1.7 book - Part 44 of 196The Ring programming language version 1.7 book - Part 44 of 196
The Ring programming language version 1.7 book - Part 44 of 196
 
An Introduction to gensim: "Topic Modelling for Humans"
An Introduction to gensim: "Topic Modelling for Humans"An Introduction to gensim: "Topic Modelling for Humans"
An Introduction to gensim: "Topic Modelling for Humans"
 
2CPP15 - Templates
2CPP15 - Templates2CPP15 - Templates
2CPP15 - Templates
 
Introduction to C++, Standard Library, Class Template vector.pptx
Introduction to C++, Standard  Library, Class Template  vector.pptxIntroduction to C++, Standard  Library, Class Template  vector.pptx
Introduction to C++, Standard Library, Class Template vector.pptx
 
STL in C++
STL in C++STL in C++
STL in C++
 
MongoDB
MongoDBMongoDB
MongoDB
 

Recently uploaded

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 

Recently uploaded (20)

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 

How to use STL creator

  • 1. STL creator https://github.com/elerac/stl-creator • C++ based STL file generator • Reading and writing of STL files • Basic three-dimensional creation (cubes and squares) • Scaling, translation and rotation
  • 2. STL creator https://github.com/elerac/stl-creator #inlcude "vec3.h” #include "mesh.h” int main() { Mesh mesh1; mesh1.add(Vec3(0, 0, 0), Vec3(0, 0, 1), Vec3(0.5, 1, 0.5)); mesh1.stl_write(“example.stl”); } (0, 0, 0) (0, 0, 1) (0.5, 1, 0.5)
  • 3. STL creator https://github.com/elerac/stl-creator #inlcude "vec3.h” #include "mesh.h” int main() { Mesh mesh1; mesh1.add(Vec3(0, 0, 0), Vec3(0, 0, 1), Vec3(0.5, 1, 0.5)); mesh1.add(Vec3(0, 0, 1), Vec3(1, 0, 1), Vec3(0.5, 1, 0.5)); mesh1.add(Vec3(1, 0, 1), Vec3(1, 0, 0), Vec3(0.5, 1, 0.5)); mesh1.add(Vec3(1, 0, 0), Vec3(0, 0, 0), Vec3(0.5, 1, 0.5)); mesh1.stl_write(“example.stl”); }
  • 4. STL creator https://github.com/elerac/stl-creator #inlcude "vec3.h” #include "mesh.h” int main() { Mesh mesh1, mesh2; mesh1.add(Vec3(0, 0, 0), Vec3(0, 0, 1), Vec3(0.5, 1, 0.5)); mesh1.add(Vec3(0, 0, 1), Vec3(1, 0, 1), Vec3(0.5, 1, 0.5)); mesh1.add(Vec3(1, 0, 1), Vec3(1, 0, 0), Vec3(0.5, 1, 0.5)); mesh1.add(Vec3(1, 0, 0), Vec3(0, 0, 0), Vec3(0.5, 1, 0.5)); mesh2 = create_cube(); mesh1 += mesh2; mesh1.stl_write(“example.stl”); }
  • 5. STL creator https://github.com/elerac/stl-creator #inlcude "vec3.h” #include "mesh.h” int main() { Mesh mesh1, mesh2; mesh1.add(Vec3(0, 0, 0), Vec3(0, 0, 1), Vec3(0.5, 1, 0.5)); mesh1.add(Vec3(0, 0, 1), Vec3(1, 0, 1), Vec3(0.5, 1, 0.5)); mesh1.add(Vec3(1, 0, 1), Vec3(1, 0, 0), Vec3(0.5, 1, 0.5)); mesh1.add(Vec3(1, 0, 0), Vec3(0, 0, 0), Vec3(0.5, 1, 0.5)); mesh2 = create_cube(); mesh2.translate(Vec3(0.5, -0.5, 0.5)); mesh1 += mesh2; mesh1.stl_write(“example.stl”); }
  • 6. STL creator https://github.com/elerac/stl-creator #inlcude "vec3.h” #include "mesh.h” int main() { Mesh mesh; mesh = create_cube(); mesh.translate(Vec3(0, 0, -1.5)); mesh.scale(Vec3(2, 2, 2)); mesh.rotate(30, Vec3(0, 0, 1)); } Vec3(0, 0, -1.5) ×2 translate scale rotate 30° Vec3(0, 0, 1)
  • 7. STL creator https://github.com/elerac/stl-creator #inlcude "vec3.h” #include "mesh.h” int main() { Mesh mesh_src, mesh_dst; mesh_src = stl_read("stanford_dragon_ascii.stl"); mesh_src.translate(Vec3(-5, 0, 0)); for (int i=0; i<6; i++) { mesh_src.rotate(60, Vec3(0, 0, 1)); mesh_dst += mesh_src; } mesh_dst.stl_write("transformed_dragons.stl"); } src dst