
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import ipyreact
from pathlib import Path
ipyreact.define_module("@react-three/fiber", Path("./threejs-fiber.bundle.js"))
ipyreact.define_module("@react-three/xr", Path("./react-three-xr.bundle.js"))
from traitlets import default
from glob import glob
pngs = [f"https://py.cafe/files/kecnry/ar-cube/{f[2:]}" for f in sorted(glob('./slices/*png'))]
class XRWidget(ipyreact.Widget):
_esm = Path("ar.tsx")
page = XRWidget(props={"pngs": pngs})