Skip to content

Commit 31419f3

Browse files
update to docs with 3d-bits tutorials
1 parent 176d639 commit 31419f3

20 files changed

+793
-8
lines changed

docs/learn/3d-bits/intro.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
sidebar_position: 1
23
title: "3D Bits: Enhance Your Shopify Store with 3D Product Visualization"
34
sidebar_label: Intro
45
description: Discover "3D Bits," our Shopify app designed to bring interactive 3D product configurators and visualization to your e-commerce store.

docs/learn/3d-bits/theme-app-extensions/bitbybit-preview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
sidebar_position: 1
23
title: "BITBYBIT PREVIEW Block for Shopify's '3D Bits' App"
34
sidebar_label: BITBYBIT PREVIEW
45
description: Learn how to use the BITBYBIT PREVIEW theme app extension block in Shopify's "3D Bits" app to embed publicly available Bitbybit project scripts into your product pages.

docs/learn/3d-bits/theme-app-extensions/bitbybit-runner.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
sidebar_position: 2
23
title: "BITBYBIT RUNNER Block for Shopify's '3D Bits' App"
34
sidebar_label: BITBYBIT RUNNER
45
description: Learn how to use the BITBYBIT RUNNER theme app extension block in Shopify's "3D Bits" app to integrate parametric 3D models and interactive scripts from Bitbybit into your product pages.

