Codex に自然言語で依頼して、build123d のモデルコードを作成するためのテンプレートです。作成したモデルは GLB・STEP・STL 形式へ出力し、ブラウザ上のビューアで確認できます。
このリポジトリは AI API を組み込んだアプリケーションではありません。リポジトリ内で Codex を起動し、作りたいモデルを依頼して使用します。モデルのソースコードも成果物として保存されるため、生成後の確認や修正が可能です。
リポジトリをクローンし、プロジェクトのルートで依存関係をインストールします。
git clone https://github.com/opvelll/codex-build123d-modeling.git
cd codex-build123d-modeling
uv sync
pnpm installCodex アプリなどでこのプロジェクトを開き、自然言語で依頼します。
依頼例:
パイプ椅子をモデリングして。
Codex はモデルごとに models/<model-id>/model.py を作成します。モデルコードは MODEL メタデータと、build123d の形状を返す build_model() 関数を公開します。
依頼後、Codexは自動でモデルを作成して、ビューワーを起動するはずです。
特定のモデルだけを生成する場合:
uv run python build_models.py pipe_chairすべてのモデルを生成する場合:
uv run python build_models.py --all生成されたファイルは output/<model-id>/ に保存され、モデル一覧は output/models.json に書き出されます。
output/pipe_chair/pipe_chair.glb
output/pipe_chair/pipe_chair.step
output/pipe_chair/pipe_chair.stl
output/models.json
開発サーバーを起動します。
pnpm devブラウザで http://127.0.0.1:4173/viewer.html を開いてください。ビューアは output/models.json を読み込むため、モデルを追加するたびに React の画面を編集する必要はありません。
models/
pipe_chair/
model.py # build123dのモデルソース
output/
pipe_chair/ # 生成されたGLB・STEP・STL
models.json # ビューアが読み込むモデル一覧
src/ # React・Three.js製のビューア
build_models.py # モデルの検証、出力、一覧生成
pnpm test
pnpm buildこのリポジトリは MIT License で公開します。
This repository is a template for asking Codex to create reviewable build123d model code. Models can be exported as GLB, STEP, and STL files and inspected in the browser-based viewer.
It is not an application with an embedded AI API. Open the repository in Codex and describe the model you want to create. The generated model source remains part of the project, so it can be reviewed and edited after generation.
Clone the repository and install the dependencies from the project root.
git clone https://github.com/opvelll/codex-build123d-modeling.git
cd codex-build123d-modeling
uv sync
pnpm installOpen this project in the Codex app or another Codex environment and describe the model in natural language.
Example request:
Model a pipe chair.
For each model, Codex creates models/<model-id>/model.py. The model module exposes MODEL metadata and a build_model() function that returns the build123d shape.
After the request, Codex should automatically create the model and start the viewer.
Generate one model:
uv run python build_models.py pipe_chairGenerate every model:
uv run python build_models.py --allGenerated files are written to output/<model-id>/, and the model catalog is written to output/models.json.
output/pipe_chair/pipe_chair.glb
output/pipe_chair/pipe_chair.step
output/pipe_chair/pipe_chair.stl
output/models.json
Start the development server:
pnpm devOpen http://127.0.0.1:4173/viewer.html. The viewer reads output/models.json, so adding a model does not require a model-specific React screen.
models/
pipe_chair/
model.py # Reviewable build123d model source
output/
pipe_chair/ # Generated GLB, STEP, and STL files
models.json # Model catalog read by the viewer
src/ # React and Three.js viewer
build_models.py # Model validation, export, and catalog generation
pnpm test
pnpm buildThis repository is available under the MIT License.
