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

[Bug]: Potential Duplication Issue with StreamAllMeshesWithTypes vs. StreamAllMeshes #1177

Open
onderilkesever opened this issue Nov 29, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@onderilkesever
Copy link

What happened?

Hi,
I am trying to generate meshes from an IFC file, and I have been following the example provided in your viewer. When I use StreamAllMeshes, the mesh generation works perfectly, and the model is correct.

However, when I try to create meshes using the following snippet with StreamAllMeshesWithTypes, I get a correct model, but I also notice duplicate elements in the output.

Here’s the snippet I used, rest of the code is the same:

		const types = this.webIfc.GetAllTypesOfModel(modelID);

		const excludedTypeIDs = new Set<number>([IFCSPACE, IFCOPENINGELEMENT]);

		const typeIDs = types
			.filter((ifc) => !excludedTypeIDs.has(ifc.typeID)) // Exclude unwanted IDs
			.map((ifc) => ifc.typeID); // Extract typeID

		this.webIfc.StreamAllMeshesWithTypes(modelID, typeIDs, (mesh: FlatMesh) =>
		{

Is this behavior caused by a bug in the library, or could there be an issue with my implementation?

Here is my ifc file if you would like to try out yourself. https://drive.google.com/file/d/1kXqb-5_7z05Trn655KQG7WmQBNoAH94E/view?usp=sharing

Thank you for your help!

Version

0.0.66

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

Anything else?

No response

@onderilkesever onderilkesever added the bug Something isn't working label Nov 29, 2024
@beachtom
Copy link
Collaborator

So our code for streaming meshes - excludes IFCOPENINGELEMENT IFCSPACE and IFCOPENINGSTANDARDCASE - then streams all of them if you implement the same logic does the duplicate go away?

@onderilkesever
Copy link
Author

Unfortunately, no, the issue still persists. I've included my code snippet above for reference. (I also added IFCOPENINGSTANDARDCASE, but it didn’t make a difference.)

@beachtom
Copy link
Collaborator

beachtom commented Dec 2, 2024

Thanks. To help me track it down - can you check if you are getting any duplicate typeIds appearing in your typeIDs arrays?

@onderilkesever
Copy link
Author

onderilkesever commented Dec 2, 2024

Unfortunately no @beachtom, that was the first thing I also checked. See my updated snippet to ensure no duplicates in the list.

		const excludedTypeIDs = new Set<number>([IFCSPACE, IFCOPENINGELEMENT, IFCOPENINGSTANDARDCASE]);
		
		const types = this.webIfc.GetIfcEntityList(modelID);

		const uniqueTypes = Array.from(new Set(types));

		const filteredUniqueTypes = uniqueTypes.filter(type => !excludedTypeIDs.has(type));

		this.webIfc.StreamAllMeshesWithTypes(modelID, filteredUniqueTypes, (mesh: FlatMesh) =>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants