Build2016 - P459 - Universal 3D Printing with Windows

28
#Build2016 Universal 3D Printing with Windows Michael S. Scherotter Principal Technical Evangelist Technical Engineering & Development @Synergist Session code

Transcript of Build2016 - P459 - Universal 3D Printing with Windows

Page 1: Build2016 - P459 - Universal 3D Printing with Windows

#Build2016

Universal 3D Printing with WindowsMichael S. ScherotterPrincipal Technical EvangelistTechnical Engineering & Development@Synergist

Session code

Page 2: Build2016 - P459 - Universal 3D Printing with Windows

3D Printing is Now Universal• What it enables across devices• 3D printing development scenarios• 3MF partners and opportunities• What’s coming next?

Page 3: Build2016 - P459 - Universal 3D Printing with Windows
Page 4: Build2016 - P459 - Universal 3D Printing with Windows

Universal Cloud Printing• Cloud Print Service• Printing from any

device using Windows, phones, and HoloLens

• Shipped to your door

Page 5: Build2016 - P459 - Universal 3D Printing with Windows

Windows 3D Printing API Scenarios

Printing Existing Models• Printing game pieces• Printing game

characters• Printing objects to

support your app

Generating and Printing New Models• Printing avatars and user

characters• Customizing prints• Printing new designs• Trophies and achievements

Add value to your app or a game with 3D printing

Page 6: Build2016 - P459 - Universal 3D Printing with Windows

3D Printing using 3D Builder Siemen SolidEdge- Printing STL via 3D Builder

Page 7: Build2016 - P459 - Universal 3D Printing with Windows

3MF Creation and Printing using 3D Builder Adobe Photoshop (coming soon)Full-color 3MF file export and launch in 3D Builder

Page 8: Build2016 - P459 - Universal 3D Printing with Windows

