Skip to content

Commit

Permalink
Align orientation of model-viewer w/ OpenSCAD
Browse files Browse the repository at this point in the history
  • Loading branch information
ochafik committed Dec 23, 2024
1 parent 950dc7e commit ba79a7c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
1 change: 1 addition & 0 deletions src/components/ViewerPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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%',
Expand Down
33 changes: 16 additions & 17 deletions src/state/default-scad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ export default `/*
title = "OpenSCAD";
color("gray")
translate([0, debug ? -60 : -20, 0])
linear_extrude(1)
text(title,
halign="center",
valign="center");
rotate([90, 0, 0])
translate([0, debug ? -60 : -20, 0])
linear_extrude(1)
text(title,
halign="center",
valign="center");
// You can find the original for the following example in the file explorer above,
// under openscad / examples / Basic / CSG-modules.scad
Expand All @@ -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() {
intersection() {
body();
intersector();
}
holes();
}
// Helpers
if (debug) helpers();
// Main geometry
difference() {
intersection() {
body();
intersector();
}
holes();
}
// Helpers
if (debug) helpers();
// Core geometric primitives.
// These can be modified to create variations of the final object
Expand Down

0 comments on commit ba79a7c

Please sign in to comment.