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
-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