mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
SVG reliance on UseElemHierarchy for storey decomposition
This commit is contained in:
@@ -815,6 +815,15 @@ int main(int argc, char** argv) {
|
||||
}
|
||||
}
|
||||
|
||||
if (geometry_settings.get<ifcopenshell::geometry::settings::UseElementHierarchy>().get() && output_extension != DAE && output_extension != USD && output_extension != USDA && output_extension != USDC) {
|
||||
cerr_ << "[Error] --use-element-hierarchy can be used only with .dae or .usd output.\n";
|
||||
/// @todo Lots of duplicate error-and-exit code.
|
||||
write_log(!quiet);
|
||||
print_usage();
|
||||
IfcUtil::path::delete_file(IfcUtil::path::to_utf8(output_temp_filename));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (vmap[ifcopenshell::geometry::settings::WeldVertices::name].defaulted()) {
|
||||
geometry_settings.get<ifcopenshell::geometry::settings::WeldVertices>().value = false;
|
||||
}
|
||||
@@ -831,6 +840,11 @@ int main(int argc, char** argv) {
|
||||
geometry_settings.get<ifcopenshell::geometry::settings::TriangulationType>().value = ifcopenshell::geometry::settings::TriangulationMethod::POLYHEDRON_WITH_HOLES;
|
||||
}
|
||||
|
||||
if (output_extension == SVG) {
|
||||
// SVG serialiazation depends on element hierarchy now to look up the parent
|
||||
geometry_settings.get<ifcopenshell::geometry::settings::UseElementHierarchy>().value = true;
|
||||
}
|
||||
|
||||
boost::shared_ptr<GeometrySerializer> serializer; /**< @todo use std::unique_ptr when possible */
|
||||
if (output_extension == OBJ) {
|
||||
// Do not use temp file for MTL as it's such a small file.
|
||||
@@ -875,15 +889,6 @@ int main(int argc, char** argv) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (geometry_settings.get<ifcopenshell::geometry::settings::UseElementHierarchy>().get() && output_extension != DAE && output_extension != USD && output_extension != USDA && output_extension != USDC) {
|
||||
cerr_ << "[Error] --use-element-hierarchy can be used only with .dae or .usd output.\n";
|
||||
/// @todo Lots of duplicate error-and-exit code.
|
||||
write_log(!quiet);
|
||||
print_usage();
|
||||
IfcUtil::path::delete_file(IfcUtil::path::to_utf8(output_temp_filename));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
const bool is_tesselated = serializer->isTesselated(); // isTesselated() doesn't change at run-time
|
||||
if (!is_tesselated) {
|
||||
if (geometry_settings.get<ifcopenshell::geometry::settings::WeldVertices>().get()) {
|
||||
|
||||
@@ -86,6 +86,8 @@ def main(
|
||||
geom_settings = ifcopenshell.geom.settings(
|
||||
# when not doing booleans, proper solids from shells isn't a requirement
|
||||
REORIENT_SHELLS=settings.subtract_before_hlr,
|
||||
# SVG serialiazation depends on element hierarchy now to look up the parent
|
||||
ELEMENT_HIERARCHY=True,
|
||||
)
|
||||
|
||||
# this is required for serialization
|
||||
|
||||
Reference in New Issue
Block a user