bounding sphere fix #572

Merged
Irev-Dev merged 1 commits from kurt/bounding-shere-fix into main 2021-11-06 03:36:53 +01:00
3 changed files with 13 additions and 4 deletions

View File

@@ -47,7 +47,9 @@ const fileMenuConfig: EditorMenuConfig = {
ideType: state.ideType, ideType: state.ideType,
geometry: state.objectData?.data, geometry: state.objectData?.data,
quality: state.objectData?.quality, quality: state.objectData?.quality,
fileName: project? `${ project.title}.stl` : PullTitleFromFirstLine(state.code || ''), fileName: project
? `${project.title}.stl`
: PullTitleFromFirstLine(state.code || ''),
thunkDispatch, thunkDispatch,
}) })
@@ -104,7 +106,11 @@ interface EditorMenuItemConfigBase {
callback?: (...a: any[]) => void callback?: (...a: any[]) => void
} }
export interface EditorMenuItemConfig extends EditorMenuItemConfigBase { export interface EditorMenuItemConfig extends EditorMenuItemConfigBase {
Component: React.FC<{config: EditorMenuItemConfigBase, state: State, thunkDispatch: any}> Component: React.FC<{
config: EditorMenuItemConfigBase
state: State
thunkDispatch: any
}>
} }
export interface EditorMenuConfig { export interface EditorMenuConfig {

View File

@@ -30,6 +30,9 @@ export function Asset({
React.useEffect(() => { React.useEffect(() => {
const getBoundingSphere = () => { const getBoundingSphere = () => {
if (dataType === 'geometry') { if (dataType === 'geometry') {
if (!incomingGeo.boundingSphere && incomingGeo.computeBoundingSphere) {
incomingGeo.computeBoundingSphere()
}
return incomingGeo.boundingSphere return incomingGeo.boundingSphere
} }
const group = new THREE.Group() const group = new THREE.Group()

View File

@@ -142,7 +142,7 @@ const ProjectProfile = ({
<KeyValue keyName="Updated on"> <KeyValue keyName="Updated on">
{new Date(project?.updatedAt).toDateString()} {new Date(project?.updatedAt).toDateString()}
</KeyValue> </KeyValue>
{project.forkedFrom && ( {project?.forkedFrom && (
<KeyValue keyName="Forked from"> <KeyValue keyName="Forked from">
<Link <Link
className="pink-link" className="pink-link"