Skip to content

Commit 6a3a556

Browse files
new blog posts and version handling so that package.json would be the source of version nr.
1 parent c75e0ba commit 6a3a556

File tree

92 files changed

+919
-309
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+919
-309
lines changed

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# Generated files
88
.docusaurus
99
.cache-loader
10+
/static/llms.txt
1011

1112
# Misc
1213
.DS_Store

docs/blog/2024-11-08-updated-bitbybit-runners.md renamed to docs/blog/2024-11-08-updated-bitbybit-runners.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ For production applications requiring maximum reliability and control, consider
155155
<script src="https://cdn.jsdelivr.net/gh/bitbybit-dev/bitbybit-assets@<version-number-of-bitbybit>/runner/bitbybit-runner-lite-playcanvas.js"></script>
156156
```
157157

158-
**Note:** You should replace `<version-number-of-bitbybit>` with an actual version number (e.g., `0.21.1`). You can find all the official versions of Bitbybit.dev here:
158+
**Note:** You should replace `<version-number-of-bitbybit>` with an actual version number (e.g., `<Version />`). You can find all the official versions of Bitbybit.dev here:
159159
➡️ **[Bitbybit.dev GitHub Releases](https://github.com/bitbybit-dev/bitbybit/releases)**
160160

161161
### Examples of the Runners
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
slug: create-bitbybit-app-cli
3+
title: Scaffold Your 3D CAD Projects in Seconds with create-app CLI
4+
authors: [ubarevicius]
5+
tags: [threejs, babylonjs, playcanvas]
6+
image: https://ik.imagekit.io/bitbybit/app/assets/blog/create-bitbybit-app-cli/create-bitbybit-app-cli.webp
7+
---
8+
9+
![Bitbybit Create App CLI in Terminal](https://ik.imagekit.io/bitbybit/app/assets/blog/create-bitbybit-app-cli/create-bitbybit-app-cli.webp "Bitbybit Create App CLI in Terminal")
10+
11+
TLDR
12+
```bash
13+
npx @bitbybit-dev/create-app my-awesome-project
14+
```
15+
16+
Bitbybit version 0.21.1 brings a brand new developer experience to the table. Say hello to `@bitbybit-dev/create-app`, a CLI tool that lets you scaffold fully-configured 3D CAD projects in just a few seconds.
17+
18+
<!-- truncate -->
19+
20+
## The Problem We're Solving
21+
22+
Getting started with 3D CAD development on the web has traditionally involved quite a bit of setup work. You need to configure your bundler, set up TypeScript, install the right packages for your chosen 3D engine, and make sure all the geometry kernels are properly initialized. This process can easily take 30 minutes to an hour, especially if you're new to the ecosystem.
23+
24+
We wanted to change that. With our new CLI tool, you can go from zero to a working 3D CAD application in under a minute.
25+
26+
## How It Works
27+
28+
The simplest way to create a new project is to run this command in your terminal:
29+
30+
```bash
31+
npx @bitbybit-dev/create-app my-awesome-project
32+
```
33+
34+
That's it. The CLI will guide you through a quick interactive setup where you choose your preferred 3D engine. Currently, we support three popular options: Three.js for its lightweight flexibility, Babylon.js for its powerful feature set, and PlayCanvas for its fast WebGL performance.
35+
36+
If you prefer to skip the prompts, you can also specify the engine directly:
37+
38+
```bash
39+
npx @bitbybit-dev/create-app my-project --engine babylonjs
40+
```
41+
42+
## What You Get Out of the Box
43+
44+
When the scaffolding completes, you'll have a fully functional project that includes everything you need to start building. The project uses Vite as the build tool, which means incredibly fast hot module replacement during development and optimized production builds. TypeScript is configured from the start, giving you type safety and excellent editor support.
45+
46+
Most importantly, all three of our geometry kernels come pre-configured and ready to use. OCCT (OpenCascade Technology) is there for professional-grade CAD operations like fillets, chamfers, and boolean operations on solid models. JSCAD provides programmatic solid modeling capabilities that many developers find intuitive. And Manifold handles fast mesh boolean operations when you need high-performance geometry processing.
47+
48+
The generated starter code demonstrates how to use each kernel. You'll see examples of creating rounded cubes with OCCT, performing boolean differences with Manifold, and building geodesic spheres with JSCAD. This gives you a clear starting point to understand how each kernel works and when to use which one.
49+
50+
## The Development Workflow
51+
52+
After scaffolding your project, the workflow is straightforward. Navigate into your project folder, install the dependencies, and start the development server:
53+
54+
```bash
55+
cd my-awesome-project
56+
npm install
57+
npm run dev
58+
```
59+
60+
Your browser will open with a live preview of your 3D scene on `http://localhost:5173`. Make changes to the code, and they appear instantly thanks to Vite's hot reload. When you're ready to deploy, a simple `npm run build` creates an optimized production bundle.
61+
62+
## Choose Your Engine
63+
64+
Each supported 3D engine has its own strengths. Three.js is an excellent choice if you want a lightweight library with a massive community and countless examples online. It's particularly good for creative coding and visualization projects.
65+
66+
Babylon.js shines when you need a complete game engine with built-in support for physics, shadows, post-processing effects, and complex scene management. If you're building something that needs to feel like a polished application or game, Babylon.js has you covered.
67+
68+
PlayCanvas offers a fast and lightweight approach to WebGL development. It's designed for performance and works well for projects where load time and runtime speed are critical concerns.
69+
70+
No matter which engine you choose, the Bitbybit geometry kernels work with all of them. You can create complex CAD geometry with OCCT and render it beautifully in any of these engines.
71+
72+
## Why This Matters
73+
74+
We believe that the future of CAD and 3D design is on the web. Browser-based tools are accessible to everyone, require no installation, and can run on virtually any device. But building these tools has been harder than it should be.
75+
76+
With `@bitbybit-dev/create-app`, we're lowering the barrier to entry significantly. Whether you're a seasoned developer exploring CAD programming or a designer wanting to prototype ideas in code, you can now get started in seconds rather than hours.
77+
78+
The CLI is open source and available as part of the Bitbybit monorepo on GitHub. We welcome contributions, feedback, and feature requests from the community.
79+
80+
## Get Started Today
81+
82+
Ready to try it out? Open your terminal and run:
83+
84+
```bash
85+
npm init @bitbybit-dev/app my-first-cad-app
86+
```
87+
88+
If you build something cool, we'd love to see it. Share your projects with us on Discord or tag us on social media. And if you find Bitbybit valuable for your work, consider supporting the project with a Silver or Gold subscription at [bitbybit.dev/auth/pick-plan](https://bitbybit.dev/auth/pick-plan).
89+
90+
Happy coding!
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
slug: ai-prompt-contexts
3+
title: AI Prompt Contexts - Teaching Your AI Assistant to Code with Bitbybit
4+
authors: [ubarevicius]
5+
tags: [ai, babylonjs, threejs, playcanvas]
6+
image: https://ik.imagekit.io/bitbybit/app/assets/blog/ai-prompt-contexts/ai-prompt-contexts.webp
7+
---
8+
9+
![AI Prompt Contexts for Bitbybit](https://ik.imagekit.io/bitbybit/app/assets/blog/ai-prompt-contexts/ai-prompt-contexts.webp "AI Prompt Contexts for Bitbybit")
10+
11+
Modern AI assistants like Claude, Gemini, Grok or ChatGPT or are remarkably capable at writing code. However, they can struggle with specialized libraries and APIs they weren't extensively trained on. That's where AI Prompt Contexts come in - specially crafted documentation files that give your AI assistant deep knowledge of the Bitbybit API.
12+
13+
<!-- truncate -->
14+
15+
## What Are AI Prompt Contexts?
16+
17+
An AI Prompt Context is a markdown file designed to be attached to conversations with AI coding assistants. When you provide this context file, the AI gains comprehensive knowledge about Bitbybit's API, coding patterns, best practices, and integration approaches. Think of it as giving your AI assistant a complete reference manual it can consult while helping you write code.
18+
19+
We've structured these context files specifically for AI consumption. They include clear role definitions that tell the AI how to behave, complete API references with all available functions and their parameters, code examples demonstrating correct usage patterns, and decision trees that help the AI recommend the right approach based on your experience level.
20+
21+
## Choosing the Right Context
22+
23+
We offer several context variants, and understanding their differences will help you pick the right one for your needs.
24+
25+
### Engine-Specific Contexts
26+
27+
Each context file is tailored to a specific 3D rendering engine. If you're building with Babylon.js, download the BabylonJS context. Building with Three.js? Grab the ThreeJS variant. Working with PlayCanvas? There's a context file for that too. The engine-specific details matter because initialization patterns, scene management, and rendering APIs differ between engines.
28+
29+
### Full vs Lite Versions
30+
31+
This is where the real choice comes in. For each engine, we provide two versions: Full and Lite.
32+
33+
**Full contexts** contain everything an AI needs to help you from scratch. They include extensive explanations of what Bitbybit is, how to set up projects, integration guides for both NPM packages and browser-based runners, best practices for performance, scene setup recommendations, and the complete API reference with detailed descriptions. If you're new to Bitbybit or want your AI to provide comprehensive guidance, the Full context is your friend.
34+
35+
**Lite contexts** strip away the explanations and focus purely on API definitions. They contain the same complete API reference but use a compressed notation to minimize token usage. This approach has a specific use case: when you already understand Bitbybit well and want to set up your own custom coding rules. You might have your own project setup preferences, your own coding style guide, or specific patterns you want the AI to follow. The Lite context gives you concise API definitions to include alongside your custom instructions.
36+
37+
### Monaco Editor Context
38+
39+
We also provide a special context for users of our online Monaco TypeScript editor at [bitbybit.dev](https://bitbybit.dev/app?editor=typescript). This context is simpler because it focuses only on what you need when coding in the browser-based editor. It explains the pre-initialized global variables available in that environment and the specific patterns required for that context. If you're just getting started with Bitbybit and want to experiment in our online editor, this beginner-friendly context is the perfect starting point.
40+
41+
## Understanding the Lite Context Format
42+
43+
The Lite contexts use an important technique to reduce file size: a translation dictionary. This is something your AI must understand to generate correct code.
44+
45+
At the beginning of the API section, you'll find a dictionary that maps abbreviated terms to their full names. For example, `OC` means `OCCT`, `sp` means `shape`, `sd` means `solid`, and `cr` means `create`. The API definitions throughout the document use these abbreviations to stay compact.
46+
47+
Here's the critical part: **the AI must translate these abbreviations back to full names when generating code**. We explicitly instruct the AI about this requirement in the context file. When the AI sees something like `bitbybit.oc.sh.sd.crBox(op: BoxD)` in the documentation, it should generate `bitbybit.occt.shapes.solid.createBox(boxOptions: BoxDto)` for you. The abbreviated forms are only for documentation - they would not compile if used directly in code.
48+
49+
This translation system allows us to provide complete API coverage while keeping token counts reasonable. The AI handles the translation transparently, so you receive clean, readable code. If your AI agent is not able to translate these values - code will not work. If that happens - you should probably look for a better AI.
50+
51+
## How to Use These Contexts
52+
53+
Using a prompt context is straightforward. Download the appropriate markdown file from our homepage at bitbybit.dev, then attach it to your conversation with your AI assistant. Most modern AI interfaces support file attachments - simply drag and drop the file or use the attachment button.
54+
55+
Once attached, you can start asking questions like "Create a parametric table with adjustable legs" or "Show me how to create a filleted box and export it as STEP." The AI should reference the context to generate accurate, working code that follows our recommended patterns.
56+
57+
For the best experience, we recommend combining a Lite context with our Context7 MCP Server. The MCP server provides live access to our full documentation and stays current with the latest changes. The Lite context ensures the AI knows the precise API signatures. Together, they create a powerful coding assistant that understands both the big picture and the fine details.
58+
59+
## Where to Download
60+
61+
You'll find all context files on our homepage at [bitbybit.dev](https://bitbybit.dev). Scroll to the "Code with AI" section where you'll see download buttons for each engine and version. The page displays token counts for each file so you can gauge context window usage.
62+
63+
Here are direct links to download each context file:
64+
65+
**For Beginners (Monaco Editor)**
66+
- <VersionLink href="https://app.bitbybit.dev/assets/ai-prompt-context/v{version}/bitbybit-babylon-monaco-ai-context-v{version}.md">Monaco Editor Context</VersionLink> (~116k tokens)
67+
68+
**BabylonJS**
69+
- <VersionLink href="https://app.bitbybit.dev/assets/ai-prompt-context/v{version}/bitbybit-babylon-ai-context-v{version}.md">Full Context</VersionLink> (~116k tokens)
70+
- <VersionLink href="https://app.bitbybit.dev/assets/ai-prompt-context/v{version}/bitbybit-babylon-no-comment-min-ai-v{version}.md">Lite Context</VersionLink> (~114k tokens)
71+
72+
**ThreeJS**
73+
- <VersionLink href="https://app.bitbybit.dev/assets/ai-prompt-context/v{version}/bitbybit-three-ai-context-v{version}.md">Full Context</VersionLink> (~95k tokens)
74+
- <VersionLink href="https://app.bitbybit.dev/assets/ai-prompt-context/v{version}/bitbybit-three-no-comment-min-ai-v{version}.md">Lite Context</VersionLink> (~82k tokens)
75+
76+
**PlayCanvas**
77+
- <VersionLink href="https://app.bitbybit.dev/assets/ai-prompt-context/v{version}/bitbybit-playcanvas-ai-context-v{version}.md">Full Context</VersionLink> (~94k tokens)
78+
- <VersionLink href="https://app.bitbybit.dev/assets/ai-prompt-context/v{version}/bitbybit-playcanvas-no-comment-min-ai-v{version}.md">Lite Context</VersionLink> (~82k tokens)
79+
80+
## Getting the Most from AI-Assisted Coding
81+
82+
A few tips will help you work more effectively with AI and these contexts. First, be specific about what you want to build. Instead of asking for "a shape," describe "a rounded rectangular table top with four cylindrical legs." The more detail you provide, the more useful the generated code will be.
83+
84+
Second, mention your experience level. The contexts include decision trees that help the AI adapt its responses. If you're new to web development, the AI can scaffold complete applications for you. If you're an experienced developer, it can focus on just the API calls you need.
85+
86+
Third, iterate on the generated code. AI assistants are collaborative tools. If the first attempt isn't quite right, explain what you'd like changed. The AI can refine its suggestions based on your feedback while staying consistent with the Bitbybit API.
87+
88+
## The Future of AI-Assisted CAD
89+
90+
We believe AI assistants will become increasingly important tools for developers working with 3D and CAD applications. These prompt contexts represent our commitment to making Bitbybit as accessible as possible. Whether you're prototyping ideas quickly or building production applications, having an AI that truly understands our API makes the development process smoother and more enjoyable.
91+
92+
The contexts are updated with each Bitbybit release to match the latest API. When you see a new version available, download the updated context to ensure your AI has the most current information.
93+
94+
Happy building with AI at your side!

docs/blog/tags.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ fitness-equipment:
4949
description: Blog posts about fitness equipment industry and 3D visualization
5050

5151
babylonjs:
52-
label: babylonjs
52+
label: BabylonJS
5353
permalink: /babylonjs
5454
description: Blog posts about Babylon.js 3D engine
5555

5656
threejs:
57-
label: threejs
57+
label: ThreeJS
5858
permalink: /threejs
5959
description: Blog posts about Three.js 3D library
6060

docs/docusaurus.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import { themes as prismThemes } from "prism-react-renderer";
22
import type { Config } from "@docusaurus/types";
33
import type * as Preset from "@docusaurus/preset-classic";
4+
import packageJson from "./package.json";
45

56
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
67

78
const config: Config = {
9+
customFields: {
10+
bitbybitVersion: packageJson.version,
11+
},
812
title: "Bitbybit",
913
tagline: "Learn How To Use The Platform",
1014
favicon: "img/logo-gold-small.png",

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

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)