Commit Graph

22381 Commits

Author SHA1 Message Date
Andrej730 54df93c001 build_pyodide: debug 2026-08-07 12:12:36 +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
Dion Moult 0b8875669e Let the viewport composite over what is behind it
Background colour gains a meaningful alpha. Below 1 the viewport composites
over whatever the host has stacked behind it rather than painting a colour
of its own; at 0 it clears to nothing, so the model draws over another 3D
view, a map, or ordinary page content. There is no depth interaction -- the
layer behind is strictly behind and cannot occlude the model.

Honouring the alpha needs a premultiplied surface. configureSurface asks for
one only when the platform advertises it, the same way it picks a present
mode, and falls back to Auto otherwise -- this machine's Vulkan surface
offers opaque compositing only, so hardcoding premultiplied would have
requested a mode it does not support. The clear follows that choice: scaled
by alpha when premultiplied, held at 1 when not, since scaling would
otherwise just darken the colour for an alpha nobody reads.

ViewportWindow::setBackgroundColor now forwards to core rather than writing
through a reference proxy, dropping one more member from the friend
declaration it is meant to shrink. The screenshot QImage is tagged
premultiplied to match what the main pass leaves in the buffer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-04 10:55:57 +10:00
Dion Moult c9f269a0e5 Draw a silhouette outline around the selection
The renderer tints the selection blue, which says nothing about an object
that is already blue. Add a halo drawn just outside the selected objects
instead: a fixed colour against the background, so it reads whatever the
element is painted.

The mask pass reuses the main shader module and pipeline layout and shares
the main depth buffer read-only, so the halo follows the selection as
visible -- an occluded object contributes nothing. A separable dilation
widens the mask into inner and outer rings, composited after the edge pass
so the edge multiply does not darken it.

On by default; IfcViewer.setSelectionOutline(false) gets the tint alone.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-04 10:55:57 +10:00
Andrej730 83a7836081 stub: document use_attribute_value_derived 2026-08-03 20:04:29 +05:00
Andrej730 cdf107e579 validate fixtures: validate expected error count 2026-08-03 19:51:10 +05:00
Andrej730 c1c94b9362 validate: document supported Path type 2026-08-03 18:44:06 +05:00
Andrej730 cb52013a5d validate: color output for readibility 2026-08-03 18:38:06 +05:00
Andrej730 de4ad60df3 validate: at the end print number of errors found 2026-08-03 18:24:59 +05:00
Andrej730 2fe177885e Drop unused log_entry_type named tuple (31cf1127a) 2026-08-03 18:24:47 +05:00
Andrej730 f457048285 rules fixtures: check number of expected failures 2026-08-03 17:51:26 +05:00
Andrej730 0e9ef70971 rules fixtures: append comment indicating fixture origin 2026-08-03 16:54:52 +05:00
Andrej730 ea0be33aa1 ifcopenshell.validate: typing for json logger statements 2026-08-03 16:54:52 +05:00
Andrej730 44ce7c7e8a rules fixture: nornallize headers
- to avoid some diffs on regeneration
- some fixtures had problems with the header, so `fail` for them wasn't
really testing the intended case, because small issues in the header
would make fixture fail regardless
2026-08-03 16:54:22 +05:00
Andrej730 e57c326ad1 rule fixtures: update fixture and generation script to match 4404470d9
IFCBSPLINECURVE is abstract and causing fail to fail even if point
dimensions wouldn't be checked.
2026-08-03 16:54:22 +05:00
Andrej730 5964160d67 rule fixtures: add missing generation scripts 2026-08-03 16:54:22 +05:00
Andrej730 26ab77bdf6 rule fixtures: script to regenerate all fixtures 2026-08-03 16:54:22 +05:00
Andrej730 7b2f4ad1cb rule fixture: update generation script to match a7e925b 2026-08-03 16:54:22 +05:00
Andrej730 8f67b905eb Fix ifcopenshell.file calls in rules fixtures, use simpler schema postfix 2026-08-03 16:54:22 +05:00
Andrej730 6edea83137 file.good - document return type 2026-08-03 16:54:22 +05:00