3d Cad API Python
3d Cad API Python
by Python
EuroPython 2016@Bilbao, Spain
2016/07/22
Takuro Wada
Hi!
Kabuku Inc. (Japanese Startup)
和 田 拓 朗 Software Engineer
Takuro Wada
Providing services
related to 3D printing
taxpon
taxpon
http://takuro.ws
What is
3D printing?
What is 3D printing?
Creating products
by forming successive layers
of material based on 3D Data
Example
https://en.wikipedia.org/wiki/3D_printing
What is required
for 3D Printing?
What is required for 3D printing?
3D Data 3D Printer
How to create
3D Data?
3D Data Example
STL(ASCII)
Definition of
Triangle (polygon)
Definition of
Triangle (polygon)
Successive
triangle
definitions
Format is so simple
But
creating 3D Data
from scratch
is so hard task
3DCG/CAD software
Many 3D software provides
Python API
Many 3D software provides
Python API
GREAT FANTASTIC
Y^Y^Y^Y^Y^Y Y^Y^Y^Y^Y^Y
Today’s software
FREE
Y^Y^Y^Y^Y^Y
Script Modeling
with Blender and Python
What is Blender?
• Developed since 1995
• Open source software, Multi platform
• Language: C, C++, Python
‣ Python is used as API interface
‣ Blender has its own python interpreter in the
software(3.5.1 in Blender2.77a)asyncio!!
Delete default Object
Add cone
-P option and script name to execute
Making Chain Project
Making Chain
15cm
15cm
Decided to create longer one
Longer one …
jumping rope…
https://flic.kr/p/5pT9iD CC BY 2.0
Connect blender and minecraft world using Python
Convert this kind of 3D data
to Minecraft Blocks!!
Implementation Overview
Consists of two main pars.
Converting Transporting
Converting
before after
Level of Conversion
Transporting
blender Spigot
add-on plugin
TCP Raspberry
mcpi
Juice
‣ https://github.com/taxpon/b2mine
Script Modeling
with OpenSCAD and Python
What is OpenSCAD?
• CAD software, Open source (GPL)
• Multi platform(Win, Mac, Linux)
• Implemented by C++(Qt)
• Create 3D model using original programming language
• No GUI to manipulate 3D data
Feature of OpenSCAD
• Very good for Software Engineer
• Written script can be kicked from command line
‣ Generate model in Server
‣ Create multiple model with command
Neck tie composed of multiple characters
Generate by 1 command
‣ You can pass arguments from command line to OpenSCAD
script
OpenPySCAD
• Generate OpenSCAD code from Python code
‣ https://github.com/taxpon/openpyscad
union(){
cube([20, 10, 10])
cube([10, 20, 10])
};
OpenPySCAD
• Difference operation
difference(){
cube([20, 10, 10])
cube([10, 20, 10])
};
OpenPySCAD
• Rotation
rotate([0, 0, 45]){
cube([20, 10, 10])
};
Conclusion
Script Modeling is FUN!!
Script Modeling
•
is FUN!!
Let's start tody
https://flic.kr/p/ef4VBP CC BY 2.0
We are Hiring!!
‣ Python Developer
‣ C++ Developer
‣ Frontend Developer
‣ Angular/React
‣ You can use 3D printer
‣ International members
‣ 3 Google Developer Experts
Engineer team
http://www.kabuku.co.jp/#jobs