Commit Graph

22517 Commits

Author SHA1 Message Date
Dion Moult b7d2b2fa3a bonsaiviewer: show pool and device VRAM in the performance stats
FrameStats gains the geometry pool's used/capacity bytes and, on desktop,
the device-wide used/total reported by the driver (NVML via dlopen, or
amdgpu/i915 sysfs, matched to the wgpu adapter's vendor/device id so a
switchable-graphics laptop reports the card wgpu actually picked). The
device query is polled once a second, not per frame. Web has no VRAM
query, so the device figure is omitted there.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-25 07:42:12 +10:00
Andrej730 5fa14c3dea IfcAlignment examples: fix Wunknown-pragmas
gcc was complaining, because it couldn't recognize msvc pragmas
bonsai-0.9.0-alpha2608242134
2026-08-24 19:18:00 +05:00
Andrej730 7fa8506fac build-all: test examples if they were built 2026-08-24 19:11:10 +05:00
Andrej730 9d68e7b9ca build-all: support --occt-shared 2026-08-24 19:11:10 +05:00
Andrej730 9ffbfe0dbb build-all: fix missing is_on_off
Update build-all.py
2026-08-24 19:10:28 +05:00
Andrej730 5b00c8b451 build-all: add --help and verify args 2026-08-24 18:50:23 +05:00
Andrej730 a5b6f83a3d Normalize whitespaces in cmake files 2026-08-24 18:50:23 +05:00
Andrej730 908d85a51a IfcAdvancedHouse: report an error in case serialization fails
Instead of a crash
2026-08-24 18:50:23 +05:00
Thomas Krijnen 9089a20ce3 Add branch filter for v0.9.0 in CI workflow #9336 bonsai-0.8.6-alpha2608231542 bonsai-0.8.6-alpha2608231407 bonsai-0.8.6-alpha2608231326 2026-08-22 13:21:43 +02:00
Thomas Krijnen d4a5420851 Rename job to publish_ifctester_org 2026-08-22 13:18:20 +02:00
Thomas Krijnen 87bc6bfbab Add string decode/encode api 2026-08-22 13:12:36 +02:00
Petru Conduraru a5e94cf0d8 Version and SOVERSION for geometry_serializer 2026-08-22 13:04:57 +02:00
Dion Moult 2c1d445d5b ifcviewer-web: mint session model ids when a load is requested
A federated pick could be attributed to the wrong file. The model slot a
host sees — ElementRef::model_index, modelProgress's index — is a rank in
session_model_id order, and on web that id was minted at the END of the
sidecar read chain, after three network round trips. So the ranking was
the order the models' reads happened to finish in, not the order the host
added them. With ~40 similarly-sized models over HTTP, adjacent models
swapped and a click reported its neighbour's file; the host page then
asked for a GUID the file does not contain.

Mint the id at the top of loadSidecarMetadataWeb instead, which runs
synchronously from load_sidecar_from_source_c and therefore in the order
the host asked for its models. A load that fails partway just abandons
its id, and the ranks compact over the surviving models as before.

Positions are still positions, though: if one model fails to load, every
later index shifts down one and a host mapping index into its own list
silently drifts again. So also carry the source id — the handle the host
minted itself when it registered the file — through ElementRef into the
pick payload and getObjects rows, and document it as the way to attribute
an object to a file. ModelGpuData::web_source_id defaults to -1 now, since
0 is a real source id and cannot double as "none".

The test server grows a ?delay=<ms> knob so a test can force the losing
interleaving: georef-a is added first and served slowly, and its objects
must still come back as model 0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-21 11:30:56 +10:00
Dion Moult d86f89090b ifcviewer-web: draw the axis indicator (corner gizmo + orbit pivot)
The desktop viewport draws an RGB triad in the bottom-left corner and a
second one at the orbit target while navigating; the web build drew
neither. Both lived in the Qt-coupled OverlayRenderer, which only
ViewportWindow drives — the web host no-ops the overlay hooks — so the
wasm build had no path to them at all.

Lift them into AxisIndicatorRenderer, a Qt-free renderer in
IfcViewerCore, and drive it from ViewportCore::render for desktop and
web alike. Same move SectionGizmoRenderer already made; the drawing code
is unchanged apart from swapping qDegreesToRadians for CameraMath's kPiF.

Pivot visibility moves to the core with it: it was a QTimer on
ViewportWindow, so the afterglow couldn't follow the gizmo across. It is
now a Stopwatch deadline next to the drawing, with render() requesting
frames until an armed afterglow expires. Hosts keep the same three
triggers (on for orbit/pan drags, off on release, 600 ms on wheel).

The web demo shell's log overlay sat exactly on top of the corner gizmo,
so it shifts right of the 110 px box.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-21 11:16:41 +10:00
Andrej730 973f61c6dc express.h: remove non-snake case aliases (schemas are regenerated now) bonsai-0.8.6-alpha2608192307 2026-08-19 20:17:51 +05:00
Andrej730 f47aa4d81a Manually update other schemas 2026-08-19 20:17:51 +05:00
Andrej730 fa9a3383aa Use snake case in cpp consistently 2026-08-19 20:17:51 +05:00
Andrej730 104591a80b Normalize whitespaces in the codebase 2026-08-19 20:17:50 +05:00
Andrej730 030e6e5bb4 Regen cpp schemas 2026-08-19 20:17:50 +05:00
Andrej730 a031310a66 express/run.bat: rewrite in Python 2026-08-19 20:17:50 +05:00
Andrej730 436e3f7b2a Header_section_schema-definitions.h: use IFC_SCHEMA_API 2026-08-19 20:17:50 +05:00
Andrej730 335d571854 gltf_serializer: refactor proj code into a separate call 2026-08-19 20:17:49 +05:00
Andrej730 f78b380b71 express/mapping: fix breaking generation after f23db9440f
It was failing to map `int64_t` to `Argument_INT` enum.
2026-08-19 19:38:30 +05:00
Andrej730 2cebc3f60b typing 2026-08-19 19:38:30 +05:00
Andrej730 0a8159505d pyproject: black to format all files by default 2026-08-19 19:38:30 +05:00
Andrej730 301fba5a8b Bump ty to 0.0.72 2026-08-19 19:38:30 +05:00
Andrej730 ba90cf220d black, ruff 2026-08-19 19:38:29 +05:00
Andrej730 6318892a97 Script to check whitespace issues in the codebase 2026-08-19 19:33:08 +05:00
Dion Moult 1a6336bd20 Output test audits to sqlite 2026-08-18 13:50:14 +10:00
Richard Brice 511584b36f Allows key point referents to be nested to the parent alignment in the reusing horizontal scenario bonsai-0.9.0-alpha2608162204 2026-08-17 08:03:00 +10:00
Richard Brice f65de78c46 Strengthens implementation of station_to_string. Adds alignment name to stationing referent. 2026-08-17 08:03:00 +10:00
myoualid 59b957daff fixes to sequence.create_baseline:
- assert isinstance(res, list) was wrong because duplicate_task returns a tuple not a list
- removed overkill assertion anyway as the usecase is already typed.
- setting optional name or reuse planned schedule name
- usecase now returns created baseline work schedule
2026-08-17 08:03:00 +10:00
Thomas Krijnen 81a0941d5a Apply suggestion from @aothms 2026-08-17 08:03:00 +10:00
BelGraDev dba735f1ee Fixed error when accessing the UnitType attribute in convert_file_length_units 2026-08-17 08:03:00 +10:00
Andrej730 e100cf5a34 Fix examples linking errors for shared build (incorrect attributes order)
E.g. IfcAdvancedHouse:
```
/usr/bin/x86_64-linux-gnu-ld.bfd: CMakeFiles/IfcAdvancedHouse.dir/IfcAdvancedHouse.cpp.o: in function `main':
IfcAdvancedHouse.cpp:(.text.startup.main+0x137): undefined reference to `hierarchy_helper<Ifc4x3_add2>::addBuilding(Ifc4x3_add2::IfcSite, Ifc4x3_add2::IfcOwnerHistory)'
/usr/bin/x86_64-linux-gnu-ld.bfd: IfcAdvancedHouse.cpp:(.text.startup.main+0x7c7): undefined reference to `hierarchy_helper<Ifc4x3_add2>::getRepresentationContext(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/bin/x86_64-linux-gnu-ld.bfd: IfcAdvancedHouse.cpp:(.text.startup.main+0x931): undefined reference to `hierarchy_helper<Ifc4x3_add2>::getRepresentationContext(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
```

Noticed by addressing gcc warning gcc warning that attribute order is incorrect:
```
//src/ifcparse/hierarchy_helper.i:721:31: warning: attribute ignored in explicit instantiation ‘class hierarchy_helper<Ifc2x3>’ [-Wattributes]
  721 | template IFC_SCHEMA_API class hierarchy_helper<IfcSchema>;
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
//src/ifcparse/hierarchy_helper.i:721:31: note: no attribute can be applied to an explicit instantiation
```
2026-08-14 17:38:47 +05:00
Andrej730 665502cbc5 .gitignore: ignore compile_commands.json at root for clang convenience 2026-08-14 15:37:05 +05:00
Andrej730 252831d7f0 .clang-tidy: drop removed AnalyzeTemporaryDtors
Resolves the error below. This option was removed in clang 18.
```
.clang-tidy:4:1: error: unknown key 'AnalyzeTemporaryDtors'
AnalyzeTemporaryDtors: false
```
2026-08-14 15:34:42 +05:00
Andrej730 3a6055a558 build-all: document undocumented args 2026-08-14 13:03:20 +05:00
Andrej730 7b1b0b986c build-all: use global constants for flags consistently 2026-08-14 13:03:20 +05:00
Andrej730 cd34d92fdb build-all: add flag to build examples
Useful to reproduce issues with examples locally
2026-08-14 12:54:31 +05:00
Andrej730 1391c7d974 Bump pyodide version to fix the build
0.29.3 have an older version of micropip and is affected by https://github.com/pyodide/pyodide/issues/6177
2026-08-14 12:08:32 +05:00
Andrej730 223d6da3b1 Reapply "build_pyodide: try more recent pyodide-build"
This reverts commit 1a931ddfd9.
2026-08-14 12:03:29 +05:00
Andrej730 171e899eb0 Add script to quickly pack wasm wheel after local build-all 2026-08-14 12:03:29 +05:00
Andrej730 e2561ffa3b black, sort imports 2026-08-14 10:17:02 +05:00
Dion Moult 4b87ab5d0d Fix warnings in test suite due to undeclared wall pytest marker 2026-08-14 06:44:11 +10:00
Thomas Krijnen 8cc36f0d4d Add link dependency on native build to resole example failure 2026-08-13 05:13:35 +02:00
Dion Moult 13cc190849 Update georef tests to not hardcode the results of vert[0] used in auto origin detection.
Because vert[0] can change based on kernel output, we now assert that 1)
origins are on a vert, any vert, and 2) both blender coords and map
coords are what we expect. I manually visually verified all tests
against Blender 5.1 + stable 0.8.5 to check that actual behaviour hasn't
changed, only tests need updating.
2026-08-13 11:20:26 +10:00
Dion Moult b71354ce19 Fix assigning a plain material to an occurrence as a layer set
Assigning a material to an occurrence with a set material type has raised
"IfcMaterial cannot be assiged as a IfcMaterialLayerSetUsage" since the
default changed to assigning usages to occurrences. The type is upgraded to a
usage but the material is passed on unchanged, and material.assign_material
only accepts a material for a usage when that material is already the set,
whereas the Object Materials dropdown gives us a plain IfcMaterial. Pass
nothing in that case and let the API make the set, as it does when asked for
a usage with no material.

