| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…ment_vertices helpers Fixes found while building Bonsai alignment authoring on top of the alignment API: - _create_geometric_representation: typo creatIfcShapeRepresentation -> createIfcShapeRepresentation (crashed 3D representation of gradient curves). - get_mapped_segments: off-by-one — the second mapped segment of a two-segment mapping returned Segments[index] instead of Segments[index - 1]. - get_stationing_nest: matched the first nest containing any IfcReferent; now requires PredefinedType == "STATION" so position referents don't shadow the stationing nest. - create_as_offset_curve: offset-curve alignments never received a stationing referent; now establishes the stationing scheme exactly as create() does for start_station. - _get_segment_start_point_label: vertical CONSTANTGRADIENT/ CONSTANTGRADIENT label "P.V.I" -> "P.V.I.". - segment_vertices: restored helper returning (Start, End, TI, NI) control points per segment — needed by any PI-based editor and gone from the current API surface. New Saikei helper: clear_layout_segments — the layout functions only append and expose no clear/remove, so editing a layout (PI recalc, edit mode) needs a safe way to drop real segments while keeping the zero-length terminator and cleaning up mapped geometry without orphans. Tests included for all of the above (test/api/alignment). - segment_vertices: pass the entity_instance to map_shape directly — entity_instance.wrapped_data is gone in the 0.9 modular wrapper (verified against a locally built 0.9 runtime with the per-schema geometry-mapping plugins that the official win64 artifacts omit, upstream IfcOpenShell#9301/IfcOpenShell#9305). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Horizontal alignment authoring for IFC 4.3 in Bonsai, following the core/tool/UI three-layer pattern: - PI-method authoring: create an IfcAlignment + IfcAlignmentHorizontal and lay out LINE/CIRCULARARC segments from PI points and radii, with a full Blender object hierarchy for the alignment, layouts, segments and referents. - Live PI table: Civil 3D-style interleaved point/segment rows with editable E/N coordinates and curve radii, recalculating lengths, arc lengths and stations as you type. - Viewport picking: PolylineOperator-based PI picker with snapping and numeric input, auto-building the IFC segments on finish; a G-key PI edit mode with GPU tangent-line preview regenerates segments in place. - CSV import: merged into the single upstream operator id bim.import_alignment_csv, now routed through core.import_alignment_csv which also builds viewport hierarchies for aggregated child alignments and materializes generated referents. - Stationing: basic add-stationing-referent operator plus unit-aware station formatting (100+50.00 imperial / 10+050.000 metric) derived from the project LENGTHUNIT. - Also includes an IfcStore fix: cache/cache_path class attributes were set by tool.Ifc but never declared on IfcStore nor reset by purge(), leaking the HDF5 cache across projects (4 lines in bim/ifc.py). Shared-file footprint in existing Bonsai files is small and additive: bim/__init__.py (+2), bim/ui.py (+20: CIVIL tab entry + one tab panel), bim/prop.py (+1: CIVIL tab tuple), core/tool.py (+29: Alignment interface), tool/__init__.py (+1), pytest.ini (+2 markers), test/core/bootstrap.py (+10: alignment Prophecy fixture). Everything else is new files under bim/module/alignment/, core/alignment.py, tool/alignment.py and tests. Tests: 17 core (Prophecy), plus tool and operator suites for PI math, IFC segment creation, hierarchy management, PI edit mode, CSV import and station formatting (Blender headless). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
IfcAlignment appears in the Add Element Definition dropdown (IFC4X3+); creating one bootstraps the horizontal layout, stationing referent, zero-length terminator, origin placement, and project aggregation via add_horizontal_layout_to_alignment, which is rewritten to mirror align_api.create()'s sequence (fixing a module-called-as-function TypeError and a scrambled add_stationing_referent argument order the unused route had masked). Root-module footprint: +32 lines across tool/root.py, root/data.py, root/operator.py. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
@DesertSpringsCivil - cool! I'll take a look at this as soon as I can. Since you branched from 0.9.0, there may be some conflicts with the alignment api, but nothing we can't figure out. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
What this is
The first of a series of PRs bringing Saikei Civil's alignment authoring to Bonsai on the v0.9.0 line. This foundation PR contains horizontal alignment authoring end-to-end, plus a set of correctness fixes to ifcopenshell.api.alignment found while building on it.
The whole review surface on existing upstream code is ~69 additive lines across 8 shared files — everything else is new files (new Bonsai module, new tool/core layers, tests). No existing behavior is modified except the six API bug fixes below and a 4-line IfcStore attribute fix.
Bonsai side (feat(bonsai), 22 files)
API side (fix(api.alignment), 15 files)
Six correctness fixes, each with a red→green regression test:
Plus two helpers Bonsai needs: clear_layout_segments and segment_vertices.
Testing
Notes for maintainers
🤖 Generated with Claude Code