something works
This commit is contained in:
@@ -259,7 +259,12 @@ const makeScriptWorker = ({callback, convertToSolids})=>{
|
||||
let transfer = []
|
||||
if(convertToSolids === 'buffers'){
|
||||
CSGToBuffers.clearCache()
|
||||
entities = solids.map((csg)=>CSGToBuffers(csg, transfer))
|
||||
entities = solids.map((csg)=>{
|
||||
let obj = CSGToBuffers(csg, transfer)
|
||||
obj.color = csg.color
|
||||
obj.transforms = csg.transforms
|
||||
return obj
|
||||
})
|
||||
}else if(convertToSolids === 'regl'){
|
||||
const { entitiesFromSolids } = require('@jscad/regl-renderer')
|
||||
time = Date.now()
|
||||
|
||||
@@ -21,6 +21,9 @@ function Asset({ geometry: incomingGeo }) {
|
||||
}
|
||||
}, [incomingGeo])
|
||||
if (!incomingGeo) return null
|
||||
|
||||
if (incomingGeo.children) return <primitive object={incomingGeo} />
|
||||
|
||||
return (
|
||||
<mesh ref={mesh} scale={[1, 1, 1]}>
|
||||
<bufferGeometry attach="geometry" ref={ref} />
|
||||
|
||||
@@ -81,7 +81,7 @@ self.addEventListener('message', (e)=>worker.postMessage(e.data))
|
||||
data.entities.map(CSG2Object3D).filter(o=>o).forEach(o=>group.add(o))
|
||||
response = createHealthyResponse( {
|
||||
type: 'geometry',
|
||||
data: group?.children[4]?.geometry,
|
||||
data: group,
|
||||
consoleMessage: data.scriptStats,
|
||||
date: new Date(),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user