Align orientation of model-viewer w/ OpenSCAD

This commit is contained in:
ochafik 2024-12-23 03:10:03 +00:00 committed by Olivier Chafik
commit ba79a7cd87
2 changed files with 17 additions and 17 deletions

View file

@ -32,6 +32,7 @@ export default function ViewerPanel({className, style}: {className?: string, sty
}}>
{(state.output?.displayFileURL || state.output?.outFile && state.output.outFile.name.endsWith('.glb') && state.output?.outFileURL) && (
<model-viewer
orientation="0deg -90deg 0deg"
src={state.output?.displayFileURL ?? state.output?.outFileURL ?? ''}
style={{
width: '100%',

View file

@ -20,6 +20,7 @@ export default `/*
title = "OpenSCAD";
color("gray")
rotate([90, 0, 0])
translate([0, debug ? -60 : -20, 0])
linear_extrude(1)
text(title,
@ -38,20 +39,18 @@ debug = true;
$fs=$preview ? 1 : 0.1; // Don't generate smaller facets than 0.1 mm
$fa=$preview ? 15 : 5; // Don't generate larger angles than 5 degrees
rotate([-90, 0, 0]) {
// Main geometry
difference() {
// Main geometry
difference() {
intersection() {
body();
intersector();
}
holes();
}
// Helpers
if (debug) helpers();
}
// Helpers
if (debug) helpers();
// Core geometric primitives.
// These can be modified to create variations of the final object