Look the set up past the usage afterwards, so the material the user picked is
added to it. get_material returns the usage, which is not a material set, so
neither branch of the repair below matched and the picked material was
dropped, leaving the set empty.

This is a stopgap and is commented as such: the real problem is that
assign_material builds sets with no items in them and ignores the material it
was given, which is not valid IFC and leaves callers patching up after it.

Also register "I evaluate expression" as a Then step. It has only ever been a
Given and a When, so the last line of the scenario covering this could never
run; it is the only Then of its kind in the suite.

test/bim goes from 16 failures to 15, with none introduced.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-12 10:28:15 +10:00
Dion Moult 17042f6f80 ifc4d: make ScheduleIfcGenerator's boilerplate file actually work
create_boilerplate_ifc sets self.file and self.work_plan and returns
nothing, but create_ifc assigned its result back over self.file, so any
caller that did not supply a file got None and crashed on the next
create_entity. Call it for its side effects, as csv2ifc and csv4d2ifc
already do.

That alone only moved the failure along: the boilerplate builds a file and a
work plan but no IfcProject, and add_work_calendar looks for an IfcContext.
Create one, matching csv4d2ifc's copy of the same method, which has both
lines.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 21:30:27 +10:00
Dion Moult beb0db89e5 ifc4d: rewrite the MS Project importer onto ScheduleIfcGenerator
msp2ifc parsed the XML and built the IFC itself, so a programme read
differently depending on whether it came out of MS Project or P6. It now
parses only, and hands the parsed programme to ScheduleIfcGenerator the way
p62ifc does. Calendars, statuses, task times and resources are therefore the
shared ones, and a reader no longer has to know which tool planned the
schedule.

Three things MS Project does differently needed handling rather than sharing.

It has no work breakdown structure: there is one flat task list and an
OutlineLevel column, and a task with anything indented under it is a summary
whose dates are rolled up rather than planned. Those become IfcTasks without
an IfcTaskTime, as a P6 WBS node does. Summaries and leaves also interleave,
and a planner expects a summary to stay where they put it, so the tree is
walked in export order instead of through create_tasks, which sorts nodes
ahead of activities. And a link may hang off a summary, which P6 cannot do,
so create_rel_sequences resolves both ends against summaries too --
IfcRelSequence relates two IfcProcesses and does not require a time on
either.

Calendar handling flattens what MS Project stores as differences against a
base calendar, since IfcWorkCalendar has no such notion, and reads holidays
from whichever of the two spellings the export uses rather than both.
Recurring exceptions are skipped, because the recurrence is not readable from
the export and guessing wrong silently moves every date computed from the
calendar.

In common.py the UDF and activity-code property set names become class
attributes. They keep their P6 names by default, but MS Project's extended
attributes are not P6 user-defined fields and now land in
MSP_ExtendedAttribute rather than under a name that says P6. IsMilestone
likewise prefers a source that states it outright -- MS Project has a
Milestone flag -- and falls back to the zero-duration test, which is all P6
gives us, so the other importers are unaffected.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 21:24:56 +10:00