Fix split edge issue
This commit is contained in:
@@ -16,13 +16,7 @@ const colorMap = loader.load(texture)
|
|||||||
extend({ OrbitControls })
|
extend({ OrbitControls })
|
||||||
|
|
||||||
function Asset({ geometry: incomingGeo }) {
|
function Asset({ geometry: incomingGeo }) {
|
||||||
const mesh = useEdgeSplit(12*Math.PI/180, true)
|
const mesh = useEdgeSplit((12 * Math.PI) / 180, true)
|
||||||
const ref = useRef<any>({})
|
|
||||||
useLayoutEffect(() => {
|
|
||||||
if (incomingGeo?.attributes) {
|
|
||||||
ref.current.attributes = incomingGeo.attributes
|
|
||||||
}
|
|
||||||
}, [incomingGeo])
|
|
||||||
if (!incomingGeo) return null
|
if (!incomingGeo) return null
|
||||||
|
|
||||||
if (incomingGeo.length)
|
if (incomingGeo.length)
|
||||||
@@ -31,8 +25,7 @@ function Asset({ geometry: incomingGeo }) {
|
|||||||
))
|
))
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<mesh ref={mesh} scale={[1, 1, 1]}>
|
<mesh ref={mesh} scale={[1, 1, 1]} geometry={incomingGeo}>
|
||||||
<bufferGeometry attach="geometry" ref={ref} />
|
|
||||||
<meshStandardMaterial map={colorMap} color="#F472B6" />
|
<meshStandardMaterial map={colorMap} color="#F472B6" />
|
||||||
</mesh>
|
</mesh>
|
||||||
)
|
)
|
||||||
@@ -229,11 +222,9 @@ const IdeViewer = ({ Loading }) => {
|
|||||||
<Box position={[50, 0, 0]} size={[100, 1, 1]} color={pink400} />
|
<Box position={[50, 0, 0]} size={[100, 1, 1]} color={pink400} />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<Asset
|
{state.objectData?.type === 'geometry' && state.objectData?.data && (
|
||||||
geometry={
|
<Asset geometry={state.objectData?.data} />
|
||||||
state.objectData?.type === 'geometry' && state.objectData?.data
|
)}
|
||||||
}
|
|
||||||
/>
|
|
||||||
</Canvas>
|
</Canvas>
|
||||||
</div>
|
</div>
|
||||||
<DelayedPingAnimation isLoading={state.isLoading} />
|
<DelayedPingAnimation isLoading={state.isLoading} />
|
||||||
|
|||||||
Reference in New Issue
Block a user