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

IfcTriangulatedFaceSet indices get treated as oids #1345

Open
muren400 opened this issue Jan 6, 2025 · 2 comments
Open

IfcTriangulatedFaceSet indices get treated as oids #1345

muren400 opened this issue Jan 6, 2025 · 2 comments

Comments

@muren400
Copy link
Contributor

muren400 commented Jan 6, 2025

Hi,

we recently observed this Exception:

12:18:16 ERROR [GeometryRunner]:                                                                                  (GeometryRunner.java:850) 
org.bimserver.BimserverDatabaseException: No class for cid 2075 (cid came from oid: 67611)
	at org.bimserver.database.Database.getEClassForOid(Database.java:460)
	at org.bimserver.database.DatabaseSession.getEClassForOid(DatabaseSession.java:2201)
	at org.bimserver.database.queries.FollowReferenceStackFrame.process(FollowReferenceStackFrame.java:63)
	at org.bimserver.database.queries.QueryObjectProvider.next(QueryObjectProvider.java:169)
	at org.bimserver.geometry.GeometryRunner.run(GeometryRunner.java:159)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)

It was thrown when importing an IFC-File containing terrain.

The terrain is represented as an IfcTriangulatedFaceSet and apparently the indices in CoordIndex are treated like oids in QueryIncludeStackFrame.process().

} else if (element instanceof HashMapVirtualObject && feature.getEAnnotation("twodimensionalarray")!=null) {
for ( Object nestedElement :(List)((HashMapVirtualObject) element).get("List")){
if(nestedElement instanceof Long){
processReference((Long) nestedElement);
// TODO process as direct feature?
}
}
} else {

This doesn't seem to cause too much problems until the list of vertices (and thus the indices) is big enough to cause the above mentioned exception.

Unfortunately I can't share the mentioned IFC-File but one can observe the behavior (processReference being called for indices) with this example file.

@muren400
Copy link
Contributor Author

muren400 commented Jan 6, 2025

A simple fix seems to be skipping all instances of ListOfELong.

HashMapVirtualObject virtualObject = (HashMapVirtualObject) element;
if(virtualObject.eClass().getName().equals("ListOfELong")) {
	return !featureIterator.hasNext();
}
					
for ( Object nestedElement :(List)virtualObject.get("List")){
	if(nestedElement instanceof Long){
		processReference((Long) nestedElement);
		// TODO process as direct feature?
	}
}

@hlg
Copy link
Member

hlg commented Jan 6, 2025

Another issue with the sample file appears when serializing with a non-streaming serializer - the coord indizes are missing from the triangulated faces set.

This might be somewhat related to #1109 (comment). There are various cases in the schema where positive integers in lists or two-dimensional lists are actual values, not references. It seems like those are affected in different ways by a bug in how the database queries and the object provider work.

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