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) && ( {(state.output?.displayFileURL || state.output?.outFile && state.output.outFile.name.endsWith('.glb') && state.output?.outFileURL) && (
<model-viewer <model-viewer
orientation="0deg -90deg 0deg"
src={state.output?.displayFileURL ?? state.output?.outFileURL ?? ''} src={state.output?.displayFileURL ?? state.output?.outFileURL ?? ''}
style={{ style={{
width: '100%', width: '100%',

View file

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