Remove support of cityjson for ifcconvert binary

This commit is contained in:
Esteban DUGUEPEROUX
2025-11-13 13:56:21 +01:00
committed by Thomas Krijnen
parent db7900027e
commit 9b257b0a10
11 changed files with 4 additions and 143 deletions
+1
View File
@@ -17,6 +17,7 @@
# General Python residue
__pycache__
*.py.bak
venv
# Visual Studio Code files
.vscode
-3
View File
@@ -11,9 +11,6 @@
[submodule "src/ifcopenshell-python/test/Sample-BIM-Files"]
path = src/ifcopenshell-python/test/Sample-BIM-Files
url = https://github.com/IfcOpenShell/ids-test-files
[submodule "src/ifcconvert/cityjson"]
path = src/ifcconvert/cityjson
url = https://github.com/IfcOpenShell/ifc-to-cityjson
[submodule "docs/cpp-api/assets/doxygen-awesome-css"]
path = docs/cpp-api/assets/doxygen-awesome-css
url = https://github.com/jothepro/doxygen-awesome-css.git
+1 -41
View File
@@ -79,7 +79,6 @@ option(HDF5_SUPPORT "Enable HDF5 support (requires HDF5, zlib)" ON)
option(WITH_PROJ "Enable output of Earth-Centered Earth-Fixed glTF output using the PROJ library" OFF)
option(IFCXML_SUPPORT "Build IfcParse with ifcXML support (requires libxml2)." ON)
option(USD_SUPPORT "Build IfcConvert with USD support (requires pixar's USD library)." OFF)
option(CITYJSON_SUPPORT "Build IfcConvert with CityJSON support (requires CityJSON library)." OFF)
option(WITH_RELATIONSHIP_VALIDATION "Build IfcConvert with option to validate geometrical relationships." OFF)
option(WITH_ROCKSDB "Support a RocksDB key-value store as a file backend in IfcOpenShell" OFF)
option(WITH_ZSTD "Use Zstd compression in RocksDB writes" OFF)
@@ -276,10 +275,6 @@ if(WITH_CGAL)
add_definitions(-DIFOPSH_WITH_CGAL)
set(SWIG_DEFINES ${SWIG_DEFINES} -DIFOPSH_WITH_CGAL)
if(CITYJSON_SUPPORT)
add_definitions(-DIFOPSH_WITH_CITYJSON)
endif()
list(APPEND GEOMETRY_KERNELS cgal)
endif()
@@ -289,7 +284,7 @@ if(WITH_OPENCASCADE)
list(APPEND GEOMETRY_KERNELS opencascade)
endif()
if(GLTF_SUPPORT OR CITYJSON_SUPPORT)
if(GLTF_SUPPORT)
UNIFY_ENVVARS_AND_CACHE(JSON_INCLUDE_DIR)
if(NOT JSON_INCLUDE_DIR)
find_package(nlohmann_json CONFIG)
@@ -1107,37 +1102,6 @@ if(BUILD_CONVERT OR BUILD_IFCPYTHON)
endif(BUILD_CONVERT OR BUILD_IFCPYTHON)
if(BUILD_CONVERT)
if(WITH_CGAL AND CITYJSON_SUPPORT)
message(STATUS "Building CityJSON support")
set(CITYJSON_CONVERT_FILES
../src/ifcconvert/cityjson/geobim.cpp
../src/ifcconvert/cityjson/global_execution_context.cpp
../src/ifcconvert/cityjson/opening_collector.cpp
../src/ifcconvert/cityjson/processing.cpp
../src/ifcconvert/cityjson/radius_comparison.cpp
../src/ifcconvert/cityjson/radius_execution_context.cpp
../src/ifcconvert/cityjson/settings.cpp
../src/ifcconvert/cityjson/writer.cpp
)
add_library(cityjson_converter ${CITYJSON_CONVERT_FILES})
target_include_directories(cityjson_converter PRIVATE ../src)
set(IFCOPENSHELL_LIBRARIES ${IFCOPENSHELL_LIBRARIES} cityjson_converter)
install(TARGETS cityjson_converter
ARCHIVE DESTINATION ${LIBDIR}
LIBRARY DESTINATION ${LIBDIR}
)
add_executable(cityjson_converter_exe ${CITYJSON_CONVERT_FILES})
set_target_properties(cityjson_converter_exe PROPERTIES COMPILE_FLAGS "-DCITYJSON_EXECUTABLE")
target_include_directories(cityjson_converter_exe PRIVATE ../src)
target_link_libraries(cityjson_converter_exe ${IFCOPENSHELL_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${Boost_LIBRARIES} ${HDF5_LIBRARIES} ${USD_LIBRARIES})
install(TARGETS cityjson_converter_exe
RUNTIME DESTINATION ${BINDIR}
)
endif()
# IfcConvert
if (WITH_RELATIONSHIP_VALIDATION)
file(GLOB IFCCONVERT_CPP_FILES ../src/ifcconvert/*.cpp)
@@ -1154,10 +1118,6 @@ if(BUILD_CONVERT)
set_property(TARGET IfcConvert APPEND_STRING PROPERTY COMPILE_FLAGS " -DWITH_RELATIONSHIP_VALIDATION")
endif()
if(WITH_CGAL AND CITYJSON_SUPPORT)
set_property(TARGET IfcConvert APPEND_STRING PROPERTY COMPILE_FLAGS " -DIFOPSH_WITH_CITYJSON")
endif()
if((NOT WIN32) AND BUILD_SHARED_LIBS)
# Only set RPATHs when building shared libraries (i.e. IfcParse and
# IfcGeom are dynamically linked). Not necessarily a perfect solution
-1
View File
@@ -17,7 +17,6 @@
"IFCXML_SUPPORT": "ON",
"HDF5_SUPPORT": "ON",
"SCHEMA_VERSIONS": "4x3_add2",
"CITYJSON_SUPPORT": "OFF",
"CMAKE_GENERATOR_PLATFORM": "",
"CMAKE_GENERATOR_TOOLSET": ""
}
-1
View File
@@ -42,7 +42,6 @@ cmake -G "Ninja" ^
-D Boost_LIBRARY_DIR:FILEPATH="%LIBRARY_PREFIX%\lib" ^
-D Boost_INCLUDE_DIR:FILEPATH="%LIBRARY_PREFIX%\include" ^
-D Boost_USE_STATIC_LIBS:BOOL=OFF ^
-D CITYJSON_SUPPORT:BOOL=OFF ^
../cmake
if errorlevel 1 exit 1
-1
View File
@@ -42,7 +42,6 @@ cmake ${CMAKE_ARGS} -G Ninja \
-DBUILD_IFCGEOM:BOOL=ON \
-DBUILD_GEOMSERVER:BOOL=OFF \
-DBOOST_USE_STATIC_LIBS:BOOL=OFF \
-DCITYJSON_SUPPORT:BOOL=OFF \
./cmake
ninja
-2
View File
@@ -9,7 +9,6 @@ extend-exclude = '''
|src/ifcopenshell-python/ifcopenshell/mvd/*
|src/ifcopenshell-python/ifcopenshell/simple_spf/*
|src/ifc2ca/templates/*
|src/ifcconvert/cityjson/*
|src/svgfill
|src/exterior-shell-extractor
'''
@@ -25,7 +24,6 @@ reportUnnecessaryTypeIgnoreComment = true
[tool.ruff]
exclude = [
# Submodules.
"src/ifcconvert/cityjson",
"src/ifcopenshell-python/ifcopenshell/express",
"src/ifcopenshell-python/ifcopenshell/mvd",
"src/ifcopenshell-python/ifcopenshell/simple_spf",
-86
View File
@@ -50,10 +50,6 @@
#include "../ifcparse/utils.h"
#ifdef IFOPSH_WITH_CITYJSON
#include "./cityjson/geobim.h"
#endif
#ifdef IFOPSH_WITH_OPENCASCADE
#include <Standard_Version.hxx>
@@ -136,9 +132,6 @@ void print_usage(bool suggest_help = true)
<< " .svg SVG Scalable Vector Graphics (2D floor plan)\n"
#ifdef WITH_HDF5
<< " .h5 HDF Hierarchical Data Format storing positions, normals and indices\n"
#endif
#ifdef IFOPSH_WITH_CITYJSON
<< " .cityjson City JSON format for geospatial data\n"
#endif
<< " .ttl TTL/WKT RDF Turtle with Well-Known-Text geometry\n"
<< " .ifc IFC-SPF Industry Foundation Classes\n"
@@ -661,7 +654,6 @@ int main(int argc, char** argv) {
JSON = IfcUtil::path::from_utf8(".json"),
// @todo this is just temporary as it doesn't make sense to require an extension for a DB
RDB = IfcUtil::path::from_utf8(".rdb"),
CITY_JSON = IfcUtil::path::from_utf8(".cityjson"),
IFC = IfcUtil::path::from_utf8(".ifc"),
USD = IfcUtil::path::from_utf8(".usd"),
USDA = IfcUtil::path::from_utf8(".usda"),
@@ -755,84 +747,6 @@ int main(int argc, char** argv) {
return exit_code;
}
#endif
#ifdef IFOPSH_WITH_CITYJSON
else if (output_extension == CITY_JSON || (output_extension == OBJ || output_extension == DAE || output_extension == GLB) && vmap.count("exterior-only") && exterior_only_algo != "none") {
// none, convex-decomposition, minkowski-triangles or halfspace-snapping
boost::to_lower(exterior_only_algo);
if (exterior_only_algo == "halfspace-snapping") {
cerr_ << "[Error] halfspace-snapping not implemented yet" << std::endl;
print_usage();
return EXIT_FAILURE;
} else if (exterior_only_algo == "minkowski-triangles") {
//
} else if (exterior_only_algo == "convex-decomposition") {
//
} else if (exterior_only_algo == "none") {
//
} else {
cerr_ << "[Error] --exterior-only should be convex-decomposition|minkowski-triangles|halfspace-snapping" << std::endl;
print_usage();
return EXIT_FAILURE;
}
geobim_settings settings;
settings.input_filenames = { IfcUtil::path::to_utf8(input_filename) };
settings.file = { new IfcParse::IfcFile(IfcUtil::path::to_utf8(input_filename)) };
/*
// No longer set, because we pass to real serializers now, awaiting a proper iterator adaptor
if (output_extension == OBJ) {
settings.obj_output_filename = IfcUtil::path::to_utf8(output_filename);
}
*/
if (output_extension == CITY_JSON) {
// we don't have a cityjson serializer though
settings.cityjson_output_filename = IfcUtil::path::to_utf8(output_filename);
}
// @todo
settings.radii = { "0.05" };
settings.apply_openings = false;
settings.apply_openings_posthoc = true;
settings.debug = false;
settings.exact_segmentation = true;
settings.minkowski_triangles = exterior_only_algo == "minkowski-triangles";
settings.no_erosion = false;
settings.spherical_padding = false;
if (num_threads != 1) {
settings.threads = num_threads;
}
settings.settings.get<ifcopenshell::geometry::settings::UseWorldCoords>().value = false;
settings.settings.get<ifcopenshell::geometry::settings::WeldVertices>().value = false;
settings.settings.get<ifcopenshell::geometry::settings::ReorientShells>().value = true;
settings.settings.get<ifcopenshell::geometry::settings::ConvertBackUnits>().value = true;
settings.settings.get<ifcopenshell::geometry::settings::IteratorOutput>().value = ifcopenshell::geometry::settings::NATIVE;
settings.settings.get<ifcopenshell::geometry::settings::DisableOpeningSubtractions>().value = !settings.apply_openings;
if (include_filter.type != geom_filter::UNUSED) {
settings.entity_names = include_filter.values;
settings.entity_names_included = true;
} else if (exclude_filter.type != geom_filter::UNUSED) {
settings.entity_names = exclude_filter.values;
settings.entity_names_included = false;
} else {
settings.entity_names = { { "IfcSpace", "IfcOpeningElement" } };
settings.entity_names_included = false;
}
elems_from_adaptor.emplace();
perform(settings, *elems_from_adaptor);
if (output_extension == CITY_JSON) {
return 0;
}
// else ... continue on to serialize elems_from_adaptor
}
#endif
/// @todo Clean up this filter code further.
std::vector<geom_filter> used_filters;
+2 -6
View File
@@ -2,8 +2,7 @@ IfcConvert
==========
IfcConvert is a command-line application for converting IFC geometry into file
formats such as OBJ, DAE, GLB, STP, IGS, XML, SVG, H5, CityJSON, TTL/WKT, and
IFC-SPF itself.
formats such as OBJ, DAE, GLB, STP, IGS, XML, SVG, H5, TTL/WKT, and IFC-SPF itself.
For other formats, you may use other IfcOpenShell utilities as shown in the
table below.
@@ -13,7 +12,7 @@ table below.
+=========================+=========================+======================+
| .ifc | .obj, .dae, .glb, .stp, | IfcConvert |
| | .igs, .xml, .svg, .h5, | |
| | .cityjson, .ttl, .ifc | |
| | .ttl, .ifc | |
+-------------------------+-------------------------+----------------------+
| .ifc | .dae, .abc, .usd, .obj, | Bonsai_ |
| | .ply, .stl, .fbx, .glb, | |
@@ -46,8 +45,6 @@ table below.
+-------------------------+-------------------------+----------------------+
| .obj | .ifc | Bonsai_ |
+-------------------------+-------------------------+----------------------+
| .json (CityJSON) | .ifc | IfcCityJSON_ |
+-------------------------+-------------------------+----------------------+
| .xer (Oracle P6) | .ifc | Ifc4D_ |
+-------------------------+-------------------------+----------------------+
| .xml (Oracle P6) | .ifc | Ifc4D_ |
@@ -63,7 +60,6 @@ table below.
.. _IfcCSV: ifccsv.html
.. _Ifc4D: ifc4d.html
.. _Ifc5D: ifc5d.html
.. _IfcCityJSON: ifccityjson.html
.. _Ifc2JSON: other.html
.. _Bonsai: bonsai.html
@@ -82,7 +82,6 @@ CLI Manual
.xml XML Property definitions and decomposition tree
.svg SVG Scalable Vector Graphics (2D floor plan)
.h5 HDF Hierarchical Data Format storing positions, normals and indices
.cityjson City JSON format for geospatial data
.ttl TTL/WKT RDF Turtle with Well-Known-Text geometry
.ifc IFC-SPF Industry Foundation Classes