Fix JSCAD, useEdgeSplit issue
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
|||||||
Environment,
|
Environment,
|
||||||
useTexture,
|
useTexture,
|
||||||
} from '@react-three/drei'
|
} from '@react-three/drei'
|
||||||
import { useEdgeSplit } from 'src/helpers/hooks/useEdegeSplit'
|
import { useEdgeSplit } from 'src/helpers/hooks/useEdgeSplit'
|
||||||
import { Vector3 } from 'three'
|
import { Vector3 } from 'three'
|
||||||
import { requestRender } from 'src/helpers/hooks/useIdeState'
|
import { requestRender } from 'src/helpers/hooks/useIdeState'
|
||||||
import texture from './dullFrontLitMetal.png'
|
import texture from './dullFrontLitMetal.png'
|
||||||
|
|||||||
@@ -16,13 +16,13 @@ export function useEdgeSplit(
|
|||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (!original.current && ref.current) {
|
if (!original.current && ref.current) {
|
||||||
original.current = ref.current.geometry.clone()
|
original.current = ref.current.geometry?.clone()
|
||||||
modifier.current = new EdgeSplitModifier()
|
modifier.current = new EdgeSplitModifier()
|
||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
original.current = dependantGeometry.clone()
|
original.current = dependantGeometry?.clone?.()
|
||||||
modifier.current = new EdgeSplitModifier()
|
modifier.current = new EdgeSplitModifier()
|
||||||
}, [dependantGeometry])
|
}, [dependantGeometry])
|
||||||
|
|
||||||
Reference in New Issue
Block a user