|
| 1 | +--- |
| 2 | +sidebar_position: 6 |
| 3 | +title: "From STEP to GLTF - Convert PRO CAD 3D Models For 3D Bits Shopify App" |
| 4 | +sidebar_label: Preparing GLTF Assets |
| 5 | +description: Merchants often have product files created for manufacturing in professional CAD software such as FreeCAD, Fusion 360, CATIA, SolidWorks, Rhino, and others. But preparing these precise CAD models for web configurators is not straightforward. |
| 6 | +tags: [shopify, 3d-bits] |
| 7 | +--- |
| 8 | + |
| 9 | +# FreeCAD → Blender → Khronos Compressor → 3D Bits App for Shopify |
| 10 | + |
| 11 | +## Learn how to prepare the models for web configurators |
| 12 | + |
| 13 | +Merchants often have product files created for manufacturing in professional CAD software such as FreeCAD, Fusion 360, CATIA, SolidWorks, Rhino, and others. But preparing these precise CAD models for web configurators is not straightforward. |
| 14 | + |
| 15 | +To achieve smooth performance and fast loading times, you need to: |
| 16 | + |
| 17 | +* Optimize tessellation to keep triangle counts low without losing detail. |
| 18 | +* Minimize the number of meshes - each extra mesh means an extra draw call, which can hurt frame rates. |
| 19 | +* Balance texture quality and file size so your models look great while loading quickly. |
| 20 | + |
| 21 | +That’s why it’s essential to choose an efficient workflow for converting STEP files into optimized, compressed GLTF models ready for the web. |
| 22 | + |
| 23 | +## Video Tutorial: STEP TO GLTF |
| 24 | + |
| 25 | +<div class="responsive-video-container"> |
| 26 | + <iframe |
| 27 | + width="560" |
| 28 | + height="315" |
| 29 | + src="https://www.youtube.com/embed/7mqd2FLlpcU" |
| 30 | + title="From STEP to GLTF - Convert PRO CAD 3D Models For 3D Bits Shopify App" |
| 31 | + frameborder="0" |
| 32 | + allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" |
| 33 | + allowfullscreen> |
| 34 | + </iframe> |
| 35 | +</div> |
| 36 | + |
| 37 | +In this tutorial, Matas Ubarevicius walks you through the full process of converting BREP-based geometry into lightweight, high-quality meshes: |
| 38 | + |
| 39 | +1 - Start in FreeCAD – Import your STEP file, group parts by color, and tessellate them into meshes. |
| 40 | +2 - Merge meshes so each one represents a single material. |
| 41 | +3 - Export to PLY files and bring them into Blender. |
| 42 | +4 - Apply materials in Blender, then export the model as GLTF. |
| 43 | +5 - Compress your GLTF using the Khronos Compressor web tool. |
| 44 | +6 - Upload to Shopify and import it into the 3D Bits app for seamless store integration. |
| 45 | + |
| 46 | +By the end, you’ll have a streamlined, professional workflow for showcasing interactive 3D products in your online store—fast, optimized, and visually beautiful. |
| 47 | + |
| 48 | +Thanks to [Ironside Armour](https://ironsidearmour.com) for providing the example 3D model. |
| 49 | + |
| 50 | +[Python Macro For Selecting Objects By Colour](https://forum.freecad.org/viewtopic.php?p=733311&sid=b54256709987b58056037b42fab2ed73#p733311) |
| 51 | +Author: Forum User Roy_043 |
| 52 | + |
| 53 | +```python |
| 54 | +import FreeCAD as App |
| 55 | +import FreeCADGui as Gui |
| 56 | + |
| 57 | +def getShapeColor(obj): |
| 58 | + if not hasattr(obj, "ViewObject"): |
| 59 | + return None |
| 60 | + if not hasattr(obj.ViewObject, "ShapeColor"): |
| 61 | + return None |
| 62 | + return obj.ViewObject.ShapeColor |
| 63 | + |
| 64 | +def selectByShapeColor(): |
| 65 | + doc = App.ActiveDocument |
| 66 | + if doc is None: |
| 67 | + App.Console.PrintWarning("There is no active document\n") |
| 68 | + return |
| 69 | + objs = Gui.Selection.getSelection() |
| 70 | + if len(objs) != 1: |
| 71 | + App.Console.PrintWarning("Select a single source object\n") |
| 72 | + return |
| 73 | + shape_col = getShapeColor(objs[0]) |
| 74 | + if shape_col is None: |
| 75 | + App.Console.PrintWarning("Object does not have a ShapeColor\n") |
| 76 | + return |
| 77 | + objs = [obj for obj in doc.Objects if getShapeColor(obj) == shape_col] |
| 78 | + Gui.Selection.clearSelection() |
| 79 | + for obj in objs: |
| 80 | + Gui.Selection.addSelection(obj) |
| 81 | + |
| 82 | +selectByShapeColor() |
| 83 | +``` |
0 commit comments