3D Modeling and Printing
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
You can manipulate 3D data via Python
Script Modeling
‣ You ca n c rea te 3D model e ven if you
a re n ot fa m i l i a r with 3DCG/CAD
s oft wa re
‣ You ca n c rea te shapes that are
d iff i cu l t fo r h a n d creation
‣ M odi f yi n g s h a p e i s easy
Script Modeling
‣ You ca n c rea te 3D model e ven if you
a re n ot fa m i l i a r with 3DCG/CAD
s oft wa re
‣ You ca n c rea te shapes that are
d iff i cu l t fo r h a n d creation
‣ M odi f yi n g s h a p e i s easy
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
https://flic.kr/p/aA2u7C CC BY-SA 2.0
https://www.myminifactory.com/object/5943
https://www.youtube.com/watch?v=z1OSXnCG-jk
http://afinia.com/3d-printers/h480/
Afinia H480 Bed Size
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.
Convert 3D model Transport blocks
into Blocks into Minecraft
Converting Transporting
Converting
before after
Level of Conversion
Transporting
blender Spigot
add-on plugin
TCP Raspberry
mcpi
Juice
• Use mcpi (python module
• Spigot=Minecraft mod server
for minecraft) module
• Raspberry Juice is plugin for
Spigot
(^o^) Success!!
Y^Y^Y^Y^Y^Y^Y
Floating Faces!!
You can live in your face!!
3D Printed Result
Github
• b2mine
‣ 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
• Install via pip command
$ pip install openpyscad
OpenPySCAD
• Union operation
Cube([20, 10, 10]) + Cube([10, 20, 10])
union(){
cube([20, 10, 10])
cube([10, 20, 10])
};
OpenPySCAD
• Difference operation
Cube([20, 10, 10]) - Cube([10, 20, 10])
difference(){
cube([20, 10, 10])
cube([10, 20, 10])
};
OpenPySCAD
• Rotation
c1 = Cube([20, 10, 10])
c1.rotate([0, 0, 45])
rotate([0, 0, 45]){
cube([20, 10, 10])
};
Conclusion
Script Modeling is FUN!!
Script Modeling
•
is FUN!!
Let's start tody
Let’s start today
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