3D Printing using 3D Builder (C#)// Create a file to store the stream (STL, OBJ, PLY, WRL, 3MF)StorageFolder localFolder = ApplicationData.Current.LocalFolder;

var outputfile = await localFolder.GetFileAsync("output.stl”);

var options = new Windows.System.LauncherOptions();

// Set 3d Builder as the target appoptions.TargetApplicationPackageFamilyName = "Microsoft.3DBuilder_8wekyb3d8bbwe";

// Launch 3d Builder with the 3MF or STL file generated from your appvar success = await Windows.System.Launcher.LaunchFileAsync(outputfile, options);

Page 9: Build2016 - P459 - Universal 3D Printing with Windows

Printing 2D Image DemoMichael Scherotter

Page 10: Build2016 - P459 - Universal 3D Printing with Windows

3D Printing using 2D Images (C#)// Create a file to store the streamStorageFolder localFolder = ApplicationData.Current.LocalFolder;

// any image file: .png, .jpg, .tgavar outputfile = await localFolder.GetFileAsync(“Neon Hitch.png");

var options = new Windows.System.LauncherOptions();

// Set 3d Builder as the target appoptions.TargetApplicationPackageFamilyName = "Microsoft.3DBuilder_8wekyb3d8bbwe";

// Launch 3d Builder with any 2D imagevar success = await Windows.System.Launcher.LaunchFileAsync(outputfile, options);

https://github.com/mscherotter/Print3DUWPDemo

Page 11: Build2016 - P459 - Universal 3D Printing with Windows

An entire WinRT API surface dedicated to 3d printing: Windows.Graphics.Printing3D

WinRT APIs can be called by UWP apps and desktop apps

The entire Windows.Graphics.Printing3D API namespace is truly Universal for 3d printing across all devices

Streamline 3D printing experience in your app

Windows 3D Printing API

Page 12: Build2016 - P459 - Universal 3D Printing with Windows

Unity Demo

Michael Scherotter

Page 13: Build2016 - P459 - Universal 3D Printing with Windows

Generate a 3D Model from a Unity GameObject1. Save Model in 3D builder to .obj format2. Import .obj asset into Unity as a model3. Add model to scene as GameObject4. Add Print Behavior from GitHub Windows Samples to

a GameObject5. Set the Print.ObjectToPrint property to the imported

model6. Customize the UI and Game mechanics7. Build for Windows 10 UWP

https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/3DPrintingFromUnity

Page 14: Build2016 - P459 - Universal 3D Printing with Windows

Zoetrope Demo

Michael Scherotter

Page 15: Build2016 - P459 - Universal 3D Printing with Windows
Page 16: Build2016 - P459 - Universal 3D Printing with Windows

Printing Existing Models (C#)1. Create a Printing3D3MFPackage using a

IRandomAccessStreamvar uri = new Uri("ms-appx:///zoetrope.3mf");

var file = await StorageFile.GetFileFromApplicationUriAsync(uri);

using (var stream = await file OpenReadAsync()){ _package = Windows.Graphics.Printing3D.Printing3D3MFPackage.LoadAsync(stream);

// at this point _package.Thumbnail.TextureData has a thumbnail image you // can use in your app}

Page 17: Build2016 - P459 - Universal 3D Printing with Windows

Printing Existing Models (C#)2. Register the Print3DTaskRequested callback that provides the 3MF package to the Print ecosystem.Print3DManager.GetForCurrentView().TaskRequested += MainPage_TaskRequested;

private async void MainPage_TaskRequested(Print3DManager sender, Print3DTaskRequestedEventArgs args) { // setup the sourceHandler    Print3DTaskSourceRequestedHandler sourceHandler = delegate (Print3DTaskSourceRequestedArgs sourceRequestedArgs)            { // Set the package

sourceRequestedArgs.SetSource(_package);            };            // Create 3d print task            args.Request.CreateTask(“Zoetrope", "Default", sourceHandler);          }

Page 18: Build2016 - P459 - Universal 3D Printing with Windows

Printing Existing Models (C#)3. Invoke the ShowPrintUIAsync function// Launch the 3d print dialog await Print3DManager.ShowPrintUIAsync();

 4. Remove the Print3DTaskRequested callback when the dialog is launched// Remove the print task request after dialog is shownPrint3DManager.GetForCurrentView().TaskRequested -= MainPage_TaskRequested;

Page 19: Build2016 - P459 - Universal 3D Printing with Windows

OpenJSCAD Demo

Michael Scherotter

Page 20: Build2016 - P459 - Universal 3D Printing with Windows

Generate a new model via code (C#)1. Create a new Printing3DModel using

meshes and materialsvar model = new Windows.Graphics.Printing3D.Printing3DModel();

model.unit = Printing3DModelUnit.Millimeter;

var mesh = new Printing3DMesh();

// todo: load mesh with trianglesmodel.Meshes.Add(mesh);

var material = new Model3DBaseMaterialGroup(1);// todo: load materialsmodel.Material.BaseGroups.Add(material);

Page 21: Build2016 - P459 - Universal 3D Printing with Windows

Generate a new model via code (C#)2. Verify the meshes and repair the model// verify that meshes are validvar verificationResult = await mesh.verifyAsync();

// Use the new model repair API to fix any issues await model.repairAsync();

_package = new Printing3D3MFPackage();

await _package.SaveModelToPackageAsync(model);

// Now print as before…

https://github.com/mscherotter/OpenJSCAD.org

Page 22: Build2016 - P459 - Universal 3D Printing with Windows

Leading partners• CAD• Middleware• Manufacturing

Open format• Spec: www.3mf.io

Open Source• BSD license• Parsing, file read/write

The 3MF Consortium

Page 23: Build2016 - P459 - Universal 3D Printing with Windows

Extensible• Minimal core spec• XML namespaces for extensions• Materials & properties extension

supported

Unambiguous• Manifold, oriented: defined and required• Fill-rule handles self-intersection /

overlap

3MF Overview

Page 24: Build2016 - P459 - Universal 3D Printing with Windows

Complete• Open Packaging Conventions (OPC)

Compact• ZIP package• References avoid duplication

Human-readable• XML• Well-known binary formats (e.g. PNG,

JPEG)

3MF OverviewOPC Root

3D Model

Thumbnail

3D Textur

e

3D Textur

e

Spec: www.3mf.io

Page 26: Build2016 - P459 - Universal 3D Printing with Windows

Upcoming Features • More 3d built into the Shell – Outlook preview, higher quality thumbnails, right-click print, 3d print Share contract• Printer sharing and server administration• New mesh APIs make it easier to prepare models for 3d printing (simplify & cleanup models)• 3D Builder update – clean UI, new tools, drag/drop content, updated print workflow• Improved online 3d print bureau integration: access to more materials and higher quality prints

Page 27: Build2016 - P459 - Universal 3D Printing with Windows

Get Started!Get started with samples from this video

Windows.Graphics.Printing3d API documentation: https://msdn.microsoft.com/en-us/windows/hardware/bg183398

Extensive videos and tutorials: https://channel9.msdn.com/Search?term=3d%20printing#ch9Search

3MF Consortium: http://3mf.io/

http://microsoft.com/3d

[email protected]

Continue your education atMicrosoft Virtual Academy online.

Page 28: Build2016 - P459 - Universal 3D Printing with Windows