Implements the ability to edit alignment PI (Point of Intersection)
positions after creation using Blender's standard transform tools:
- Back-calculate PI positions from existing IFC alignment segments
- Create temporary EMPTY objects at PI locations for editing
- Visual feedback via PIEditDecorator (yellow tangent lines, HUD)
- Modal operator handles G key movement, Enter to apply, Escape to cancel
- Regenerates alignment with new PI positions on apply
- Handles edge cases: single-segment, tangent-only, undo during edit
Architecture follows Bonsai patterns:
- Core layer: Business logic orchestration (enter/exit_pi_edit_mode)
- Tool layer: Math, IFC, and Blender implementations
- UI layer: Modal operator with PASS_THROUGH for standard transforms
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains project-specific context for Claude Code sessions.
It should NOT be pushed to origin (protected by pre-push hook).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add visual feedback during PI placement with PIPickerDecorator:
- Yellow tangent lines connecting placed PIs
- Rubber band line from last PI to cursor position
- Green circle markers at each PI location
- HUD text showing instructions and PI count
Follows Bonsai's established decorator pattern with GPU draw handlers.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace segment empty objects with actual curve geometry so that selecting
a segment in the Outliner highlights the corresponding line/curve in the
viewport.
Changes:
- Add get_segment_vertices() using IfcOpenShell's evaluate_segment() to
sample points along individual segments via the geometry engine
- Replace _create_segment_empty with _create_segment_curve that creates
Blender CURVE objects with actual geometry
- Remove single HorizontalCurve in favor of per-segment curves
- Supports all segment types (LINE, CIRCULARARC, CLOTHOID, spirals, etc.)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Zero-length segments are required by IFC to mark alignment ends but should
be invisible to users. This change:
- Adds helper methods to detect zero-length and empty layouts
- Silently skips geometry generation for empty alignments (no error messages)
- Excludes zero-length segments from Outliner display
- Uses separate visible segment counter for consistent naming
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix modal operator to use absolute mouse coordinates converted to 3D
viewport region space, instead of event.mouse_region_x/y which are
relative to whichever region received the event
- Store 3D viewport area, region, and region_data references in invoke()
for consistent raycasting throughout modal operation
- Add coordinate transformation methods (blender_to_ifc_coordinates and
ifc_to_blender_coordinates) for projects with geospatial Blender offsets
- Transform alignment curve vertices from IFC global to Blender local
coordinates when has_blender_offset is enabled
- Add try/except for piecewise-step-size geometry setting in util.py
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Simplifies the Horizontal Alignment panel by removing the Import
Alignment CSV button and the PI Details submenu that displayed
when selecting rows in the PI Editor list.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add RuntimeError handling for IfcOpenShell versions that don't support
the piecewise-step-type setting in geometry generation.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Git checkout with glob patterns (*.ifc) doesn't work on Windows.
This change:
- Expands glob via git ls-files and checks out files individually
- Skips symlink recreation if they already exist and are valid
- Refreshes git index before checkout to recognize deleted files
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace manual per-segment geometry creation with IfcOpenShell's
built-in generate_vertices() utility. This provides automatic support
for all curve types (CLOTHOID, spirals, etc.) and removes ~75 lines
of manual geometry code.
Changes:
- Add create_curve_from_representation() using IfcOpenShell geometry engine
- Add _create_segment_empty() for segment selection without geometry
- Update create_objects_for_layout_segments() to use new methods
- Delete manual geometry methods: create_object_for_segment(),
_create_line_segment(), _create_arc_segment()
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Operators removed (not called in any UI):
- SAIKEI_OT_create_alignment_polyline
- SAIKEI_OT_create_alignment_offset
- SAIKEI_OT_add_vertical_layout
- SAIKEI_OT_add_layout_segment
- SAIKEI_OT_layout_horizontal_by_pi
- SAIKEI_OT_layout_vertical_by_pi
- SAIKEI_OT_create_representation
- SAIKEI_OT_create_segment_representations
- SAIKEI_OT_update_fallback_position
- SAIKEI_OT_validate_segments
- SAIKEI_OT_refresh_alignment_data
Also fixed poll_ifc4x3() and replaced all tool.Alignment.get_ifc_file()
calls with tool.Ifc.get() after previous refactoring removed that method.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Although it is a very cool trick, I feel this essentially duplicates the
UI in two spots, and is an outlier in UX. I'd prefer for all IFC data
and relationships to be in one location only (the panels). I think there
are a better unified solutions (e.g. favourite bookmark panels) for
quick access for things like this.
To be consistent with all other settings, I've moved the visibility
config UI from inline into the add-on settings. This restores the
previous tab layout and no longer needs the "settings" icons to be
there. This also removes the need for a "enable UI config" checkbox.
Most of the code previously had dedicated operators to toggle booleans.
This has been removed. This new approach also means helpers aren't
needed.
Previously calculation of visibility was done on every draw (3x 10tabs x
10 collection items). The data class is intended to calculate UI data
once only which is more efficient. This also removes all helper calls
from the UI.