3d modeling and printing by python

69
EuroPython 2016@Bilbao, Spain 2016/07/22 Takuro Wada 3D Mode l ing and Printing by Python

Upload: takuro-wada

Post on 16-Feb-2017

720 views

Category:

Engineering


0 download

TRANSCRIPT

Page 1: 3D Modeling and Printing by Python

EuroPython 2016@Bilbao, Spain

2016/07/22 Takuro Wada

3D Modeling and Printing by Python

Page 2: 3D Modeling and Printing by Python

Kabuku Inc. (Japanese Startup) Software Engineer

Providing services related to 3D printing

Takuro Wada

和 田 拓 朗

taxpon

taxpon

http://takuro.ws

Hi!

Page 3: 3D Modeling and Printing by Python

What is 3D printing?

Page 4: 3D Modeling and Printing by Python

Creating products by forming successive layers of material based on 3D Data

What is 3D printing?

Page 5: 3D Modeling and Printing by Python

Example

https://en.wikipedia.org/wiki/3D_printing

Page 6: 3D Modeling and Printing by Python

What is required for 3D Printing?

Page 7: 3D Modeling and Printing by Python

What is required for 3D printing?

3D Data 3D Printer

Page 8: 3D Modeling and Printing by Python

How to create 3D Data?

Page 9: 3D Modeling and Printing by Python

3D Data Example STL(ASCII)

Page 10: 3D Modeling and Printing by Python

Definition of Triangle (polygon)

Page 11: 3D Modeling and Printing by Python

Definition of Triangle (polygon)

Successive triangle definitions

Page 12: 3D Modeling and Printing by Python

Format is so simple

Page 13: 3D Modeling and Printing by Python

But creating 3D Data

from scratch is so hard task

Page 14: 3D Modeling and Printing by Python

3DCG/CAD software

Page 15: 3D Modeling and Printing by Python

Many 3D software provides Python API

Page 16: 3D Modeling and Printing by Python

Many 3D software provides Python API

You can manipulate 3D data via Python

Page 17: 3D Modeling and Printing by Python

Script Modeling

‣ You can create 3D model even if you are not familiar with 3DCG/CAD software

‣ You can create shapes that are difficult for hand creation

‣ Modifying shape is easy

Page 18: 3D Modeling and Printing by Python

Script Modeling

_人人人人人人人_>FANTASTIC!!<‾Y^Y^Y^Y^Y^Y‾

_人人人人人人人_> GREAT!! <‾Y^Y^Y^Y^Y^Y‾

‣ You can create 3D model even if you are not familiar with 3DCG/CAD software

‣ You can create shapes that are difficult for hand creation

‣ Modifying shape is easy

Page 19: 3D Modeling and Printing by Python

Today’s software

_人人人人人人人_> FREE!! <‾Y^Y^Y^Y^Y^Y‾

Page 20: 3D Modeling and Printing by Python

Script Modeling with Blender and Python

Page 21: 3D Modeling and Printing by 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!!

Page 22: 3D Modeling and Printing by Python

Delete default Object

Add cone

Page 23: 3D Modeling and Printing by Python

-P option and script name to execute

Page 24: 3D Modeling and Printing by Python
Page 25: 3D Modeling and Printing by Python

Making Chain Project

Making Chain

https://flic.kr/p/aA2u7C CC BY-SA 2.0

Page 27: 3D Modeling and Printing by Python

https://www.youtube.com/watch?v=z1OSXnCG-jk

Page 28: 3D Modeling and Printing by Python

http://afinia.com/3d-printers/h480/

Page 29: 3D Modeling and Printing by Python

15cm

15cm

Afinia H480 Bed Size

Page 30: 3D Modeling and Printing by Python
Page 31: 3D Modeling and Printing by Python
Page 32: 3D Modeling and Printing by Python
Page 33: 3D Modeling and Printing by Python
Page 34: 3D Modeling and Printing by Python
Page 35: 3D Modeling and Printing by Python

