Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
f09ca65
Initial investigation into lofting open profile with tags
aothms Dec 2, 2025
7098beb
Work towards v1.0 data model with encapsulated weak_ptr as basis for …
aothms Jan 4, 2026
2d7521e
Move template down to .cpp to prevent use of incomplete type
aothms Jan 6, 2026
3ae361b
Rerun codegen
aothms Jan 6, 2026
a1d2c90
Add enum to forward declarations for Ifc2x3::IfcNullStyle
aothms Jan 6, 2026
ccd91c0
No more messing around with specific sfinae as<>() in Select implemen…
aothms Jan 6, 2026
572a565
Fixes for gcc
aothms Jan 6, 2026
f2f4d62
Fix examples mostly
aothms Jan 7, 2026
088a6b7
Reinstate IfcAlignment example
aothms Jan 7, 2026
c57209f
Fixes
aothms Jan 7, 2026
bc46a8f
Fixes
aothms Jan 8, 2026
5b85a2c
Fix examples
aothms Jan 8, 2026
f9c791d
Fix examples
aothms Jan 8, 2026
f5b2358
Make Base::data() private, file::add(..., id)
aothms Jan 8, 2026
ae79996
Fix running of test/tests.py
aothms Jan 8, 2026
7f4d9e3
Add test about deletion
aothms Jan 8, 2026
69a4ad3
Remaining cpp changes
aothms Jan 10, 2026
5c92134
Hacks and fixes to get python code back in reasonable state
aothms Jan 10, 2026
b66b04b
Remove usage of .wrapped_item and some other fixes
aothms Jan 10, 2026
991556f
template as
aothms Jan 10, 2026
0604db0
typename
aothms Jan 10, 2026
0a9e29c
black
aothms Jan 10, 2026
07a01bc
Process derived attributes that are not redeclared (C++ has no knowle…
aothms Jan 13, 2026
7e5248d
Fix create_shape() overloads because SWIG does not map None for us an…
aothms Jan 13, 2026
2dd002b
Properly constuct type decl instances
aothms Jan 13, 2026
e4e4f31
Defer deletion so that traversal still works
aothms Jan 13, 2026
ffcc02f
Remove global create_entity() call
aothms Jan 14, 2026
9147938
Aggregate data types
aothms Jan 14, 2026
94427eb
Allow setting of history and future
aothms Jan 14, 2026
0a5dd78
Fix add entity with id
aothms Jan 14, 2026
1a4d750
Consistency of get_inverse calls
aothms Jan 14, 2026
136befd
Fix write() call
aothms Jan 14, 2026
64bf807
Fix add entity with id
aothms Jan 14, 2026
9e16531
Fix schema passing to file creation
aothms Jan 14, 2026
18c9140
Data types
aothms Jan 14, 2026
5748270
Initialization of header and file
aothms Jan 14, 2026
fbbc92c
Hashing solely based on identity
aothms Jan 14, 2026
cf3393b
black
aothms Jan 14, 2026
490fa92
Rework equality and get_info_2
aothms Jan 15, 2026
33f072e
Account for removed instance factory
aothms Jan 15, 2026
bee61cb
Accept exact schema_identifier in file()
aothms Jan 15, 2026
2d1250c
Global file for rule and derived attributes
aothms Jan 15, 2026
6cd1375
Rerun rule compilation for exists() on indeterminate
aothms Jan 15, 2026
43f7860
Small tweak to invocation of test/test_rules.py
aothms Jan 15, 2026
1f4c420
Re-enable setting logical with UNKNOWN in python
aothms Jan 15, 2026
742bfac
_remove, schema_identifier and test_file
aothms Jan 15, 2026
ed88214
Broaden __eq__ for type decl instances
aothms Jan 15, 2026
8c2e122
declaration property
aothms Jan 15, 2026
d82e1da
Don't leak parent id into type decl instances
aothms Jan 15, 2026
5c4046e
declaration as property
aothms Jan 15, 2026
8afba9a
Hack a bit to make sql tests run
aothms Jan 15, 2026
c089c11
Hack a bit to make stream tests run
aothms Jan 15, 2026
4ec643d
schema entity initialize() method, optional argument forwarding in fi…
aothms Jan 15, 2026
95a094d
Fix some schema generation issues
aothms Mar 26, 2026
dc12747
Rerun codegen
aothms Mar 26, 2026
9d69a71
Does SWIG prefer std::conditional_t over auto return type?
aothms Mar 26, 2026
8e42f35
Rework variable length token storage to use string pool; eliminate ne…
aothms Mar 26, 2026
fe6e9d8
Xml serializer proper specialization
aothms Mar 26, 2026
603cedc
Try some things: (a) fewer allocations - parse context pool; lexer st…
aothms Mar 27, 2026
95b3f7d
Don't include dot as special when doing float runs
aothms Mar 27, 2026
724cdb4
Move schemas into schemas/ subfolder
aothms Mar 31, 2026
a07f56d
Restructure and rename
aothms Mar 31, 2026
20ccf2b
Parameter naming
aothms Mar 31, 2026
f616c40
Add Codex-generated wrappergen
aothms Mar 31, 2026
a19d398
Vibe code an implementation that uses manifold
aothms Apr 7, 2026
a425bb6
Cache some hotpath inverses regarding context handling
aothms Apr 7, 2026
7d6c6bd
Fix iteration: prevent inserting nullptr equivalents into a set
aothms Apr 9, 2026
becd38c
Compilation fixes
aothms Apr 9, 2026
1840e3d
Add passthrough kernel
aothms Apr 9, 2026
4621fc9
Less useless logging
aothms Apr 10, 2026
2d5883f
Dilation of 2nd operands as a poor mans fuzziness
aothms Apr 10, 2026
b2fc0c0
Hierarchical index for inverses
aothms Apr 10, 2026
c684907
Reset weights
aothms Apr 13, 2026
a44f722
pasta errors
aothms Apr 13, 2026
11006f0
deque
aothms Apr 13, 2026
2018bcb
This needs some serious scrutiny
aothms Apr 13, 2026
aa10784
First slice plug-in refactor
aothms Apr 14, 2026
3824e7b
First start plug-in architecture
aothms Apr 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
48 changes: 38 additions & 10 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,15 @@ option(MINIMAL_BUILD "The build is to make a minimal version of IFC converter fr
option(WASM_BUILD "Build a WebAssembly binary." OFF)

option(ENABLE_BUILD_OPTIMIZATIONS "Enable certain compiler and linker optimizations on RelWithDebInfo and Release builds." OFF)
option(BUILD_SHARED_LIBS "Build IfcParse and IfcGeom as shared libs (SO/DLL)." OFF)
option(BUILD_SHARED_LIBS "Build IfcParse and IfcGeom as shared libs (SO/DLL)." ON)
option(MSVC_PARALLEL_BUILD "Multi-threaded compilation in Microsoft Visual Studio (/MP)" OFF)
option(USE_VLD "Use Visual Leak Detector for debugging memory leaks, MSVC-only." OFF)
option(USE_MMAP "Adds a command line options to parse IFC files from memory mapped files using Boost.Iostreams" OFF)
option(NO_WARN "Disable all warnings" OFF)

option(BUILD_IFCGEOM "Build IfcGeom." ON)
option(BUILD_IFCPYTHON "Build IfcPython." ON)
option(BUILD_IFCPARSE_EXPERIMENTAL_WRAPPER "Build the experimental Clang-generated ifcparse Python wrapper." OFF)
option(BUILD_CONVERT "Build IfcConvert executable." ON)
option(BUILD_DOCUMENTATION "Build IfcOpenShell Documentation." OFF)
option(BUILD_EXAMPLES "Build example applications." ON)
Expand All @@ -73,13 +74,13 @@ option(BUILD_PACKAGE "" OFF)

option(WITH_OPENCASCADE "Enable geometry interpretation using Open CASCADE" ON)
option(WITH_CGAL "Enable geometry interpretation using CGAL" ON)
option(WITH_MANIFOLD "Enable geometry interpretation using Manifold" OFF)
option(COLLADA_SUPPORT "Build IfcConvert with COLLADA support (requires OpenCOLLADA)." ON)
option(GLTF_SUPPORT "Build IfcConvert with glTF support (requires json.hpp)." OFF)
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(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)

Expand Down Expand Up @@ -119,6 +120,10 @@ if(MINIMAL_BUILD)
set(USD_SUPPORT OFF)
endif()

if(NOT BUILD_SHARED_LIBS)
message(FATAL_ERROR "IfcOpenShell now requires BUILD_SHARED_LIBS=ON.")
endif()

if((BUILD_CONVERT OR BUILD_GEOMSERVER OR BUILD_IFCPYTHON) AND(NOT BUILD_IFCGEOM))
message(STATUS "'IfcGeom' is required with current outputs")
set(BUILD_IFCGEOM ON)
Expand Down Expand Up @@ -168,14 +173,11 @@ if(NOT IS_ABSOLUTE ${INCLUDEDIR})
endif()
message(STATUS "INCLUDEDIR: ${INCLUDEDIR}")

if(BUILD_SHARED_LIBS)
add_definitions(-DIFC_SHARED_BUILD)
if(MSVC)
message(WARNING "Building DLLs against the static VC run-time. This is not recommended if the DLLs are to be redistributed.")
# C4521: 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
# There will be couple hundreds of these so suppress them away, https://msdn.microsoft.com/en-us/library/esew7y1w.aspx
add_definitions(-wd4251)
endif()
if(MSVC)
message(WARNING "Building DLLs against the static VC run-time. This is not recommended if the DLLs are to be redistributed.")
# C4521: 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
# There will be couple hundreds of these so suppress them away, https://msdn.microsoft.com/en-us/library/esew7y1w.aspx
add_definitions(-wd4251)
endif()

UNIFY_ENVVARS_AND_CACHE(BOOST_ROOT)
Expand Down Expand Up @@ -214,6 +216,26 @@ if(BUILD_IFCGEOM AND WITH_OPENCASCADE)
list(APPEND GEOMETRY_KERNELS opencascade)
endif()

message(STATUS "BUILD_IFCGEOM WITH_MANIFOLD: ${BUILD_IFCGEOM} ${WITH_MANIFOLD}")

if(BUILD_IFCGEOM AND WITH_MANIFOLD)
find_package(manifold CONFIG REQUIRED)
if(TARGET manifold::manifold)
set(MANIFOLD_LIBRARIES manifold::manifold)
elseif(TARGET manifold)
set(MANIFOLD_LIBRARIES manifold)
else()
message(FATAL_ERROR "Unable to determine manifold target")
endif()
add_definitions(-DIFOPSH_WITH_MANIFOLD)
set(SWIG_DEFINES ${SWIG_DEFINES} -DIFOPSH_WITH_MANIFOLD)
list(APPEND GEOMETRY_KERNELS manifold)
endif()

if(BUILD_IFCGEOM)
list(APPEND GEOMETRY_KERNELS passthrough)
endif()

if(GLTF_SUPPORT)
UNIFY_ENVVARS_AND_CACHE(JSON_INCLUDE_DIR)
if(NOT JSON_INCLUDE_DIR)
Expand Down Expand Up @@ -540,9 +562,15 @@ if(NOT Boost_VERSION LESS 105800)
add_definitions(-DBOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE)
endif()

add_subdirectory(../src/plugin plugin)

add_subdirectory(../src/ifcparse ifcparse)
set(IFCOPENSHELL_LIBRARIES IfcParse)

if(BUILD_IFCPARSE_EXPERIMENTAL_WRAPPER)
add_subdirectory(../src/wrappergen wrappergen)
endif()

if(BUILD_IFCGEOM)
# CGAL::CGAL target already has dependencies resolved.
if(WITH_CGAL AND CGAL_DIR)
Expand Down
2 changes: 1 addition & 1 deletion src/bcf/bcf/v2/visinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def build_viewpoint(element: entity_instance) -> mdl.VisualizationInfo:
Returns:
The BCF viewpoint definition.
"""
ifc_file = element.wrapped_data.file
ifc_file = element.file
unit_scale = ifcopenshell.util.unit.calculate_unit_scale(ifc_file)
elem_placement = ifcopenshell.util.placement.get_local_placement(element.ObjectPlacement)
elem_placement[:3, 3] *= unit_scale
Expand Down
2 changes: 1 addition & 1 deletion src/bcf/bcf/v3/visinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def build_viewpoint(element: entity_instance) -> mdl.VisualizationInfo:
Returns:
The BCF viewpoint definition.
"""
ifc_file = element.wrapped_data.file
ifc_file = element.file
unit_scale = ifcopenshell.util.unit.calculate_unit_scale(ifc_file)
elem_placement = ifcopenshell.util.placement.get_local_placement(element.ObjectPlacement)
elem_placement[:3, 3] *= unit_scale
Expand Down
2 changes: 1 addition & 1 deletion src/bonsai/bonsai/bim/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def import_attributes(
info = {a.name(): None for a in attributes}
info["type"] = element
else:
assert (entity := element.wrapped_data.declaration().as_entity())
assert (entity := element.declaration().as_entity())
attributes = entity.all_attributes()
info = element.get_info()
for attribute in attributes:
Expand Down
2 changes: 1 addition & 1 deletion src/bonsai/bonsai/bim/module/cost/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def _load_cost_item_quantities(cls, cost_item: ifcopenshell.entity_instance, dat
data["UnitSymbol"] = ifcopenshell.util.unit.get_unit_symbol(unit)
if quantity.is_a("IfcPhysicalSimpleQuantity"):
measure_class = (
quantity.wrapped_data.declaration()
quantity.declaration()
.as_entity()
.attribute_by_index(3)
.type_of_attribute()
Expand Down
2 changes: 1 addition & 1 deletion src/bonsai/bonsai/bim/module/debug/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def poll(cls, context):
return tool.Ifc.get()

def execute(self, context):
print(tool.Ifc.get().wrapped_data.to_string())
print(tool.Ifc.get().to_string())
return {"FINISHED"}


Expand Down
2 changes: 1 addition & 1 deletion src/bonsai/bonsai/bim/module/geometry/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ def lock_error_message(name: str) -> str:


def calc_delete_is_batch(ifc_file: ifcopenshell.file, context: bpy.types.Context) -> bool:
total_elements = len(tool.Ifc.get().wrapped_data.entity_names())
total_elements = len(tool.Ifc.get().entity_names())
total_polygons = sum([len(o.data.polygons) for o in context.selected_objects if o.type == "MESH"])
# These numbers are a bit arbitrary, but basically batching is only
# really necessary on large models and large geometry removals.
Expand Down
4 changes: 2 additions & 2 deletions src/bonsai/bonsai/bim/module/search/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def colourscheme_key(cls):
element = tool.Ifc.get_entity(obj)
if not element:
return default
keys = [a.name() for a in element.wrapped_data.declaration().as_entity().all_attributes()]
keys = [a.name() for a in element.declaration().as_entity().all_attributes()]
psets = ifcopenshell.util.element.get_psets(element)
for pset, properties in psets.items():
if pset.endswith("Common"):
Expand Down Expand Up @@ -124,7 +124,7 @@ def element_key(cls):
element = tool.Ifc.get_entity(obj)
if not element:
return []
keys = [a.name() for a in element.wrapped_data.declaration().as_entity().all_attributes()]
keys = [a.name() for a in element.declaration().as_entity().all_attributes()]
psets = ifcopenshell.util.element.get_psets(element, psets_only=True)
for pset, properties in psets.items():
if pset.endswith("Common"):
Expand Down
2 changes: 1 addition & 1 deletion src/bonsai/bonsai/tool/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -1800,7 +1800,7 @@ def import_item_attributes(cls, obj: bpy.types.Object) -> None:
item = tool.Ifc.get().by_id(props.ifc_definition_id)
allowed_attributes = [
a.name()
for a in item.wrapped_data.declaration().as_entity().all_attributes()
for a in item.declaration().as_entity().all_attributes()
if a.type_of_attribute()._is("IfcLengthMeasure")
]

Expand Down
39 changes: 19 additions & 20 deletions src/examples/IfcAdvancedHouse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@

#define IfcSchema Ifc2x3
#include "../ifcparse/macros.h"
#include "../ifcparse/Ifc2x3.h"
#include "../ifcparse/IfcBaseClass.h"
#include "../ifcparse/IfcHierarchyHelper.h"
#include "../ifcparse/schemas/Ifc2x3.h"
#include "../ifcparse/hierarchy_helper.h"

#include "../ifcgeom/Serialization/Serialization.h"

Expand All @@ -57,18 +56,18 @@ void createGroundShape(TopoDS_Shape& shape);

int main() {

// The IfcHierarchyHelper is a subclass of the regular IfcFile that provides several
// The hierarchy_helper is a subclass of the regular file that provides several
// convenience functions for working with geometry in IFC files.
IfcHierarchyHelper<IfcSchema> file;
file.header().file_name()->setname("IfcAdvancedHouse.ifc");
hierarchy_helper<IfcSchema> file;
file.header().file_name().setname("IfcAdvancedHouse.ifc");

IfcSchema::IfcBuilding* building = file.addBuilding();
auto building = file.addBuilding();
// By adding a building, a hierarchy has been automatically created that consists of the following
// structure: IfcProject > IfcSite > IfcBuilding

// Lateron changing the name of the IfcProject can be done by obtaining a reference to the
// project, which has been created automatically.
file.getSingle<IfcSchema::IfcProject>()->setName("IfcAdvancedHouse"s);
file.getSingle<IfcSchema::IfcProject>().setName("IfcAdvancedHouse"s);

// To demonstrate the ability to serialize arbitrary opencascade solids a building envelope is
// constructed by applying boolean operations. Naturally, in IFC, building elements should be
Expand All @@ -91,13 +90,13 @@ int main() {
// IfcFacetedBRep. If it would not be a polyhedron, serialise() can only be successful when linked
// to the IFC4 model and with `advanced` set to `true` which introduces IfcAdvancedFace. It would
// return `0` otherwise.
IfcSchema::IfcProductDefinitionShape* building_shape = IfcGeom::serialise(STRINGIFY(IfcSchema), building_shell, false)->as<IfcSchema::IfcProductDefinitionShape>();
auto building_shape = IfcGeom::serialise(file, building_shell, false).as<IfcSchema::IfcProductDefinitionShape>();

file.addEntity(building_shape);
IfcSchema::IfcRepresentation* rep = *building_shape->Representations()->begin();
file.add_entity(building_shape);
auto rep = building_shape.Representations().begin();
rep->setContextOfItems(file.getRepresentationContext("model"));

building->setRepresentation(building_shape);
building.setRepresentation(building_shape);

// A pale white colour is assigned to the building.
setSurfaceColour(file, building_shape, 0.75, 0.73, 0.68);
Expand All @@ -107,18 +106,18 @@ int main() {
TopoDS_Shape shape;
createGroundShape(shape);

auto ground_representation = IfcGeom::serialise(STRINGIFY(IfcSchema), shape, true);
auto ground_representation = IfcGeom::serialise(file, shape, true);
if (!ground_representation) {
ground_representation = IfcGeom::tesselate(STRINGIFY(IfcSchema), shape, 100.);
ground_representation = IfcGeom::tesselate(file, shape, 100.);
}
file.getSingle<IfcSchema::IfcSite>()->setRepresentation(ground_representation->as<IfcSchema::IfcProductDefinitionShape>());
file.getSingle<IfcSchema::IfcSite>().setRepresentation(ground_representation.as<IfcSchema::IfcProductDefinitionShape>());

IfcSchema::IfcRepresentation::list::ptr ground_reps = file.getSingle<IfcSchema::IfcSite>()->Representation()->Representations();
for (IfcSchema::IfcRepresentation::list::it it = ground_reps->begin(); it != ground_reps->end(); ++it) {
(*it)->setContextOfItems(file.getRepresentationContext("Model"));
auto ground_reps = file.getSingle<IfcSchema::IfcSite>().Representation().Representations();
for (auto& rep : ground_reps) {
rep.setContextOfItems(file.getRepresentationContext("Model"));
}
file.addEntity(ground_representation);
setSurfaceColour(file, ground_representation->as<IfcSchema::IfcProductDefinitionShape>(), 0.15, 0.25, 0.05);
file.add_entity(ground_representation);
setSurfaceColour(file, ground_representation.as<IfcSchema::IfcProductDefinitionShape>(), 0.15, 0.25, 0.05);

/*
// Note that IFC lacks elementary surfaces that STEP does have, such as spherical_surface.
Expand Down
Loading
Loading