From 9b257b0a10bd27fe2377a55c11666e37cb715245 Mon Sep 17 00:00:00 2001 From: Esteban DUGUEPEROUX Date: Thu, 13 Nov 2025 13:56:21 +0100 Subject: [PATCH] Remove support of cityjson for ifcconvert binary --- .gitignore | 1 + .gitmodules | 3 - cmake/CMakeLists.txt | 42 +-------- cmake/CMakePresets.json | 1 - conda/build.bat | 1 - conda/build.sh | 1 - pyproject.toml | 2 - src/ifcconvert/IfcConvert.cpp | 86 ------------------- src/ifcconvert/cityjson | 1 - src/ifcopenshell-python/docs/ifcconvert.rst | 8 +- .../docs/ifcconvert/usage.rst | 1 - 11 files changed, 4 insertions(+), 143 deletions(-) delete mode 160000 src/ifcconvert/cityjson diff --git a/.gitignore b/.gitignore index 494022e37e..504685d332 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ # General Python residue __pycache__ *.py.bak +venv # Visual Studio Code files .vscode diff --git a/.gitmodules b/.gitmodules index 017cd2ae8e..4aa9fd774c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 5792954570..7e7479415e 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -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 diff --git a/cmake/CMakePresets.json b/cmake/CMakePresets.json index 9c10495ad3..5bd4a18635 100644 --- a/cmake/CMakePresets.json +++ b/cmake/CMakePresets.json @@ -17,7 +17,6 @@ "IFCXML_SUPPORT": "ON", "HDF5_SUPPORT": "ON", "SCHEMA_VERSIONS": "4x3_add2", - "CITYJSON_SUPPORT": "OFF", "CMAKE_GENERATOR_PLATFORM": "", "CMAKE_GENERATOR_TOOLSET": "" } diff --git a/conda/build.bat b/conda/build.bat index 388e5cd746..fe8cef01c1 100644 --- a/conda/build.bat +++ b/conda/build.bat @@ -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 diff --git a/conda/build.sh b/conda/build.sh index b17bc87159..571b6959f8 100644 --- a/conda/build.sh +++ b/conda/build.sh @@ -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 diff --git a/pyproject.toml b/pyproject.toml index f2cdb67b34..edd328321e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", diff --git a/src/ifcconvert/IfcConvert.cpp b/src/ifcconvert/IfcConvert.cpp index 81a7b37a79..d31882ae4d 100644 --- a/src/ifcconvert/IfcConvert.cpp +++ b/src/ifcconvert/IfcConvert.cpp @@ -50,10 +50,6 @@ #include "../ifcparse/utils.h" -#ifdef IFOPSH_WITH_CITYJSON -#include "./cityjson/geobim.h" -#endif - #ifdef IFOPSH_WITH_OPENCASCADE #include @@ -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().value = false; - settings.settings.get().value = false; - settings.settings.get().value = true; - settings.settings.get().value = true; - settings.settings.get().value = ifcopenshell::geometry::settings::NATIVE; - settings.settings.get().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 used_filters; diff --git a/src/ifcconvert/cityjson b/src/ifcconvert/cityjson deleted file mode 160000 index a9488c8d8f..0000000000 --- a/src/ifcconvert/cityjson +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a9488c8d8fd1c32eb23118596819ab54225cdfb4 diff --git a/src/ifcopenshell-python/docs/ifcconvert.rst b/src/ifcopenshell-python/docs/ifcconvert.rst index 6861eb1120..bbdbe0c14c 100644 --- a/src/ifcopenshell-python/docs/ifcconvert.rst +++ b/src/ifcopenshell-python/docs/ifcconvert.rst @@ -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 diff --git a/src/ifcopenshell-python/docs/ifcconvert/usage.rst b/src/ifcopenshell-python/docs/ifcconvert/usage.rst index ffc64f1c08..2c8ffeee5c 100644 --- a/src/ifcopenshell-python/docs/ifcconvert/usage.rst +++ b/src/ifcopenshell-python/docs/ifcconvert/usage.rst @@ -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