Decided to create longer one

jumping rope…Longer one …

https://flic.kr/p/5pT9iD CC BY 2.0

Page 36: 3D Modeling and Printing by Python
Page 37: 3D Modeling and Printing by Python
Page 38: 3D Modeling and Printing by Python
Page 39: 3D Modeling and Printing by Python
Page 40: 3D Modeling and Printing by Python
Page 41: 3D Modeling and Printing by Python

Connect blender and minecraft world using Python

Page 42: 3D Modeling and Printing by Python

Convert this kind of 3D data to Minecraft Blocks!!

Page 43: 3D Modeling and Printing by Python

Implementation Overview

Convert 3D model into Blocks

Transport blocks into Minecraft

Consists of two main pars.

Converting Transporting

Page 44: 3D Modeling and Printing by Python

before

Converting

after

Page 45: 3D Modeling and Printing by Python

Level of Conversion

Page 46: 3D Modeling and Printing by Python

blender

add-on

Transporting

Spigot

mcpi

plugin

Raspberry Juice

TCP

• Spigot=Minecraft mod server • Raspberry Juice is plugin for

Spigot

• Use mcpi (python module for minecraft) module

Page 47: 3D Modeling and Printing by Python
Page 48: 3D Modeling and Printing by Python

_人人人人人人人人_ > Success!! < ‾Y^Y^Y^Y^Y^Y^Y‾

\(^o^)/

Page 49: 3D Modeling and Printing by Python

Floating Faces!!

Page 50: 3D Modeling and Printing by Python

You can live in your face!!

Page 51: 3D Modeling and Printing by Python

3D Printed Result

Page 52: 3D Modeling and Printing by Python

Github

• b2mine

‣ https://github.com/taxpon/b2mine

Page 53: 3D Modeling and Printing by Python

Script Modeling with OpenSCAD and Python

Page 54: 3D Modeling and Printing by 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

Page 55: 3D Modeling and Printing by Python
Page 56: 3D Modeling and Printing by Python

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

Page 57: 3D Modeling and Printing by Python

Neck tie composed of multiple characters

Page 58: 3D Modeling and Printing by Python
Page 59: 3D Modeling and Printing by Python
Page 60: 3D Modeling and Printing by Python
Page 61: 3D Modeling and Printing by Python
Page 62: 3D Modeling and Printing by Python

Generate by 1 command‣ You can pass arguments from command line to OpenSCAD

script

Page 63: 3D Modeling and Printing by Python

OpenPySCAD

• Generate OpenSCAD code from Python code

‣ https://github.com/taxpon/openpyscad

• Install via pip command

$ pip install openpyscad

Page 64: 3D Modeling and Printing by Python

OpenPySCAD

• Union operation

Cube([20, 10, 10]) + Cube([10, 20, 10])

union(){ cube([20, 10, 10]) cube([10, 20, 10])};

Page 65: 3D Modeling and Printing by Python

• Difference operation

Cube([20, 10, 10]) - Cube([10, 20, 10])

difference(){ cube([20, 10, 10]) cube([10, 20, 10])};

OpenPySCAD

Page 66: 3D Modeling and Printing by Python

OpenPySCAD

• Rotation

c1 = Cube([20, 10, 10]) c1.rotate([0, 0, 45])

rotate([0, 0, 45]){ cube([20, 10, 10])};

Page 67: 3D Modeling and Printing by Python

Conclusion

Page 68: 3D Modeling and Printing by Python

Script Modeling is FUN!!

• Let's start tody

Script Modeling is FUN!!Let’s start today

https://flic.kr/p/ef4VBP CC BY 2.0

Page 69: 3D Modeling and Printing by Python

We are Hiring!!

‣ Python Developer ‣ C++ Developer ‣ Frontend Developer

‣ Angular/React ‣ You can use 3D printer ‣ International members ‣ 3 Google Developer Experts

Engineer teamhttp://www.kabuku.co.jp/#jobs