format project
This commit is contained in:
@@ -59,7 +59,7 @@ export const makeStlDownloadHandler =
|
||||
(quality === 'high' || ideType === 'openscad')
|
||||
) {
|
||||
saveFile(makeStlBlobFromGeo(geometry))
|
||||
} else if(ideType == 'jscad') {
|
||||
} else if (ideType == 'jscad') {
|
||||
saveFile(makeStlBlobFromMesh(geometry))
|
||||
} else {
|
||||
thunkDispatch((dispatch, getState) => {
|
||||
|
||||
@@ -14,7 +14,7 @@ const IdeEditor = ({ Loading }) => {
|
||||
const [theme, setTheme] = useState('vs-dark')
|
||||
const saveCode = useSaveCode()
|
||||
|
||||
const ideTypeToLanguageMap: {[key in CadPackageType]: string} = {
|
||||
const ideTypeToLanguageMap: { [key in CadPackageType]: string } = {
|
||||
cadquery: 'python',
|
||||
openscad: 'cpp',
|
||||
jscad: 'javascript',
|
||||
|
||||
@@ -25,18 +25,18 @@ function Asset({ geometry: incomingGeo }) {
|
||||
}, [incomingGeo])
|
||||
if (!incomingGeo) return null
|
||||
|
||||
let groupData = incomingGeo.children ? incomingGeo : null
|
||||
if(lastGroup && lastGroup != groupData){
|
||||
const groupData = incomingGeo.children ? incomingGeo : null
|
||||
if (lastGroup && lastGroup != groupData) {
|
||||
state.scene.remove(lastGroup)
|
||||
lastGroup.children.forEach(c=>c?.geometry?.dispose())
|
||||
lastGroup.children.forEach((c) => c?.geometry?.dispose())
|
||||
// returning <primitive object={groupData} /> does not add the new group to the scene
|
||||
// there is probably some useRef magic that would make this work, but I don't have time to reseach it
|
||||
/// FIXME - do this properly with useRef or other react magic
|
||||
if(groupData) state.scene.add(groupData)
|
||||
if (groupData) state.scene.add(groupData)
|
||||
}
|
||||
lastGroup = groupData
|
||||
|
||||
if(groupData) return <primitive object={groupData} />
|
||||
if (groupData) return <primitive object={groupData} />
|
||||
|
||||
if (incomingGeo.children) return <primitive object={incomingGeo} />
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import Svg from 'src/components/Svg/Svg'
|
||||
import { Popover } from '@headlessui/react'
|
||||
import type { CadPackage } from 'src/helpers/hooks/useIdeState'
|
||||
|
||||
|
||||
const menuOptions: {
|
||||
name: string
|
||||
sub: string
|
||||
|
||||
Reference in New Issue
Block a user