Skip to content

Very simple code with react fiber #188

@amapic

Description

@amapic

Hi,

Thanks for this package. As a beginner with BIM and IFC, I wanted to convert the page below into fibber. I would like to latter insert a model in a react website.

https://github.com/mrdoob/three.js/blob/dev/examples/webgl_loader_ifc.html
https://threejs.org/examples/webgl_loader_ifc.html

The code below doesn't work. I got this error :

RuntimeError: Aborted(LinkError: WebAssembly.instantiate(): Import #49 module="a" function="X": function import requires a callable). Build with -sASSERTIONS for more info.

What is the problem ? Is the wasm path ok ?

Thanks for your help

import {useLoader} from '@react-three/fiber';
import { IFCLoader } from 'web-ifc-three';
import { IFCSPACE } from 'web-ifc';

import {useEffect,Suspense} from "react"

const Model = () => {
 
  useEffect( ()=>{
	  async function Kaka(){
	 const ifcLoader = new IFCLoader();
	await ifcLoader.ifcManager.setWasmPath( 'https://cdn.jsdelivr.net/npm/web-ifc@0.0.36/', true );

	await ifcLoader.ifcManager.parser.setupOptionalCategories( {
		[ IFCSPACE ]: false,
	} );

	await ifcLoader.ifcManager.applyWebIfcConfig( {
		USE_FAST_BOOLS: true
	} );

	ifcLoader.load( './src/assets/rac_advanced_sample_project.ifc', function (  ) {
		// scene.add( model.mesh );
		// render();


	} );
	  }
	  
	  Kaka()
	  
  },[])
  
  

  return (
    <Suspense fallback={null}>
    
	  <div>AA</div>
    </Suspense>
  );
};

export default Model

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions