Commit Graph

22399 Commits

Author SHA1 Message Date
Thomas Krijnen 4e49b640a7 Own iterator geometry results
Return independent geometry copies with unique ownership, preserve parent lifetimes, and teach the Python wrapper to own derived results. Keep serializer inputs non-owning and replace Collada's deferred object with copied triangulation elements.\n\nGenerated with the assistance of an AI coding tool.
2026-08-08 15:18:51 +02:00
Thomas Krijnen c30841aad6 Remove unused adaptor element path
The optional adaptor element list was never assigned, so simplify IfcConvert to use its geometry iterator unconditionally.

Generated with the assistance of an AI coding tool.
2026-08-08 15:00:48 +02:00
Thomas Krijnen 4597929df9 Remove _t suffixes from public types
Rename header-scope aliases, enums, and helper types while retaining descriptive names where dropping the suffix would create a collision.

Generated with the assistance of an AI coding tool.
2026-08-08 14:58:26 +02:00
Thomas Krijnen 2859c1ef17 Use value serialization in sphere example
Update the stale pointer-form example and pass the IFC file required by the current serialization API.

Generated with the assistance of an AI coding tool.
2026-08-08 14:21:10 +02:00
Thomas Krijnen 7ae6bf4374 Rename geometry and serializer files
Apply the rename manifest, normalize serializer filenames to the classes they define, and update includes and CMake source lists.

Generated with the assistance of an AI coding tool.
2026-08-08 14:20:05 +02:00
Thomas Krijnen 02481b3247 Wrap more classes into ifcopenshell:: namespace 2026-08-08 13:58:39 +02:00
Thomas Krijnen 2c47c9d4fa Irrelevant comment 2026-08-08 13:30:47 +02:00
Thomas Krijnen c2abc3f844 Remove old Java Native Interface code 2026-08-08 13:29:29 +02:00
Thomas Krijnen 4dcd644a32 Deleted unmigrated examples 2026-08-08 13:10:01 +02:00
Thomas Krijnen 6fea72b045 Run black 2026-08-08 12:42:25 +02:00
Thomas Krijnen 1573730f18 Disambiguate naming 2026-08-08 12:35:44 +02:00
Thomas Krijnen 8f4832651a Track patch rename 2026-08-08 12:30:26 +02:00
Thomas Krijnen af58eaf79f Last minute refactoring 2026-08-08 07:42:45 +02:00
Thomas Krijnen 8870ffb018 Rework c++ docs 2026-08-08 03:44:56 +02:00
Andrej730 1a931ddfd9 Revert "build_pyodide: try more recent pyodide-build"
This reverts commit f7876a97ee.

There's some emscripten mismatch, will try to bump it later.
2026-08-07 20:04:46 +05:00
Andrej730 f7876a97ee build_pyodide: try more recent pyodide-build 2026-08-07 17:53:18 +05:00
Andrej730 4d0e5f6aee ifcopenshell.file: improve missing attribute error msg 2026-08-07 17:53:18 +05:00
Andrej730 dfc60196ec ifcwrap/cmake: fix using python:abc feature on older swig 2026-08-07 16:00:33 +05:00
Andrej730 ef4bba8b33 IfcGeomWrapper: remove stale IfcGeom::Matrix reference
It was removed long time ago in c78b289
2026-08-07 16:00:33 +05:00
Andrej730 e044b865dd pyodide/test_wheel: make it support modular wheels 2026-08-06 19:52:49 +05:00
Andrej730 47812b2d32 gitignore: ignore non-plugins shared objects too (--ifcopenshell-shared) 2026-08-06 19:49:54 +05:00
Andrej730 16e58f7369 build_pyodide: push built dependencies as build finished
As we do in build_rocky/build_osx already, allowing to push dependencies in case build succeeds but some later tests fail.
2026-08-06 19:49:54 +05:00
Andrej730 253918c100 serialization/cmake: remove dependency on geometry_kernel_opencascade
To fix wrapper depending on `ifcopenshell.geometry.kernel.opencascade.so` plugin, which breaks wasm module import (wrapper imported first and it fails because occt kernel isn't loaded yet and loading kernel first since it needs some symbols from the wrapper).

`geometry_serializer` seems to need `OpenCascadeConversionResult.h` from the kernel just to be able to refer to structs (`ConversionResultShape`, `OpenCascadeShape`) and include with relative path already allows it.
2026-08-06 19:49:54 +05:00
Andrej730 c57554a07e ifcwrap/cmake: dont link against geom kernels
Produces errors in wasm builds - we want to be able to load the wrapper first and all other dependencies should be pluggable. But loading wrapper first failed, because it depended on the kernels. Loading kernels first would also fail, since OCCT kernel is using using some symbols from core (`ifcopenshell::exception`) and in wasm they have to be resolved all during `dlopen`.
2026-08-06 19:49:54 +05:00
Andrej730 2aff2adb42 gitattributes: normalize .i swig templates line endings
IfcGeomWrapper.i was stored on index as CRLF and on Linux it sometimes produced distracting diffs, when working on the file.
2026-08-06 19:49:54 +05:00
Andrej730 3d05ccbd59 gitattributes: ensure platform dependent files are stored using correct line endings 2026-08-06 19:49:38 +05:00
Andrej730 027203008d black . 2026-08-06 19:11:27 +05:00
Dion Moult 74b405a9f7 Write GlobalId index when serializing to RocksDB
rocks_db_file_storage already exposes a `g|`-prefixed guid -> instance
name map, but RocksDbSerializer never populated it, so by_guid() on a
converted file always threw.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-06 10:20:03 +10:00
Dion Moult 38e0e0e297 Compare entity instances in one file by identity again
entity_instance.file is a property backed by a fresh SWIG wrapper on every
access, and ifcopenshell::file had no __eq__, so `self.file != other.file`
in entity_instance.__eq__ compared two throwaway wrappers and was always
true - even for an instance against itself. Every entity comparison
therefore took the deep get_info() branch, making distinct but structurally
identical instances compare equal and leaving the final `return False`
unreachable. Bonsai's TestAddRepresentationItemToShapeAspect showed this as
two separate IfcShapeAspects being treated as one, so the stale aspect was
never removed.

Restore the file_pointer() pair that was commented out on both
ifcopenshell::file and express::Base - IfcParseWrapper.i already described
it as the way to "trace file ownership of instances on the python side" -
and give file the __eq__/__hash__ it was missing. The express::Base one
needs $self->file() now that file_ lives on instance_data. This also
repairs rocksdb_lazy_instance.__eq__, which already called file_pointer().

EXPRESS `=` is value comparison and `:=:` is instance comparison, but
rule_compiler emits `==` for both (see the @todo on process_rel_op), and
derived attributes build their operands in the shared global file, so rules
compare same-file instances and need value semantics. Restore those for the
duration of rule execution with settings.compare_instances_by_value,
alongside the existing unpack_non_aggregate_inverses.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-06 10:20:03 +10:00
Andrej730 d1027c5877 build-all: fix missing CXXFLAGS in manual build (f8f4725)
In the mentioned commit I've dropped workaround, because issue upstream was resolved, but forgot to load flags from `pyodide` fro manual build.
2026-08-05 18:37:46 +05:00
Andrej730 d65df3665a split_pyodide_ifcopenshell_wheel: print some logs 2026-08-05 18:37:46 +05:00
Andrej730 393640b121 split_pyodide_ifcopenshell_wheel: add doc-string 2026-08-05 18:37:46 +05:00
Andrej730 5d6e3fbdc8 order_pyodide_wheel_shared_objects: explain why 2026-08-05 18:37:46 +05:00
Andrej730 24c3d855de build-all: drop workaround for expired mpfr ssl 2026-08-05 18:37:46 +05:00
Andrej730 ae4f5c92fb build-all: remove unnecessary quoting from annotations and Union 2026-08-05 18:37:46 +05:00
Andrej730 75a3bf0175 build-all: accept truthy/falsy values in more consistent way 2026-08-05 18:37:46 +05:00
Andrej730 beb5c1f7ed build_pyodide: use uv 2026-08-05 18:37:46 +05:00
Andrej730 8bdaa8c7cb build-all: ifcopenshell-shared
As we're not currently bundling dlls for all other external dependencies.
It seems `--shared`in CI previously  worked sort of by accident - since it was relying on the cached build outputs that were previously built statically.
2026-08-04 22:13:25 +05:00
Andrej730 3340d88b95 ifcwrap/cmake: add missing geometry_serializer runtime target installation
Caused errors like so:
```
Traceback (most recent call last):
  File "/__w/IfcOpenShell/IfcOpenShell/build/Linux/x86_64/install/python-3.13.6/lib/python3.13/site-packages/ifcopenshell/__init__.py", line 87, in <module>
    from . import ifcopenshell_wrapper
  File "/__w/IfcOpenShell/IfcOpenShell/build/Linux/x86_64/install/python-3.13.6/lib/python3.13/site-packages/ifcopenshell/ifcopenshell_wrapper.py", line 10, in <module>
    from . import _ifcopenshell_wrapper
ImportError: libifcopenshell.geometry.writer.so: cannot open shared object file: No such file or directory
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import inspect, ifcopenshell; print(inspect.getfile(ifcopenshell))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/__w/IfcOpenShell/IfcOpenShell/build/Linux/x86_64/install/python-3.13.6/lib/python3.13/site-packages/ifcopenshell/__init__.py", line 89, in <module>
    raise ImportError("IfcOpenShell not built for '%s' (%s)" % (python_distribution, e)) from e
ImportError: IfcOpenShell not built for 'linux/64bit/python3.13' (libifcopenshell.geometry.writer.so: cannot open shared object file: No such file or directory)
```
2026-08-04 22:10:31 +05:00
Andrej730 0e6e3edaa6 build-all: small alignment fix 2026-08-04 20:57:45 +05:00
Andrej730 ccb9be0940 build_rocky: add comments to the script 2026-08-04 16:21:01 +05:00
Andrej730 82f0a74ab2 Build workflows: drop stale line
It's a stale line from original approach (b599ee1040) that was using `bin` as a stage area. Now zip is packed right to `~/output`.
2026-08-04 16:20:17 +05:00
Andrej730 6c750b0fdb build-all: fix opencollada patch to support it being buildable as shared 2026-08-04 14:24:32 +05:00
Andrej730 6d21801e53 build-all: fix shared build failing because opencollada is always built as static 2026-08-04 14:24:32 +05:00
Andrej730 6c049e6d6b build-all: use colors in logs for readibility 2026-08-04 14:24:32 +05:00
Andrej730 108acf1cd0 build_rocky: rely on uv for providing Python 2026-08-04 14:24:32 +05:00
Andrej730 cf7a484ce1 black . 2026-08-04 14:24:32 +05:00
Dion Moult 6aeaba0e3d p62ifc: carry across what the P6 export actually says
Level of Effort activities were skipped outright. They are now imported as
IfcTask with PredefinedType ATTENDANCE, the nearest thing IFC has to support
work that spans what it hangs off. Their dates stay derivable: the SS/FS and FF
predecessors P6 computes the span from are ordinary relationships and are
written out like any other. Skipping them also dropped 970 relationships that
happened to touch one.

User defined fields and activity codes now land as P6_UDF and
P6_ActivityCodes property sets. Separate sets because they are separate
concepts in P6, and not IfcClassificationReference for the codes because they
are orthogonal facets rather than a hierarchy. A code's description goes on
IfcProperty.Description so the short value and the readable one both survive.
UDF types come from the root declarations, since that is the only place the
data type is known, and are written sparsely.

Task times are now transcribed rather than recalculated. edit_task_time exists
to keep a schedule self-consistent while somebody edits it, so it snaps dates
off non-working days and derives durations across the calendar: reasonable for
an editor, wrong for a transcription where P6 has already run the critical path
and its answer is authoritative. On one 4,181 activity programme it moved 3,534
start dates and disagreed with P6's own duration on 3,206 activities. Actual
dates, early and late dates, float and completion are now carried too, none of
which were written before.

WBS children are created in P6's SequenceNumber order rather than document
order. IfcRelNests keeps an ordered list, so this is all it takes for a reader
to recover the breakdown as the planner arranged it, and sorting any other way
shows a programme nobody recognises.

Also: the project name was read without the namespace map, so every schedule
came out called "Unnamed".
2026-08-04 15:35:30 +10:00
Dion Moult 409373d882 Assign / unassign sequence should be specific to sequence type
I previously incorrectly believed that sequence types are mutually exclusive. E.g. you can have max 1 relationship between two tasks. Now after looking at more schedules I realise it's logically allowed to have more than one sequence relationship. For example simultaneous SS + FF.
2026-08-04 13:01:23 +10:00
Dion Moult e678012c71 ifcpatch: run FixArchiCADToRevitSpaces headlessly
The recipe loaded the model into Blender purely to reach its geometry
engine, so it could only run inside Bonsai and needed a filepath instead
of a file. It is now a plain BasePatcher.

The three fixes Revit needs are unchanged. To lower each space onto its
storey we take the storey elevation from util.placement and the space
placement from util.shape, instead of from Blender object matrices. To
convert to an extruded area solid we triangulate the space with
ifcopenshell.geom, union its downwards facing triangles with shapely to
get the footprint and its voids, and rebuild the body with
util.shape_builder.

Unioning every downwards facing face, rather than only the vertices
sitting at z=0, means stepped and clipped spaces keep their full
footprint, columns poking through a room become profile voids, and
disjoint footprints extrude as one item each. Spaces that cannot be
patched are logged and skipped rather than aborting the run, and a
storey above the top of a space falls back to the space's own height
instead of asking for a negative extrusion depth.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-04 12:16:46 +10:00