Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Modly FastAPI backend.
Runs locally within the Electron app to provide AI inference endpoints.
"""
import logging
from contextlib import asynccontextmanager
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
Expand All @@ -21,6 +22,13 @@ async def lifespan(app: FastAPI):
generator_registry.unload_all()


class _StatusFilter(logging.Filter):
def filter(self, record):
return "/generate/status/" not in record.getMessage()

logging.getLogger("uvicorn.access").addFilter(_StatusFilter())


app = FastAPI(
title="Modly API",
version="0.3.1",
Expand Down
6 changes: 5 additions & 1 deletion src/areas/generate/components/Viewer3D.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,15 @@ function MeshModel({ url, jobId, viewMode, onStats, onSelect }: MeshModelProps):
}
}, [url])

// Compute BVH on all geometries for fast raycasting (O(log N) vs O(N))
// Compute BVH on all geometries for fast raycasting (O(log N) vs O(N)).
// Also force DoubleSide on every material so faces with inverted normals
// (a known artifact of the flexible-dual-grid mesh decoder) are still visible.
useEffect(() => {
scene.traverse((child) => {
if (child instanceof THREE.Mesh) {
(child.geometry as any).computeBoundsTree()
const mats = Array.isArray(child.material) ? child.material : [child.material]
mats.forEach((m: THREE.Material) => { m.side = THREE.DoubleSide })
}
})
return () => {
Expand Down