-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c18922a
commit b9d0bfd
Showing
8 changed files
with
134 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,25 @@ | ||
<script lang="ts"> | ||
import type { CADFormat, PromptResponse } from '$lib/endpoints' | ||
import ModelViewer from './ModelViewer.svelte' | ||
export let data: PromptResponse | ||
let outputFormat: CADFormat = 'step' | ||
$: dataUrl = `data:text/${outputFormat};base64,${data.outputs ? data.outputs[outputFormat] : ''}` | ||
</script> | ||
|
||
<pre class="border p-4 my-12 first-of-type:mt-0 overflow-auto"> | ||
{JSON.stringify(data, null, 2)} | ||
</pre> | ||
<a href={`view/${data.id}`}>View model</a> | ||
<a href={dataUrl} download>Download model</a> | ||
<div> | ||
<div class="grid md:grid-cols-2 lg:grid-cols-3 border items-stretch"> | ||
<div class="lg:col-span-2 border-r px-2 py-6 lg:px-4 lg:py-16"> | ||
<h3>Your Prompt</h3> | ||
<p class="text-lg">"{data.prompt}"</p> | ||
</div> | ||
<div class="relative"> | ||
<ModelViewer /> | ||
</div> | ||
</div> | ||
<ul class="m-0 p-0"> | ||
<li class="contents"><a href={`view/${data.id}`}>View model</a></li> | ||
<li class="contents"><a href={dataUrl} download>Download model</a></li> | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<script lang="ts"> | ||
import * as THREE from 'three' | ||
import * as SC from 'svelte-cubed' | ||
</script> | ||
|
||
<SC.Canvas antialias background={new THREE.Color('oklch(99.7% 0.008766 102.8deg)')}> | ||
<SC.Mesh geometry={new THREE.BoxGeometry()} /> | ||
<SC.PerspectiveCamera position={[1, 1, 3]} /> | ||
<SC.OrbitControls enableZoom={false} /> | ||
</SC.Canvas> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters