Commit Graph

22775 Commits

Author SHA1 Message Date
Andrej730 9bd9af6211 svgfill: fix gcc -Wcomment
Example:
```
src/svgfill/src/progress.h:2:1: warning: ‘/*’ within comment [-Wcomment]
```
2026-09-03 19:55:54 +05:00
Andrej730 a4503f72af ci: use python available from PATH to retrieve include
One less place to update on version change.
2026-09-03 19:55:54 +05:00
Andrej730 aea6badbaa build-bonsaiviewer-autodesk: install missing libs
CI was failing:
```
  The system library `dbus-1` required by crate `libdbus-sys` was not found.
  The file `dbus-1.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
  The PKG_CONFIG_PATH environment variable is not set.
```
2026-09-03 19:55:54 +05:00
Andrej730 e5f7981729 bonsaiviewer-autodesk: fix clippy 2026-09-03 19:55:54 +05:00
Andrej730 a8b59ee296 ci-lint: reuse astral-sh/setup-uv 2026-09-03 19:55:54 +05:00
Andrej730 462a05e662 black_to_github_annotations: inline dependency 2026-09-03 19:55:54 +05:00
Andrej730 2b7970509e Move ci script to .github/scripts 2026-09-03 19:55:54 +05:00
Andrej730 75da4e950d Remove check_repo_ci_jobs.py
Seems to be orphaned since 9fe40c3
2026-09-03 19:55:54 +05:00
Andrej730 5114ae26ea ci-ifcwrap-standalone: deduplicate wrapper building code 2026-09-03 19:55:54 +05:00
Andrej730 2613fb53ba ci: add paths missing from paths filter 2026-09-03 19:55:54 +05:00
Andrej730 f6ca05e32c ifcgeom: remove commented out map_impl(IfcCompositeCurve)
It was specific to occt, now it's superseded by `map_impl` residing in the same file, but it's kernel-agnostic.
2026-09-03 19:55:54 +05:00
Andrej730 5529bc0ffe Remove occt kernel citation
It was an artifact from `src/ifcgeom_schema_agnostic/CITATION.cff`, we already have `src/ifcgeom/CITATION.cff` to cover this.
2026-09-03 19:55:54 +05:00
Andrej730 a8e94d7097 Remove ifcgeom_schema_agnostic references
Removed long time ago during refactor ccde605
2026-09-03 19:55:54 +05:00
Andrej730 63c34d0f9d Remove ifcjni references (c2abc3f) 2026-09-03 19:55:54 +05:00
Andrej730 70bb008ff8 ci: dedup paths filters 2026-09-03 19:55:54 +05:00
Andrej730 403a23a976 ci: reuse push paths filter for pull_request 2026-09-03 19:55:54 +05:00
Andrej730 57a9e1e304 cmake: export document_serializer_rdb
There was an error building a standalone ifcwrap when previously built IfcOpenShell had rocksdb - `_ifcopenshell_wrapper.cpython-314-x86_64-linux-gnu.so: undefined symbol: _ZTV17RocksDbSerializer`.

`IFOPSH_WITH_ROCKSDB` propagated to the build, requiring rocksdb symbols, but `WITH_ROCKSDB` wasn't set and `document_serializer_rdb` target wasn't provided.
2026-09-03 19:55:54 +05:00
Andrej730 2db248e017 cmake/ifcwrap: skip insallation of .pyc files 2026-09-03 19:55:54 +05:00
Andrej730 d4fa8e4f62 cmake/ifcwrap: skip versioned .so files during source copy
E.g. files like `libTKBinTObj.so.7.8.1`. Same reasoning as for skipping other binaries.
2026-09-03 19:55:54 +05:00
Andrej730 b2a90920e1 cmake: build svgfill without BUILD_IFCPYTHON
Otherwise it will never be able to reach standalone ifcwrap build as in this case ifcopenshell is built first as a dependency without `BUILD_IFCPYTHON`.
2026-09-03 19:55:54 +05:00
Andrej730 ee12e36dcd cmake/ifcwrap: remove requirement for svgfill target
Since it's a plugin now and not linked directly.
`LIBSVGFILL` variable was set, but never used.
2026-09-03 19:55:54 +05:00
Andrej730 87fd9209e1 ci-ifcwrap-standalone: ccache swig build 2026-09-03 19:55:54 +05:00
Andrej730 e18d927b40 ci-ifcwrap-standalone: use ccache 2026-09-02 20:41:26 +05:00
Andrej730 5aaf2107a5 test_package: xfail for current binary
It's missing pyodide build and we already allowed it, test will start failing on the next binary bump.
bonsai-0.9.0-alpha2609021508
2026-09-02 20:08:33 +05:00
Andrej730 7826e7d177 ci: colorful output for pytest 2026-09-02 20:08:33 +05:00
Andrej730 6b176e8b4a ci: use github annotations to show in summary what test suite has failed
Otherwise they can get burried in logs.
2026-09-02 20:08:33 +05:00
Andrej730 b6550c5aba bonsai/make: unpin brickschema
It was pinned in 84dcee6b3 due to the back-then-latest package being too big and alpha version was fixing it (also see https://github.com/IfcOpenShell/IfcOpenShell/issues/4368 )
`brickschema` is now 0.7.9, so the pin is no longer needed
2026-09-02 20:08:33 +05:00
Andrej730 c23972d440 test_brick: fix warnings from sqlalchemy
When fixing warnings, noticed that was working a bit inproperly - `bnode` always end up being an empty list (because there's no `brick, A, REF.IFCReference` triple), so then passing empty list to `triples` resulted in selecting all nodes isntead of just the expected `bnode` (that's the behaviour `sqlachemy` was sending the warnings about - when empty lists unexpectedly selected everything).
2026-09-02 20:08:33 +05:00
Andrej730 4eb093eefa typing: modernize Generator annotations
`None, None` assumed by default.
Though this was introduced in Python 3.13, before 3.13 it only breaks if we'd do `typing.Generator[T]` (which is deprecated) -`collections.abc.Generator[T]` works fine, it seems it never had an arity check.
2026-09-02 20:08:33 +05:00
Andrej730 261d2ce9a2 stub: get_attribute_category to consider derived attrs 2026-09-02 20:08:33 +05:00
Andrej730 1fa5eebf0c sql, stream: raise for accessing derived attributes
Raising `AttributeError` is definitely wasn't correct here, since it
might push the code to assume it's a wrong entity type. Returning some stub value like `None` also could suggest incorrect derived attribute
value, leading to unexpected behaviour. So adding an error, so it would
propagate and code would need to be adjusted not to rely on derived
attributes, if it actually interacts with sql/stream.

`test_unit` was asserting that derived attr will return `None`, though
it was actually raising `AttributeError`.
2026-09-02 20:08:33 +05:00
Andrej730 2b0ebcee32 sql: remove debug prints 2026-09-02 20:08:33 +05:00
Andrej730 6b62723aae typing 2026-09-02 20:08:33 +05:00
Andrej730 66126d21bc test_package: remove the requirement for intel Mac build 2026-09-02 20:08:33 +05:00
Andrej730 c2f39a70a3 gitignore: ignore all shared objects in ifcopenshell folder
Using symlinks just for main libs/pluigins doesn't seems to resolve `$ORIGIN` for some reason - e.g. occt libraries appears to be missing. So symlinking everything, including the dependencies seems to be the way to create a dev environment.
2026-09-02 20:08:33 +05:00
Andrej730 1f627690b6 bonsai dev-requirements: add brickschema, rdflib 2026-09-02 20:08:33 +05:00
Thomas Krijnen d11440af65 Address failing tests
* import-mode=import-lib to prevent temp rename

* Skip some failing tests

* Update stub

* Fix decorator
bonsai-0.9.0-alpha2609021356
2026-09-02 15:56:15 +02:00
Thomas Krijnen 99f1051d18 Run black 2026-09-02 13:48:31 +02:00
Petru Conduraru df3d07e952 fix(ifctester): accept tuple results when chaining facet filters
Facet.filter() implementations broad-phase query with
ifc_file.by_type(), then check isinstance(elements, list) to decide
whether a previous facet already narrowed the candidate set. In
v0.9.0, file.by_type() returns a tuple instead of a list, so that
check silently failed and every facet after the first re-scanned the
whole model instead of the already-narrowed (possibly empty) set.
This let a prohibited Entity+Attribute applicability match instances
of the wrong class, e.g. an IfcSlab satisfying an "IFCWALL" Entity
facet's chain. Accept tuples too, matching how by_type() results are
actually returned now.
bonsai-0.9.0-alpha2609021135
2026-09-02 13:36:14 +02:00
Petru Conduraru e7370dff9f fix(sql): recognise derived attributes in sqlite_entity.__getattr__
get_attribute_category() returns 3 for a derived attribute, but
sqlite_entity.__getattr__() only branched on FORWARD (1) and INVERSE
(2), so any derived attribute (e.g. IfcSIUnit.Dimensions) fell
through to the final AttributeError instead of returning None, which
is what SQLite-linked files are documented to do since derived
attributes are not computed for them. Mirrors the DERIVED handling
already present in entity_instance.py's __getattr__.
2026-09-02 13:35:51 +02:00
Petru Conduraru 040bebedfb fix(ifcdiff): resolve elements by GlobalId via by_guid, not by_id
diff() looked up common elements with self.old.by_id(global_id) /
self.new.by_id(global_id), passing a GlobalId string into a method
that expects a STEP integer id. On v0.8.0 file.by_id() was a Python
wrapper that transparently dispatched strings to by_guid(), so the
bug was silent. v0.9.0's file class binds by_id directly to the
C++ instance_by_id(int), so it now raises
TypeError: in method 'file_by_id', argument 2 of type 'int'.
2026-09-02 13:35:16 +02:00
DesertSpringsCivil 65ce0f71c4 win: collect underscore-prefixed runtime plugin DLLs in build artifacts
Runtime plugins are canonically named `ifcopenshell_<kind>_<name>` (decorated_basename() in src/plugin/plugin.cpp, and the OUTPUT_NAME properties of the plugin targets), but the archive collection filtered on the dotted `ifcopenshell.` prefix, which matches only the core shared libraries. Every load-by-name plugin was therefore silently dropped from every win64 / win-arm64 zip.

Accept both prefixes, and extend the geometry-writer exclusion to the underscore form so the per-schema writers keep their existing Python-package-only treatment.

Fixes #9301
2026-09-01 19:51:34 +02:00
Richard Brice 4374c81981 Honour IfcAxis2PlacementLinear Axis/RefDirection in the loft builder (#9408)
* Honour IfcAxis2PlacementLinear Axis/RefDirection in the loft builder

make_loft() (src/ifcgeom/infra_sweep_helper.cpp), shared by
IfcSectionedSolidHorizontal and IfcSectionedSurface, mishandled a cross
section's IfcAxis2PlacementLinear in two ways:

1. A placement carrying Axis but no RefDirection was placed with a fixed
   [e_y | e_z | e_x] world-axis permutation that ignored the directrix.
   On any directrix not running along +X (e.g. a north-south road
   pavement, or anywhere along a curve) the profile came out mis-oriented
   or collapsed to a sliver.

2. When two adjacent CrossSectionPositions used direction vectors
   inconsistently (a raked RefDirection at one, a plain Axis at the
   other) make_loft() logged GEO 42, dropped the rotation for the whole
   segment and squared every cap -- and in one configuration left the
   sweep frame flipped, so OpenCASCADE failed to build the solid at all.

Now a small profile_basis() helper builds every cross section's frame the
same way: profile Y = Axis, profile normal = RefDirection, and -- when
RefDirection is absent -- profile normal = the directrix tangent, so the
section stays perpendicular to the path (buildingSMART IFC4.x-IF #147).

When the two bracketing placements ask for the same orientation the sweep
frame carries it, built against the curve. When they disagree the sweep
frame stays on the shared Axis (continuous with the neighbouring
consistent segments, so nothing flips) and each end's own authored
orientation is folded into its profile points via a change of basis, so
each end cap still lands exactly as authored while the body in between
keeps following the directrix. The all-equal and no-direction-vector
paths are unchanged.

The two mappings now also carry the raw RefDirection through on
cross_section, alongside the existing rotation matrix.

Adds C++ tests (a raked end logs no GEO 42; a directrix that does not run
along +X still lofts a full-size solid) and Python tests (uniform prism
raked at one end and square at the other; a north-south directrix keeps
its width; OffsetLateral/OffsetVertical are scaled by the model length
unit).

* Renames profile_rotations to profile_axis for consistency with profile_ref_directions
bonsai-0.8.6-alpha2609011735
2026-09-01 10:35:11 -07:00
Petru Conduraru e4190a1636 ifcgeom: keep one copy of same-identity duplicate loops via set semantics
Adopt the reviewer's suggestion on #9396: instead of counting how many
skips each duplicate identity has earned, record which duplicate
identities have already built once. The first occurrence builds, the
rest are skipped. Distinct-identity loops that only become duplicates
after point mapping behave as before. Set semantics are also robust if
the helper is ever driven over the same shell twice, where a consumed
counter would under-build.
2026-09-01 19:32:59 +02:00
Petru Conduraru 1207338fa9 ifcgeom: keep one copy of repeated faces in faceset helper duplicate removal
Port of #8772 to v0.9.0 (open_cascade_kernel::faceset_helper is the
renamed class, same logic). When an IfcConnectedFaceSet repeats the
same IfcFace, wires() still dropped every occurrence via duplicates_,
leaving a hole in the shell; this counts the redundant occurrences
and skips only those, keeping one copy of each repeated face.
2026-09-01 19:32:59 +02:00
Petru Conduraru 66bcddc277 geom: expose a reusable kernel object to Python (prototype for #9417)
ifcopenshell.geom.create_shape constructs a geometry kernel, converter and
mapping on every call and discards them afterwards. For hybrid kernels the
construction alone rescans the plugin directory per component, which #9417
addresses on the C++ side by caching the resolved component ids. This
prototypes the alternative aothms suggested in the #9417 review: reuse the
constructed kernel itself from Python.

The wrapper gains a geometry_kernel class holding the converter (and through
it the kernel, mapping and conversion caches) built once per
(geometry_library, file, settings) triple, with create_shape(instance[,
representation]) delegating to the same helper the free create_shape uses,
now split so both paths share one body. Python gains
ifcopenshell.geom.kernel(settings, file, geometry_library) mirroring the
iterator constructor signature. The binding is fixed at construction:
settings are copied the way converter already copies them, and a guard
rejects instances from a different file because the mapping is file-bound.

On PGSuper_Import_Model.ifc (322 products, single-threaded, arm64 Linux),
hybrid-cgal-simple-opencascade drops from 71.97 ms/call with per-call
create_shape to 23.35 ms/call through the reused kernel, matching the
iterator (22.74 ms/call) without needing the #9417 cache; plain opencascade
is unaffected (23.30 vs 22.28 ms/call).
bonsai-0.9.0-alpha2609011726
2026-09-01 19:26:35 +02:00
Petru Conduraru e713fdb17e geom: cache hybrid kernel component resolution (#9371)
Constructing a hybrid kernel (e.g. hybrid-cgal-simple-opencascade) ran
find_kernel_match once per component on every construction. Each call
creates a plugin manager, walks the plugin search paths and loads every
geometry_kernel_* module from disk before matching the component name.
Named kernels only pay this once because they are registered in the
static registry after the first load, but a hybrid name is never
registered, so every iterator or create_shape construction repeated the
full scan (measured 28-100 ms per component on the reference model,
~70 ms extra per create_shape call; far worse on platforms where
library loading is expensive).

Cache the resolved component backend ids per hybrid name. The first
construction still performs the full discovery and registers the
matched modules; subsequent constructions build the components straight
from the registry without touching the disk.
2026-09-01 19:26:27 +02:00
Thomas Krijnen 4a81f72f32 Address quadratic inverse handling 2026-09-01 19:26:13 +02:00
Andrej730 5352d72815 build-all: use logger instead of print consistently ifcsverchok-0.9.0.260901 bonsai-0.9.0-alpha2609011313 2026-09-01 18:13:03 +05:00
Andrej730 2f7ab8852f build-all: document QT_DIR, QT6_VERSION variables 2026-09-01 18:13:03 +05:00