diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties
index 11ec637..f9efc6e 100644
--- a/backend/src/main/resources/application.properties
+++ b/backend/src/main/resources/application.properties
@@ -13,3 +13,7 @@ pricing.machine-cost-per-hour=${MACHINE_COST_PER_HOUR:2.0}
pricing.energy-cost-per-kwh=${ENERGY_COST_PER_KWH:0.30}
pricing.printer-power-watts=${PRINTER_POWER_WATTS:150.0}
pricing.markup-percent=${MARKUP_PERCENT:20.0}
+
+# File Upload Limits
+spring.servlet.multipart.max-file-size=200MB
+spring.servlet.multipart.max-request-size=200MB
diff --git a/frontend/src/app/features/calculator/calculator-page.component.ts b/frontend/src/app/features/calculator/calculator-page.component.ts
index 20d75c9..ea22dd7 100644
--- a/frontend/src/app/features/calculator/calculator-page.component.ts
+++ b/frontend/src/app/features/calculator/calculator-page.component.ts
@@ -22,22 +22,17 @@ import { QuoteEstimatorService, QuoteRequest, QuoteResult } from './services/quo
`,
styles: [`
@@ -53,6 +58,18 @@ import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
@keyframes spin {
to { transform: rotate(360deg); }
}
+ .dims-overlay {
+ position: absolute;
+ bottom: 8px;
+ right: 8px;
+ background: rgba(0,0,0,0.6);
+ color: white;
+ padding: 4px 8px;
+ border-radius: 4px;
+ font-size: 0.75rem;
+ font-family: monospace;
+ pointer-events: none;
+ }
`]
})
export class StlViewerComponent implements OnInit, OnDestroy, OnChanges {
@@ -125,6 +142,8 @@ export class StlViewerComponent implements OnInit, OnDestroy, OnChanges {
resizeObserver.observe(this.rendererContainer.nativeElement);
}
+ dimensions = { x: 0, y: 0, z: 0 };
+
private loadFile(file: File) {
this.loading = true;
const reader = new FileReader();
@@ -150,22 +169,33 @@ export class StlViewerComponent implements OnInit, OnDestroy, OnChanges {
geometry.computeBoundingBox();
geometry.center();
+ // Get Dimensions
+ const boundingBox = geometry.boundingBox!;
+ const size = new THREE.Vector3();
+ boundingBox.getSize(size);
+
+ this.dimensions = {
+ x: Math.round(size.x * 10) / 10,
+ y: Math.round(size.y * 10) / 10,
+ z: Math.round(size.z * 10) / 10
+ };
+
// Rotate to stand upright (usually necessary for STLs)
this.currentMesh.rotation.x = -Math.PI / 2;
this.scene.add(this.currentMesh);
// Adjust camera to fit object
- const boundingBox = geometry.boundingBox!;
- const size = new THREE.Vector3();
- boundingBox.getSize(size);
const maxDim = Math.max(size.x, size.y, size.z);
const fov = this.camera.fov * (Math.PI / 180);
- let cameraZ = Math.abs(maxDim / 2 * Math.tan(fov * 2)); // Basic fit
- cameraZ *= 2.5; // Zoom out a bit
+
+ // Calculate distance towards camera (z-axis)
+ let cameraZ = Math.abs(maxDim / 2 / Math.tan(fov / 2));
+ cameraZ *= 1.5; // Tighter zoom (reduced from 2.5)
this.camera.position.z = cameraZ;
this.camera.updateProjectionMatrix();
+ this.controls.update();
} catch (err) {
console.error('Error loading STL:', err);