docs/learn/3d-bits/theme-app-extensions/bitbybit-viewer.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
sidebar_position: 3
23
title: "BITBYBIT VIEWER Block for Shopify's '3D Bits' App"
34
sidebar_label: BITBYBIT VIEWER
45
description: Learn how to use the BITBYBIT VIEWER theme app extension block in Shopify's "3D Bits" app to display static 3D models and configure complex scenes on your product pages without coding.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
sidebar_position: 1
3+
title: "Tutorials for Shopify '3D Bits' E-Commerce App"
4+
sidebar_label: Shopify App Tutorials
5+
description: Get started with the "3D Bits" Shopify app through our series of video tutorials, covering installation, setup, 3D model linking, and custom model creation.
6+
tags: [shopify, 3d-bits]
7+
---
8+
9+
# Tutorials for the "3D Bits" Shopify E-Commerce App
10+
11+
## What Will You Learn?
12+
13+
We have prepared a series of video tutorials designed to help you get started and make the most of our **"3D Bits" E-Commerce app for Shopify**.
14+
15+
In these tutorials, Matas Ubarevičius will:
16+
* Introduce himself and the Bitbybit platform.
17+
* Guide you through the process of installing the "3D Bits" app and subscribing.
18+
* Use practical examples on our [demo store](https://bitbybit-dev-3d-configurators.myshopify.com) (password: `3d-bits-demo`) to show you how to:
19+
* Link 3D models to your Shopify product forms and variants.
20+
* Create custom 3D models and interactive experiences for your products.
21+
22+
We hope that by following these tutorials, you will not only gain a better understanding of our "3D Bits" app and the Bitbybit platform but also develop a deeper insight into the exciting possibilities of 3D E-Commerce in general.
23+
24+
## Quick Introduction Video
25+
26+
For a fast overview of what "3D Bits" can do, check out this introductory video:
27+
28+
<div class="responsive-video-container">
29+
<iframe
30+
width="560"
31+
height="315"
32+
src="https://www.youtube.com/embed/9l7run2qy0Q?si=j8uSScxl6ncJaX81"
33+
title="3D Bits App For Shopify Fast Introduction"
34+
frameborder="0"
35+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
36+
allowfullscreen>
37+
</iframe>
38+
</div>
39+
40+
Dive into the individual tutorial pages listed in this section to learn specific aspects of using the "3D Bits" app and Bitbybit to create stunning 3D product experiences for your Shopify store!
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
sidebar_position: 8
3+
title: "Tutorial: Using BITBYBIT PREVIEW with a 3D Scanned Product"
4+
sidebar_label: PREVIEW with 3D Scan
5+
description: Learn how to use the BITBYBIT PREVIEW block in Shopify's "3D Bits" app to embed a Bitbybit project featuring a 3D scanned product onto your e-commerce store.
6+
slug: /shopify/tutorials/preview-3d-scan # Or adjust as needed
7+
tags: [shopify, 3d-bits]
8+
---
9+
10+
# Using BITBYBIT PREVIEW With a 3D Scanned Product
11+
12+
## What's Inside This Tutorial?
13+
14+
The **BITBYBIT PREVIEW** theme app extension block, part of our "3D Bits" Shopify app, allows you to embed **publicly available Bitbybit projects** directly onto your Shopify product pages. While these embedded 3D experiences generally cannot be configured by Shopify product variants in the same dynamic way as with the [RUNNER](/shopify/3d-bits-app/bitbybit-runner) or [VIEWER](/shopify/3d-bits-app/bitbybit-viewer) (with Scene Config JSON) blocks, they are excellent for showcasing rich, unique, and interactive 3D product presentations, including those featuring **3D scanned products**.
15+
16+
This tutorial, led by Matas Ubarevičius, will guide you through:
17+
* Setting up a Shopify product template to use the BITBYBIT PREVIEW block.
18+
* Understanding and configuring the necessary product metafields, specifically the "3D Bits Model Url."
19+
* Locating the correct "preview URL" for your scripts on the Bitbybit platform.
20+
* Linking this preview URL to your Shopify product to display your 3D scanned model or interactive scene.
21+
22+
**Prerequisites:**
23+
* It's assumed you have already installed the "3D Bits" app in your Shopify store.
24+
* You have a Bitbybit project (containing your 3D scanned model or a scene using it) that is **published as "Public."**
25+
26+
## Video Tutorial: BITBYBIT PREVIEW Block with 3D Scans
27+
28+
Watch this step-by-step guide on how to configure and use the BITBYBIT PREVIEW block:
29+
30+
<div class="responsive-video-container">
31+
<iframe
32+
width="560"
33+
height="315"
34+
src="https://www.youtube.com/embed/xU5seV1NQ5o"
35+
title="Tutorial: Using 3D Bits App For Shopify With BITBYBIT PREVIEW Theme App Extension Block for 3D Scans"
36+
frameborder="0"
37+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
38+
allowfullscreen>
39+
</iframe>
40+
</div>
41+
42+
By following this tutorial, you'll learn how to effectively leverage the BITBYBIT PREVIEW block to integrate compelling 3D scanned product experiences from Bitbybit into your Shopify store, providing your customers with an engaging way to explore your products.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
sidebar_position: 3
3+
title: "Tutorial: Using a 3D Bike Scan as a Shopify Product with '3D Bits'"
4+
sidebar_label: Product - Bike 3D Scan
5+
description: Learn how to 3D scan a bike, process the scan, upload it to Shopify, and display it as an interactive 3D product using the "3D Bits" app.
6+
tags: [shopify, 3d-bits]
7+
---
8+
9+
# Tutorial: Using a 3D Bike Scan as a Shopify Product
10+
11+
## What's Inside This Tutorial?
12+
13+
In this tutorial, you will learn the complete workflow for incorporating a 3D scan of a bike into your Shopify store as an interactive product. This example focuses on a straightforward yet highly effective use case for 3D in e-commerce.
14+
15+
We will cover:
16+
* **3D Scanning the Bike:** Tips and considerations for capturing the bike.
17+
* **Editing and Processing the Scan:** Basic steps to refine the raw 3D scan data.
18+
* **Uploading to Shopify CDN:** How to get your processed 3D model onto Shopify's Content Delivery Network.
19+
* **Exposing as a Product with "3D Bits":** Using our "3D Bits" app (likely the [BITBYBIT VIEWER block](/shopify/3d-bits-app/bitbybit-viewer)) to display the 3D scan on your product page.
20+
21+
By the end of this tutorial, you'll be able to showcase a detailed, interactive 3D model of a bike (or similar product) in your Shopify store.
22+
23+
**View the Demo:**
24+
* Check out the live example on our [Demo Store: Bike 3D Scan Product Page](https://bitbybit-dev-3d-configurators.myshopify.com/products/3d-bike-scan).
25+
* Demo store password: `3d-bits-demo`
26+
27+
![A screenshot of the 3D scanned bike model as it appears in the Shopify store.](https://ik.imagekit.io/bitbybit/app/assets/start/shopify/bike.jpeg "3D Bike Scan Screenshot")
28+
*3D Bike Scan Example*
29+
30+
## Video Tutorial: Working with 3D Scans (Gaussian Splatting)
31+
32+
This video provides insights into working with 3D scans, particularly focusing on techniques like Gaussian Splatting, which can produce high-quality results.
33+
34+
<div class="responsive-video-container">
35+
<iframe
36+
width="560"
37+
height="315"
38+
src="https://www.youtube.com/embed/f3rBNesXD1s?si=RXy1E2knDpdIm6Cz"
39+
title="Working with Gaussian Splatting 3D Scans for E-Commerce"
40+
frameborder="0"
41+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
42+
allowfullscreen>
43+
</iframe>
44+
</div>
45+
46+
## Download the 3D Bike Scan Model
47+
48+
You can download the finished 3D bike scan model (in `.splat` format, suitable for Gaussian Splatting viewers) used in this tutorial to follow along or inspect:
49+
* [Download Bike 3D Scan (`bike.splat`)](https://cdn.shopify.com/s/files/1/0658/9497/3626/files/bike.splat?v=1721764320)
50+
51+
Follow the steps in the video and our documentation for the "3D Bits" app to integrate this or your own 3D scans into your Shopify product pages.

docs/learn/3d-bits/tutorials/product-customizable-text.mdx

Lines changed: 163 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
sidebar_position: 12
3+
title: "Tutorial: Building a 3D Laptop Holder Configurator for Shopify (TypeScript)"
4+
sidebar_label: Product - Laptop Holder (TS)
5+
description: Learn to create a 3D laptop holder configurator for Shopify using TypeScript on Bitbybit, driven by multiple product variants and integrated with the "3D Bits" app.
6+
tags: [shopify, 3d-bits]
7+
---
8+
9+
import Tabs from '@theme/Tabs';
10+
import TabItem from '@theme/TabItem';
11+
import BitByBitRenderCanvas from '@site/src/components/BitByBitRenderCanvas';
12+
13+
# Tutorial: Building a 3D Laptop Holder Configurator for Shopify (TypeScript)
14+
15+
## What You Will Learn: Multi-Variant 3D Configuration
16+
17+
This tutorial demonstrates how to create a more complex **3D configurable product**—a laptop holder—and drive its appearance and features using **three distinct sets of Shopify product variants**. The core logic for the laptop holder will be developed using **TypeScript** on the Bitbybit platform.
18+
19+
You will learn how to:
20+
* Structure a TypeScript script on Bitbybit to create a parametric 3D laptop holder.
21+
* Define multiple product variants in Shopify (e.g., Laptop Type, Number of Laptops, Color).
22+
* Export your TypeScript logic using the "Export to Runner" feature.
23+
* Integrate this script into your Shopify product page using the "3D Bits" app (via [BITBYBIT RUNNER](/learn/3d-bits/theme-app-extensions/bitbybit-runner)).
24+
* Ensure your 3D model dynamically updates based on the customer's selection of these multiple variants.
25+
26+
**View the Demo:**
27+
* Check out the live example on our [Demo Store: Laptop Holder Product Page](https://bitbybit-dev-3d-configurators.myshopify.com/products/laptop-holder).
28+
* Demo store password: `3d-bits-demo`
29+
30+
![A screenshot of the 3D parametric laptop holder model as it appears in the Shopify store.](https://ik.imagekit.io/bitbybit/app/assets/start/shopify/3dlaptopholder.jpeg "3D Laptop Holder Screenshot")
31+
*3D Laptop Holder Configurator Example*
32+
33+
## Video Tutorial: Building the Laptop Holder Configurator
34+
35+
<div class="responsive-video-container">
36+
<iframe
37+
width="560"
38+
height="315"
39+
src="https://www.youtube.com/embed/_7CGezCqYrU?si=YRz9PerG67N3k_Xp"
40+
title="Building a 3D Laptop Holder Product Configurator for Shopify with TypeScript"
41+
frameborder="0"
42+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
43+
allowfullscreen>
44+
</iframe>
45+
</div>
46+
47+
## Setting Up the Laptop Holder Product Variants in Shopify
48+
49+
For this configurator, you will need to define the following product variants in your Shopify admin:
50+
51+
* **Laptop Type**
52+
* Values: `MacBook Pro 16`, `MacBook Pro 14`, `MacBook Air`
53+
* **Number Laptops** (or "Capacity")
54+
* Values: `1`, `2`, `3`
55+
* **Color**
56+
* Values: `Black`, `Blue` (or any other colors you wish to offer)
57+
58+
Your Bitbybit TypeScript script will be designed to read these variant selections and adjust the 3D model accordingly.
59+
60+
## The Bitbybit TypeScript Script
61+
62+
To save you time and provide a starting point, here is the embedded Bitbybit TypeScript script used in this tutorial for the parametric laptop holder. You can explore it here and then use the "Export to Runner" feature in the Bitbybit editor to get the JavaScript code for your Shopify `BITBYBIT RUNNER` block.
63+
64+
<BitByBitRenderCanvas
65+
requireManualStart={true}
66+
script={{"script":"Bit.mockBitbybitRunnerInputs({\n \"Laptop Type\": \"MacBook Pro 16\",\n \"Number Laptops\": \"3\",\n \"Color\": \"Black\",\n});\nconst inputs = Bit.getBitbybitRunnerInputs();\n\nconst laptops: Laptop[] = []\n\nlet laptop: Laptop;\n\nswitch (inputs[\"Laptop Type\"]) {\n case \"MacBook Pro 16\":\n laptop = {\n length: 1.63,\n width: 35.8,\n height: 24.6\n };\n break;\n case \"MacBook Pro 14\":\n laptop = {\n length: 1.57,\n width: 31.3,\n height: 22.2\n }\n break;\n case \"MacBook Air\":\n laptop = {\n length: 1.2,\n width: 30.5,\n height: 21.6\n }\n break;\n default:\n break;\n}\n\nlet flipColor = false;\nswitch (inputs[\"Color\"]) {\n case \"Blue\":\n flipColor = true;\n break;\n default:\n break;\n}\n\nconsole.log(\"laptop \", laptop);\n\nconst nrLaptops = +inputs[\"Number Laptops\"];\n\nfor (let i = 0; i < nrLaptops; i++) {\n laptops.push({ ...laptop });\n}\n\nconst whiteColor = \"#ffffff\";\nconst holderColor = \"#333333\";\n\nconst laptopLiftedHeight = 3;\nconst distanceBetweenLaptops = 1.7;\nconst exportSTEP = false;\n\nbitbybit.babylon.scene.backgroundColour({ colour: \"#bbbbbb\" });\n\nconst pointLightConf = new Bit.Inputs.BabylonScene.PointLightDto();\npointLightConf.position = [-15, 20, -5];\npointLightConf.intensity = 8000;\npointLightConf.diffuse = \"#3333ff\";\npointLightConf.radius = 0;\nbitbybit.babylon.scene.drawPointLight(pointLightConf);\n\nconst controlPoints = [\n [-12.5, 0, 0],\n [-8, 13, 0],\n [-4, 11, 0],\n [-2, 6, 0],\n [2, 6, 0],\n [4, 14, 0],\n [8, 17, 0],\n [12.5, 0, 0]\n] as Bit.Inputs.Base.Point3[];\n\nlet laptopStand;\nlet laptopStandMesh;\n\nconst laptopsFilletsMesh = [];\n\nasync function start() {\n const ground = await bitbybit.occt.shapes.face.createCircleFace({ center: [0, 0, 0], direction: [0, 1, 0], radius: 75, });\n const groundOptions = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n groundOptions.faceColour = whiteColor;\n groundOptions.drawEdges = false;\n await bitbybit.draw.drawAnyAsync({ entity: ground, options: groundOptions });\n\n const renderLaptops = async (laptops) => {\n\n laptops.forEach(laptop => {\n laptop.center = [0, laptop.height / 2 + laptopLiftedHeight, 0] as Bit.Inputs.Base.Point3;\n });\n\n let laptopFillets = [];\n let totalDistance = 0;\n let previousLaptopLength = 0;\n\n laptops.forEach(async (laptop, index) => {\n totalDistance += distanceBetweenLaptops + laptop.length / 2 + previousLaptopLength / 2;\n previousLaptopLength = laptop.length;\n laptop.center[2] = totalDistance;\n const laptopBaseModel = await bitbybit.occt.shapes.solid.createBox({\n width: laptop.width,\n length: laptop.length,\n height: laptop.height,\n center: laptop.center\n });\n const laptopFillet = await bitbybit.occt.fillets.filletEdges({ shape: laptopBaseModel, indexes: undefined, radius: 0.2 });\n laptopFillets.push(laptopFillet);\n\n const laptopVisModel = await bitbybit.occt.shapes.solid.createBox({\n width: laptop.width,\n length: laptop.length - 0.01,\n height: laptop.height,\n center: laptop.center\n });\n const laptopVisFillet = await bitbybit.occt.fillets.filletEdges({ shape: laptopVisModel, indexes: undefined, radius: 0.2 });\n laptopFillets.push(laptopFillet);\n\n const di = new Bit.Inputs.Draw.DrawOcctShapeOptions();\n\n di.faceOpacity = 0.2;\n di.edgeWidth = 5;\n di.edgeOpacity = 0.6;\n di.edgeColour = whiteColor;\n di.faceColour = whiteColor;\n const laptopFilletMesh = await bitbybit.draw.drawAnyAsync({ entity: laptopVisFillet, options: di });\n laptopsFilletsMesh.push(laptopFilletMesh);\n })\n\n const polygonWire = await bitbybit.occt.shapes.wire.createPolygonWire({\n points: controlPoints\n });\n const extrusion = await bitbybit.occt.operations.extrude({\n shape: polygonWire, direction: [0, 0, totalDistance += distanceBetweenLaptops + previousLaptopLength / 2]\n });\n const laptopStandFillet = await bitbybit.occt.fillets.filletEdges({ shape: extrusion, indexes: undefined, radius: 1 });\n const laptopStandThick = await bitbybit.occt.operations.makeThickSolidSimple({ shape: laptopStandFillet, offset: -0.5 });\n\n laptopStand = await bitbybit.occt.booleans.difference({ shape: laptopStandThick, shapes: laptopFillets, keepEdges: false });\n const li = new Bit.Inputs.OCCT.DrawShapeDto(laptopStand);\n li.faceOpacity = 1;\n if (flipColor) {\n li.faceColour = \"#0000ff\";\n li.edgeColour = whiteColor;\n } else {\n li.faceColour = holderColor;\n li.edgeColour = whiteColor;\n }\n li.edgeWidth = 5;\n laptopStandMesh = await bitbybit.draw.drawAnyAsync({ entity: laptopStand, options: li });\n const laptopsMeshes = await Promise.all(laptopsFilletsMesh);\n return [laptopStandMesh, ...laptopsMeshes];\n }\n\n const meshes = await renderLaptops(laptops);\n return { meshes };\n}\n\nclass Laptop {\n width: number;\n length: number;\n height: number;\n center?: Bit.Inputs.Base.Point3;\n}\n\nBit.setBitbybitRunnerResult(start());","version":"0.20.3","type":"typescript"}}
67+
title="Bitbybit Rete Editor - 3D Laptop Holder"
68+
description="3D Laptop holder configurator"
69+
/>
70+
71+
## Why TypeScript for This Example?
72+
73+
You might notice this example opts for TypeScript rather than one of our visual editors like Rete or Blockly.
74+
**TypeScript** offers the most robust and flexible environment for creating complex configurators because:
75+
* **Full Language Power:** You can leverage the full capabilities of the TypeScript programming language, including complex logic, data structures, and software design patterns.
76+
* **Direct BabylonJS Access:** It provides direct access to all features of the underlying BabylonJS game engine core, allowing for highly customized rendering, animations, and interactions.
77+
* **Scalability:** For intricate products with many parameters and conditional behaviors, TypeScript often provides a more scalable and maintainable solution.
78+
79+
This example showcases how TypeScript can be effectively integrated into Shopify as a configurable 3D product using the Bitbybit Runner.
80+
81+
---
82+
83+
By following this tutorial, you'll gain insight into building sophisticated 3D product configurators driven by multiple Shopify variants, utilizing the power of TypeScript and the Bitbybit platform. Remember to adapt the provided `index.html` and `script.js` (from previous tutorials) by replacing the placeholder exported script function with the actual JavaScript code generated from your TypeScript laptop holder script.

0 commit comments

Comments
 (0)