mirror of
https://github.com/yeicor-3d/yet-another-cad-viewer.git
synced 2025-12-19 22:24:17 +01:00
27 lines
589 B
Python
27 lines
589 B
Python
# Optional: enable logging to see what's happening
|
|
import logging
|
|
import os
|
|
|
|
from build123d import * # Also works with cadquery objects!
|
|
|
|
logging.basicConfig(level=logging.DEBUG)
|
|
|
|
from yacv_server import show, export_all # Check out other exported methods for more features!
|
|
|
|
# %%
|
|
|
|
# Create a simple object
|
|
with BuildPart() as example:
|
|
Box(10, 10, 5)
|
|
Cylinder(3, 5, mode=Mode.SUBTRACT)
|
|
|
|
# Show it in the frontend with hot-reloading
|
|
show(example)
|
|
|
|
|
|
# %%
|
|
|
|
# If running on CI, export the objects to .glb files for a static deployment
|
|
if 'CI' in os.environ:
|
|
export_all('export')
|