Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very simple code with react fiber #188

Open
amapic opened this issue Apr 14, 2024 · 1 comment
Open

Very simple code with react fiber #188

amapic opened this issue Apr 14, 2024 · 1 comment

Comments

@amapic
Copy link

amapic commented Apr 14, 2024

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/[email protected]/', 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
@technestme
Copy link

Maybe on this link(https://github.com/magjac/d3-graphviz/issues/152 ), you can find the solution. Hope your success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants