mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-28 07:49:59 +00:00
Skip unavailable shape-stat kernels
Generated with the assistance of an AI coding tool.
This commit is contained in:
@@ -286,6 +286,7 @@
|
||||
#include "../ifcgeom/conversion_result.h"
|
||||
#include "../ifcgeom/hybrid_kernel.h"
|
||||
#include "../ifcgeom/geometry_serializer.h"
|
||||
#include "../ifcgeom/kernel_plugin.h"
|
||||
|
||||
#include "../ifcparse/express.h"
|
||||
#include "../ifcparse/file.h"
|
||||
@@ -325,6 +326,16 @@ std::vector<std::string> get_plugin_search_paths() {
|
||||
void clear_plugin_search_paths() {
|
||||
ifcopenshell::plugin::clear_search_paths();
|
||||
}
|
||||
|
||||
bool has_geometry_library(const std::string& geometry_library) {
|
||||
auto& registry = ifcopenshell::geom::kernels::kernel_registry_instance();
|
||||
try {
|
||||
return registry.has(geometry_library) ||
|
||||
ifcopenshell::geom::kernels::load_kernel_plugin(registry, geometry_library);
|
||||
} catch (const std::exception&) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
%}
|
||||
|
||||
%include "IfcGeomWrapper.i"
|
||||
|
||||
Reference in New Issue
Block a user