Commit Graph

65 Commits

Author SHA1 Message Date
Ryan Schultz 9fd119bf95 Bonsai: custom display names for links
Each link row draws an editable display_name (double-click to rename)
with the file path as placeholder while unset, so several links of the
same file can be told apart. The name persists in the same Description
JSON blob as the filter and loaded state (new name key, written at
save time and by reload_link), restores on project open, and plain
legacy strings still decode unchanged. Decode tests updated to the
four-tuple with a name round-trip case.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-11 10:37:57 -05:00
Ryan Schultz 94ba41d9ea Bonsai: unit tests for link filter helpers + refactor notes
Adds test/tool coverage for the pure link helpers:
encode/decode_link_filter (plain round-trip, JSON promotion for
exclude and loaded, legacy and malformed decode) and
get_link_cache_paths (legacy names, include-only hash pinned to the
pre-exclude formula so existing caches stay valid, and the
same-include/different-exclude collision case the key exists to
prevent). 12 tests, verified passing under Blender python.

Documents the deliberate undo-system exemption on the link transform
autosave handler, and records the deferred refactors in the dev note:
an upstream exclude= parameter for filter_elements (separate
ifcopenshell-python PR) and the skipped core/tool interface ceremony.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-11 10:06:15 -05:00
Ryan Schultz cd5897d10d Note STEP p21e3 as the long-term serialization target in the dev note
ANCHOR/REFERENCE sections and anchor tags (unimplemented in
ifcopenshell, #668) are the standards-track home for the link
reference and its metadata; records the migration path, the identity
and archive-transport design points the branch already conforms to,
and the scope that would remain app-level regardless.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-11 09:31:02 -05:00
Ryan Schultz e0b97c574b Bonsai: auto-load links that were loaded and visible at save time
At IFC save time each link reference Description gains a loaded flag
(is_loaded and not is_hidden), extending the same JSON blob that
carries the include/exclude filter; plain legacy strings decode as
no-autoload. On project open, load_linked_models_from_ifc replays
flagged links via load_link after restoring the list, warning and
skipping missing files so they cannot break the open.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-11 09:08:51 -05:00
Ryan Schultz 429cab8b1b Note Include/Exclude UI labels in the dev note
The displayed labels changed from Query to Include to pair with
Exclude; the property identifier stays query for script and
persistence compatibility.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 18:05:10 -05:00
Ryan Schultz 12ecdf2aba Bonsai: reload-all-links button in the Links panel header
bim.reload_all_links reloads every loaded linked model via
argument-less reload_link calls, so each link replays its stored
path/query/exclude and rebuilds its cache from disk. Unloaded links
are left alone. Drawn as a refresh button beside Link IFC.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 15:51:59 -05:00
Ryan Schultz 8f9164bf72 Bonsai: include/exclude filter pair for linked models
A single selector query cannot express set differences (the grammar
only unions groups, and the parent facet cannot negate), so links now
carry an Exclude query beside the include, mirroring the drawing
Include/Exclude pattern: final set = include (or the default set when
empty) minus exclude. Applied in LoadLinkedProject and per link in
create_drawing so prints match the viewport.

The cache key hashes both strings when an exclude exists - keying on
the query alone would let same-include/different-exclude links serve
each other's geometry. Include-only filters keep the pre-exclude hash
and empty filters the legacy names, so existing caches stay valid.
Persistence in IfcDocumentReference.Description stays backwards
compatible: a plain include is stored as-is, an exclude promotes the
value to a small JSON blob, and non-JSON decodes as a legacy include.

The Exclude field appears in Link IFC and the Reload Link dialog
(carried through the file browser round trip, SKIP_SAVE like the rest).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 15:26:33 -05:00
Ryan Schultz 403308a923 Bonsai: keep linked models cut linework in BISECT cut mode
BISECT cut mode deletes the serializer cut linework and regenerates it
by bisecting Blender mesh objects, which linked models do not have -
their cuts were deleted and never regenerated, so linked elements only
appeared as projections and the .cut CSS rule never applied to them.
remove_cut_linework now only removes cut groups whose guid resolves in
the host file, keeping the serializer cut geometry for linked models.

Resolving a linked entity STEP id via tool.Ifc.get_object cross-matches
into the host session and can return an arbitrary host object (e.g. the
drawing camera), so generate_material_layers and the linework merge now
guard on element.file identity.

BISECT mode also runs move_projection_to_bottom like OPENCASCADE mode:
its own bisect cuts are appended last, but the retained serializer cuts
of linked models are emitted before the projections and would paint
underneath.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 09:34:08 -05:00
Ryan Schultz 236da3c75a Bonsai: draw moved and multi-linked models at their displayed locations
create_drawing opened linked IFCs raw, so a moved link serialized at
its original coordinates and its elements fell outside the drawing.
The stored link transformation is the model-space delta, so it is now
baked into the linework iterator via the model-offset/model-rotation
settings (Trans @ Rot composition matches the rigid matrix
decomposition; the plan-view Z offset adds onto the translation).

The serialization loop also collapsed same-file links into a dict
keyed by filepath, dropping all but the last link. It now iterates one
entry per link and intersects each link's drawing elements with its
selector query, so drawings show what each link displays in the
viewport. Adds tool.Project.get_link_transformation_matrix as the
shared accessor for the stored 4x4.

Verified headless: window link moved +5m appears offset by exactly
5m x scale; unmoved door link at its native position; both present.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 09:34:08 -05:00
Ryan Schultz cf58c675db Bonsai: match linked model documents by resolved path
get_linked_models_documents keyed documents by the stored Location, so
linking the same file first with a relative path and then an absolute
one (or vice versa) created a duplicate IfcDocumentInformation. Both
the keys and the LinkIfc lookup now normalize through resolve_uri.

Also record the PR #8242 review round decisions in the dev note.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 09:31:41 -05:00
Ryan Schultz 5ea11817ad Add dev-notes for Linked_File_Features branch
Living design note per the docs/dev-notes convention: problem, key
facts (library-per-path reuse, SKIP_SAVE last-used-property retention,
IfcDocumentReference conventions, link matrix math), per-feature design
decisions, commit map, and open test items.

Generated with the assistance of an AI coding tool.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 09:31:41 -05:00
Andrej730 dbb4e91d55 apply cmake file formatting 2026-01-26 17:10:03 +05:00
Andrej730 13be6ccd45 Sort imports 2025-12-19 18:53:14 +05:00
Dirk Olbrich 7806dc1d6a docs: include doxygen-awesome as git submodule 2024-04-16 11:28:55 +02:00
Dirk Olbrich 9f0a781d05 docs: add README with instructions 2024-04-16 11:27:33 +02:00
Dirk Olbrich 15d58e32d1 docs: modify doxygen config to new folder 2024-04-16 11:27:33 +02:00
Dirk Olbrich 05b3a55e08 docs: move C++ API docs to subfolder 2024-04-16 11:27:33 +02:00
Dirk Olbrich b298f24275 docs: include doxygen-awesome theme 2024-04-16 11:27:31 +02:00
Dirk Olbrich 97a261ba54 docs: remove duplicate cmake for Sphinx setup 2024-04-16 11:26:47 +02:00
Dirk Olbrich fcfaa5238e docs: remove geom setting docs and images
- these are duplicated in /src/ifcopenshell-python/docs/ifcopenshell/
2024-04-16 11:26:47 +02:00
Dirk Olbrich d7d1198a1a docs: update doxygen file to 1.9.8 2024-04-16 11:26:47 +02:00
Dirk Olbrich 576bd6742e docs: set LOOKUP_CACHE_SIZE 2024-04-16 11:26:47 +02:00
Dirk Olbrich 3db3e93d87 docs: update Doxyfile to v1.9.4
- specify ./output/doxygen as main path for output
- use relative paths for subfolder output
2024-04-16 11:26:47 +02:00
aothms 27eb9d340a sphinx theme 2021-02-06 15:24:17 +00:00
aothms af6aed80da Documentation changes 2021-02-06 15:10:41 +00:00
aothms ea34c3de85 Changes to docs 2021-02-05 12:01:57 +00:00
Thomas Krijnen 6aeddcabc0 Delete file 2021-02-05 11:54:03 +01:00
Thomas Krijnen 2703dce209 Small changes 2021-02-05 11:52:05 +01:00
Thomas Krijnen 8648b16e00 Small changes to script 2021-02-05 11:41:44 +01:00
johltn 30fa59960d Clean branch 2021-01-16 14:42:34 +01:00
johltn 6444376ecd Script to generate docs outside CMake 2021-01-15 07:30:09 +01:00
johltn 6e4bb95e82 Update 2021-01-03 13:10:57 +01:00
johltn efea9d429e Verbose 2021-01-02 15:48:34 +01:00
johltn 424069893e Include ifcparse 2020-12-28 06:38:06 +01:00
johltn b6cf97a291 Change RST file title 2020-12-21 09:32:52 +01:00
johltn f8e57b04b0 Update 2020-11-08 11:30:40 +01:00
johltn 3ca2a8be39 Update 2020-11-08 10:42:17 +01:00
johltn 1eaa2ca8b4 Update Doxyfile 2020-11-07 19:30:51 +01:00
johltn e366c15dde Update conf.py 2020-11-07 19:12:33 +01:00
johltn 63f0c87920 Try to fix index.rst and also incude python docs 2020-11-07 18:55:39 +01:00
johltn 247a285b68 Test customized Doxyfile 2020-11-07 18:41:15 +01:00
johltn a75ced62ce Try first commit 2020-11-02 12:43:17 +01:00
johltn c263012287 Modify conf 2020-11-01 12:13:54 +01:00
johltn 5aae70875d Change doxygen output directory abd try to commit generated docs 2020-11-01 12:03:49 +01:00
johltn 0fb6d5a903 Re Comment python doc generation in CMake 2020-11-01 11:09:00 +01:00
johltn 9d6468bbf6 Install sphinx with apt-get 2020-11-01 08:12:01 +01:00
johltn cb0a5c90e3 Test sphinx directly from Travis 2020-10-31 20:02:04 +01:00
johltn 6267187950 New test 2020-10-31 19:44:09 +01:00
johltn 3575aff235 Comment test section 2020-10-31 19:15:24 +01:00
johltn 54d5d4cc63 Try pip install for sphinx 2020-10-31 16:35:35 +01:00