| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Press R while drawing a slab to switch between the free form polyline and a rectangle defined by two opposite corners. Picking the second corner creates the slab, so a rectangular slab takes two clicks. The provisional corners are written to the insertion polyline itself (with the first corner repeated to close the shape), so the slab preview, the side dimensions and the total length keep working as they are, and the distance/angle/coordinate inputs stay relative to the first corner. The rectangle is aligned to the custom transform orientation when there is one, and increment snapping rounds the sides of the rectangle instead of the diagonal that goes to the mouse, so rectangles drawn with the mouse get round dimensions. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The modal handling is now shared by `PolylineOperator.handle_rectangle_drawing`, which finishes the shape through a `finish` method that each of the three operators implements. Walls and profiles are generated from the 4 segments of the rectangle and, as the shape is closed, they are joined into a loop, the same as closing a polyline by hand. The rectangle is now built on the plane the tool is working on, since the profile tool can draw on XZ and YZ as well, and it always takes the coordinate of the axis it doesn't span from the first corner, so a rectangle stays planar even when the profile tool picks two corners that aren't. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
| Back | FazBrowse Home | New Git URL |
Closes #9326.
Adds a rectangle mode to the three polyline insertion tools. Press R while the tool is running to toggle it, then pick two opposite corners — the second pick completes the shape, so a rectangular slab is two clicks instead of four plus a confirmation.
The status bar shows Rectangle: ON/OFF, the mode is remembered between invocations so a series of rectangles doesn't need R every time, Backspace restarts the rectangle and Esc cancels the tool. Typed input still works: the distance/angle and X/Y inputs place the opposite corner, so an exact rectangle can be typed rather than drawn.
Implementation notes
The provisional corners are written into insertion_polyline itself, with the first corner repeated at the end so the shape reads as closed. That is what lets the existing ProductDecorator preview, the per-side dimension labels and the total length keep working without any decorator changes, and it means walls and profiles are generated and joined by the same code path as closing a polyline by hand.
Because the polyline then holds more than one point while the second corner is still being picked, calculate_distance_and_angle and calculate_x_y_and_z skip their "second to last point" reference when rectangle_mode is set, so typed distance and angle stay relative to the first corner.
Two details worth a look during review:
The shared modal flow lives in PolylineOperator.handle_rectangle_drawing, which finishes the shape through a finish method each of the three operators implements. Each modal gained three lines: the toggle, the instruction and status entries, and the handler call.
Testing