Date post: | 13-Jan-2017 |
Category: |
Technology |
Upload: | windows-developer |
View: | 308 times |
Download: | 0 times |
#Build2016
Universal 3D Printing with WindowsMichael S. ScherotterPrincipal Technical EvangelistTechnical Engineering & Development@Synergist
Session code
3D Printing is Now Universal• What it enables across devices• 3D printing development scenarios• 3MF partners and opportunities• What’s coming next?
Universal Cloud Printing• Cloud Print Service• Printing from any
device using Windows, phones, and HoloLens
• Shipped to your door
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
3D Printing using 3D Builder Siemen SolidEdge- Printing STL via 3D Builder
3MF Creation and Printing using 3D Builder Adobe Photoshop (coming soon)Full-color 3MF file export and launch in 3D Builder
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);
Printing 2D Image DemoMichael Scherotter
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
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
Unity Demo
Michael Scherotter
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
Zoetrope Demo
Michael Scherotter
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}
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); }
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;
OpenJSCAD Demo
Michael Scherotter
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);
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
Leading partners• CAD• Middleware• Manufacturing
Open format• Spec: www.3mf.io
Open Source• BSD license• Parsing, file read/write
The 3MF Consortium
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
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
Hardware Partnershttps://msdn.microsoft.com/en-us/windows/hardware/mt571733.aspx
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
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
Continue your education atMicrosoft Virtual Academy online.