Commit Graph
51 Commits
Author SHA1 Message Date
Hakan SevenandClaude Sonnet 4.6 1d349c53af feat: LOFT command — ruled-surface loft through multiple cross-sections
Picks 2+ profile entities (closed or open wires), builds ruled shells
between consecutive pairs via builder::try_wire_homotopy, caps closed
ends with planar faces, and tessellates the result into a Solid3D mesh.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-08 18:08:53 +03:00
Hakan SevenandClaude Sonnet 4.6 063a1d5be1 feat: SWEEP command — sweep profile along Line/Polyline path
Picks a profile (closed or open 2D entity) then a path entity
(Line or LwPolyline). For Line paths uses tsweep along the line
vector; for Polyline paths uses start→end as translation direction.
Closed profiles produce a capped Solid; open profiles a Shell.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-08 18:07:00 +03:00
Hakan SevenandClaude Sonnet 4.6 549ae38459 feat: BOX, SPHERE, CYLINDER primitives + EXTRUDE / REVOLVE commands
BOX, SPHERE, and CYLINDER build truck topology solids and tessellate
them into MeshModels stored alongside a Solid3D placeholder entity so
the GPU mesh pipeline renders them immediately.

EXTRUDE picks any closed 2D profile (Circle, LwPolyline, etc.),
attaches a planar face via try_attach_plane, and translational-sweeps
it (tsweep Face → Solid) along Z by the given height.

REVOLVE picks a profile, two axis points, and an angle (default 360°),
then rotational-sweeps the wire (rsweep) around the axis.

Three new CmdResult variants drive the operations:
  CommitSolid3D, ExtrudeEntity, RevolveEntity.

Scene::layer_color() added to retrieve the active layer's RGBA color.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-08 12:55:28 +03:00
Hakan SevenandClaude Sonnet 4.6 a773a1a1f1 feat: REFEDIT / REFCLOSE — in-place block reference editing
REFEDIT picks an INSERT, extracts the block entities into model space
with the INSERT transform applied (translate + rotate + uniform scale),
and enters an editing session.  Any normal modify command works on the
temporary entities.

REFCLOSE SAVE applies the inverse transform, replaces the block
definition, and rebuilds all derived caches (hatch/image/mesh), so
every INSERT of that block reflects the edits immediately.
REFCLOSE DISCARD removes the temp entities without changing the block.

Non-uniform-scale inserts are rejected with an error message.
RefEditSession is stored on DocumentTab; undo snapshots bracket the
begin and close operations.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-08 12:40:19 +03:00
Hakan SevenandClaude Sonnet 4.6 9ede70ef1c feat: 3D ARRAY (ARRAY3D / 3DARRAY command)
Three-dimensional rectangular array: prompts for rows, columns, levels
and their respective spacings, then generates copies translated along
X (columns), Z (rows in drawing plane), and Y (levels / height).

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-08 00:43:21 +03:00
Hakan SevenandClaude Sonnet 4.6 a20558a024 feat: ATTREQ — attribute prompting during INSERT
When inserting a block that contains AttributeDefinition entities,
the INSERT command now enters an attribute-filling phase: each attdef
is prompted tag-by-tag (showing its prompt text and default value).
Pressing Enter accepts the default. The completed AttributeEntity list
is embedded in the Insert before committing.

Blocks without attdefs continue to insert immediately as before.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-08 00:33:56 +03:00
Hakan SevenandClaude Sonnet 4.6 d2a58bdd08 feat: DIMORDINATE + mark Named UCS saving and DIMORDINATE complete
- ordinate_dim.rs: OrdinateDimCommand picks feature point then leader
  endpoint; auto-detects X vs Y ordinate from movement direction
- Ordinate dim added to the Dimensions dropdown in the Annotate ribbon
- ROADMAP.md: DIMORDINATE ✅, Named UCS (already implemented) ✅

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-08 00:21:35 +03:00
Hakan SevenandClaude Sonnet 4.6 6f741a92e0 feat: ATTEDIT — edit block attribute values interactively
- attedit.rs: AtteditCommand picks an INSERT entity then iterates through
  each attribute tag prompting for a new value (Enter keeps existing)
- attedit_pending_handle() / attedit_set_attrs() trait methods inject
  attribute data into the command after entity-pick (avoids document access
  in the command itself)
- cmd_result.rs: NeedPoint handler injects attr data; ReplaceEntity detects
  the __ATTEDIT__ sentinel and calls apply_attedit() on the document
- apply_attedit() encodes tag/value pairs as __ATTEDIT__tag\x01val\x02...
- ROADMAP.md: ATTEDIT marked ✅

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-08 00:19:43 +03:00
Hakan SevenandClaude Sonnet 4.6 0fc3766da7 feat: SPLINEDIT — close, open, reverse spline control-point editing
- splinedit.rs: SplineditCommand picks a spline (entity-pick phase) then
  accepts CLOSE/OPEN/REVERSE/EXIT sub-commands via text input
- apply_spline_op() mutates the spline in the document directly, with knot
  vector regeneration via generate_clamped_knots()
- Sentinel XLine trick: ReplaceEntity with a magic __SPLINEDIT_* layer name
  is intercepted in cmd_result.rs before erasing the original entity
- Control-point dragging already works via the existing grip editing system
- ROADMAP.md: SPLINEDIT marked ✅

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-08 00:16:44 +03:00
Hakan SevenandClaude Sonnet 4.6 b15be3af3d feat: WBLOCK — write block or selected entities to external file
- src/modules/insert/wblock.rs: extract_block_to_doc() copies a named
  block's entities into a fresh CadDocument; extract_entities_to_doc()
  does the same for a selection set; layer definitions are carried over
- WBLOCK <name> writes the named block; WBLOCK * writes selected entities
- WblockSave / WblockSaveResult messages drive the async save-dialog flow
- ROADMAP.md: 1.10 WBLOCK marked ✅

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-08 00:05:04 +03:00
Hakan SevenandClaude Sonnet 4.6 64837e9aed feat: XREF management — auto-resolve, XATTACH, XREF, XRELOAD
- src/io/xref.rs: resolve_xrefs() scans block_records for is_xref flags,
  resolves paths relative to the opened file's directory, loads the
  referenced DWG/DXF and merges model-space entities into the xref block
- src/modules/insert/xattach.rs: XATTACH command with file-picker flow
  (XAttachPick/XAttachPickResult messages), prepare_xref_block() creates
  BlockRecord + Block entities and immediately resolves content
- XREF command: lists all external references in the drawing
- XRELOAD command: re-resolves all xref paths and rebuilds scene caches
- Auto-resolve on FileOpened: reports Loaded/NotFound per xref block
- CadCommand trait: added optional xattach_path() method
- ROADMAP.md: 1.9 XREF management marked ✅

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-08 00:02:38 +03:00
Hakan SevenandClaude Sonnet 4.6 b3dcbe6eb9 chore: remove unused imports and variables (zero warnings)
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-07 19:20:24 +03:00
Hakan SevenandClaude Sonnet 4.6 5a682a365a feat: EXTEND and LENGTHEN now support LwPolyline
Both commands detect which terminal segment/vertex is nearest to the
pick point, compute the new endpoint along the segment direction, and
move only that terminal vertex — preserving all other vertices and bulge
values intact.  ROADMAP updated: EXTEND and LENGTHEN marked ✅.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-07 15:05:44 +03:00
Hakan SevenandClaude Sonnet 4.6 083eb5cbb5 feat: Spline support for TRIM, EXTEND, OFFSET, BREAK, and LENGTHEN
Add shared spline_ops module with:
- spline_to_bspline / bspline_to_spline: acadrust ↔ truck BSplineCurve conversion
- spline_sample_xy: sample DXF-XY projection at N+1 points with parameters
- spline_nearest_t: nearest-parameter search via coarse+bisection
- spline_pts_wire: world-space wire points for WireModel preview

TRIM: Spline entities can now be used as cutting boundaries (Geo::Spline
sampled into polyline segments) and as entities being trimmed; uses
BSplineCurve::cut() to produce surviving pieces.

EXTEND: extend_spline() shoots a tangent ray from the nearest endpoint
and appends a control point at the first boundary hit.

OFFSET: offset_spline() offsets each sample point along the local
perpendicular normal and rebuilds a new spline from the offset control pts.

BREAK: break_spline() uses spline_nearest_t() + BSplineCurve::cut() to
split the spline at one or two click points.

LENGTHEN: lengthen_spline() uses numerical arc-length integration +
bisection to cut the spline at the parameter corresponding to the new
requested length.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-07 15:00:22 +03:00
Hakan Seven 71667cfafe cleanup 2026-04-07 14:43:25 +03:00
Hakan SevenandClaude Sonnet 4.6 2c71ad5aeb feat: FILLET now supports LwPolyline segments and corner filleting
- Add LwPolyline helper functions: nearest-segment finder, segment-to-line
  extractor, corner vertex replacer, segment shortener, bulge calculator
- Add FilletEntity::LwPoly variant carrying poly, handle, and segment index
- compute_fillet_entities handles all new combinations: LwPoly×LwPoly
  (same entity corner fillet with bulge encoding), LwPoly×LwPoly (different
  entities), LwPoly×Line, LwPoly×Arc and their symmetric counterparts
- on_entity_pick detects LwPolyline picks and allows same-entity re-pick for
  adjacent-segment corner filleting
- on_hover_entity preview updated to show LwPolyline wire geometry
- entity_pts extended to cover LwPolyline for preview rendering
- Update prompts to mention LwPolyline as a supported entity type

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-07 14:42:49 +03:00
Hakan SevenandClaude Sonnet 4.6 7a07ef8710 feat: EXPLODE now supports Dimension entities
Decomposes Dimension (Linear, Aligned, Radius, Diameter, Angular2Ln,
Angular3Pt, Ordinate) into constituent Lines (extension lines, dimension
line) plus a Text entity for the dimension label value.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-07 11:29:39 +03:00
Hakan SevenandClaude Sonnet 4.6 d3d4ec4a08 feat: STRETCH with proper crossing-window vertex selection
Replaced the simplified MOVE-based STRETCH with a real crossing-window
implementation. Workflow: pick two crossing-window corners, then base+target
points. Only vertices/endpoints inside the window are translated:
- Line: moves start/end independently
- LwPolyline/Polyline: moves individual vertices inside window
- Arc/Circle/Ellipse: moves whole entity if center is inside
- Insert/Text/MText: moves if insertion point is inside

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-07 11:25:39 +03:00
Hakan SevenandClaude Sonnet 4.6 f6d716dfc5 feat: HATCHEDIT command to edit existing hatch pattern, scale, and angle
Add HATCHEDIT (HE alias) command. Works on pre-selected hatch or via
entity pick. Accepts text options: P <pattern>, S <scale>, A <angle>.
Enter applies changes; rebuilds hatch entity and GPU model via add_hatch.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-07 11:08:51 +03:00
Hakan SevenandClaude Sonnet 4.6 8078c4c9da feat: DDEDIT command and double-click text editing
Add DDEDIT (ED alias) command that edits Text/MText/Attribute entities
in-place via the command line. Double-clicking a text entity in model space
now auto-launches DDEDIT for that entity. Supports Text, MText,
AttributeDefinition, and AttributeEntity types.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-07 11:05:24 +03:00
Hakan SevenandClaude Sonnet 4.6 cfb27d93c3 feat: FILLET now supports Line-Arc, Arc-Line, and Arc-Arc pairs
Extended FilletCommand and ChamferCommand to accept Lines and Arcs as
first/second entity. Added fillet_line_arc() and fillet_arc_arc()
geometry functions that find a tangent fillet circle between the two
entities, trim each to the tangent point, and insert the fillet arc.
r=0 case trims/extends to the nearest intersection without inserting an arc.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-07 10:58:46 +03:00
Hakan SevenandClaude Sonnet 4.6 44af4278f2 feat: EXPLODE MLine support and accurate header documentation
- Add explode_mline() that decomposes each MLine segment into its
  spine Line plus two ±scale/2 offset Lines using per-vertex miter
  directions, matching the visual representation of MLine entities
- Update file header to document all actually-supported entity types
  (LwPolyline, Polyline2D/3D, Polyline, Insert, MLine)

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-07 10:52:05 +03:00
Hakan SevenandClaude Sonnet 4.6 b425c9e790 feat: LENGTHEN support for Ellipse entities
Add lengthen_ellipse() that approximates the arc length via 128-point
numerical integration, then bisects to find the new angular span matching
the requested delta/total/percent, and adjusts the nearer endpoint.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-07 10:50:52 +03:00
Hakan SevenandClaude Sonnet 4.6 eca4c96569 feat: OFFSET support for Ellipse entities
Add offset_ellipse() that scales both semi-axes uniformly by the offset
distance (inside vs outside determined by projecting side_pt onto the
ellipse local frame).  This is the standard CAD approximation; a true
offset of an ellipse is a higher-order Lamé curve.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-07 10:49:57 +03:00
Hakan SevenandClaude Sonnet 4.6 519b305f0e feat: BREAK support for Ellipse entities
Add break_ellipse() that projects the two break points onto the ellipse
parameter space (eccentric anomaly) and removes the CCW segment between
them, producing a partial Ellipse entity — matching AutoCAD break behaviour.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-07 10:48:40 +03:00
Hakan SevenandClaude Sonnet 4.6 09a6cc3521 feat: TRIM and EXTEND support for Ellipse entities
- Add Ellipse variant to the Geo boundary enum
- Implement algebraic line-ellipse intersection (le()) for fast boundary checks
- Add ellipse_seg_ts() using bisection for all boundary types including
  Arc/Circle/Ellipse boundaries (64-sample sign-change + 32-step bisection)
- Add trim_ellipse() producing partial Ellipse entities with updated parameters
- Add extend_ellipse() to stretch an ellipse arc to the nearest boundary
- Wire Ellipse into TrimCommand and ExtendCommand: on_entity_pick,
  on_entity_replaced, and on_hover_entity (live red/cyan preview)

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-07 10:47:32 +03:00
Hakan SevenandClaude Sonnet 4.6 4312b6c3a5 feat: raster image render pipeline (IMAGE command + GPU textured quad)
- Add IMAGE / IMAGEATTACH / IM command with async file-picker (rfd)
- src/scene/image_model.rs: ImageModel with RGBA pixel data + quad corners
- src/scene/pipeline/image_gpu.rs: ImageGpu with wgpu texture, sampler, opacity uniform
- src/scene/pipeline/mod.rs: image render pipeline (pass 2, between hatches and meshes)
- src/scene/render.rs: include images in Primitive, call upload_images in prepare
- src/scene/mod.rs: images HashMap, populate_images_from_document, cache on add_entity
- src/modules/home/draw/raster_image.rs: ImageCommand (two-click: origin + width, aspect-correct preview)
- src/io/mod.rs: pick_image_file() async helper (file dialog + dimension decode)
- app: ImagePick / ImagePickResult messages, populate on file open and undo/redo

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-06 23:19:08 +03:00
Hakan SevenandClaude Sonnet 4.6 34076b26bb feat: MLineStyle manager (MLSTYLE command + dialog)
- MLSTYLE command: LIST, NEW, SET, DEL subcommands
- Multiline Style Manager dialog: style list, element details (offset,
  color, linetype), Set Current / New / Delete buttons
- MLINE/ML command now reads document header.multiline_style to apply
  the current style to newly created MLine entities
- MlineCommand.with_style() constructor for style-aware multiline drawing

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-06 14:54:05 +03:00
Hakan SevenandClaude Sonnet 4.6 0aef1fc12f Feat: ROADMAP Phase 1-5 batch — trim/extend, plot scale, viewport UX, mline caps, table alignment
- TRIM/EXTEND: Ray and XLine entities supported as cutting boundaries and trim targets;
  trim results in Ray→Line/Ray, XLine→Ray/Ray or Line; hover preview added
- Plot scale override: Fit/1:1/1:2/1:5/1:10/1:20/1:50/1:100/2:1 buttons added to Page Setup
  panel; PageSetupCommit applies scale to PlotSettings
- Viewport UX: locked viewport gets orange border; selected viewport gets white border
- Named view → viewport assignment: Choice dropdown in properties panel copies
  view_target/direction/height to the viewport entity
- MLine caps: perpendicular start/end cap lines added for open (non-closed) MLines
- Wipeout polygon grips: boundary vertices become editable grips when clipping_enabled+Polygonal;
  world→pixel back-projection on drag
- Table cell alignment: CellStyle.alignment (1-9) drives left/center/right + top/middle/bottom
  text positioning; cxf::measure_text() helper added
- New commands/features: DIMCONTINUE (DCO), DIMBASELINE (DBA), TOLERANCE (TOL), TABLE,
  ATTDEF, ATTEDIT, ATTDISP, BREAKATPOINT (BAP), PLOTWINDOW (PW), MLINE (ML);
  DIMSTYLE/DIMCURRENT/CLAYER/LTSCALE/CELTSCALE/SCALETEXT/XDATA/UCSICON/REGEN/DRAWORDER extended
- PLINE arc mode: A/L/CLOSE text input, bulge computation, arc preview
- Warning cleanup: removed unused imports and unreachable patterns

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-03 15:31:05 +03:00
Hakan SevenandClaude Sonnet 4.6 77327bf730 Feat: DIMALIGNED (DAL) and DIMDIAMETER (DDI) dimension commands
DIMALIGNED: 3-click flow (p1 → p2 → dim line position) → DimensionAligned.
Rubber-band preview shows extension lines and dim line offset.

DIMDIAMETER: 3-click flow (center → arc point → text position) → DimensionDiameter.
Previews the diameter chord line.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-03 09:29:11 +03:00
Hakan SevenandClaude Sonnet 4.6 330b8b58f4 Feat: PEDIT command (PE) — polyline edit (close/open/width)
Entity pick → text input subcommands:
  C / CLOSE  → set closed flag
  O / OPEN   → clear closed flag
  W <value>  → set uniform width on LwPolyline vertices
  X / EXIT   → cancel

Command stays active after each op (CmdResult::PeditOp) for multiple edits.
Supports LwPolyline and Polyline2D.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-03 09:19:36 +03:00
Hakan SevenandClaude Sonnet 4.6 05ccc80048 Feat: Phase 5.3 — MLINE command (ML) — create multiline entity
Pick vertices, Enter to finish (≥2 pts). Text input while picking:
  C / CLOSE  → close and commit (≥3 pts)
  S <value>  → set scale factor (default 1.0)
  S alone    → prompt for scale then continue

Uses acadrust MLine::from_points / closed_from_points + scale_factor field.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-03 09:17:45 +03:00
Hakan SevenandClaude Sonnet 4.6 e4a7970c3e Feat: Phase 4.4 — WIPEOUT command (WO)
Creates rectangular (2-corner pick) or polygonal (multi-pick, Enter to close)
wipeout masking entities. Uses acadrust Wipeout::from_corners / ::polygonal.

Options: WIPEOUT → rectangular; WIPEOUT P → polygonal.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-02 23:54:07 +03:00
Hakan SevenandClaude Sonnet 4.6 c9719bacdf Feat: REVCLOUD command — revision cloud (arc-bumped closed polyline)
Pick polygon corners, Enter to close. Each edge is subdivided into arc
bumps (bulge = 0.5 ≈ 53° arcs). Result is a closed LwPolyline.
Arc bump length defaults to 1.0 drawing units.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-02 23:51:17 +03:00
Hakan SevenandClaude Sonnet 4.6 8fca75fade Feat: DONUT command (DO) — filled circular ring as LwPolyline
Creates LwPolyline with 2 vertices at (cx ± r_avg, cy), bulge=1.0,
start_width/end_width = (outer - inner) / 2, is_closed = true.

Workflow: inner diameter → outer diameter → click center points (Enter to exit).
Inner diameter 0 → filled solid circle.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-02 23:50:27 +03:00
Hakan SevenandClaude Sonnet 4.6 b27b612b5d Feat: ALIGN command (AL) — align objects using 1 or 2 point pairs
Workflow: select objects → 1st src/dst pair → 2nd src/dst pair (optional) → Enter.
- 1 pair: pure translation (src1 → dst1)
- 2 pairs: translate + rotate in XZ plane; optional uniform scale (Y/N prompt)

Transform applied as 3 sequential scene.transform_entities calls:
translate to origin → scale → rotate → translate to dst1.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-02 23:46:48 +03:00
Hakan SevenandClaude Sonnet 4.6 f6efe7a06a Feat: LENGTHEN command (LEN) — extend or trim Line/Arc
Options via text input after entity pick:
  DE <delta>   — extend by delta (negative trims)
  TO <total>   — set absolute total length / arc length
  P <percent>  — scale by percentage
  <number>     — plain number treated as DE delta

Closest end to pick point is modified. Uses CmdResult::LengthenEntity.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-02 23:45:06 +03:00
Hakan SevenandClaude Sonnet 4.6 ae0a4b12b5 Feat: DIVIDE and MEASURE commands — place points along entities
DIVIDE (DIV): entity pick → type N → places N-1 Point entities at equal spacing.
MEASURE (ME): entity pick → type distance → places points at fixed intervals.

Supported entities: Line, Arc, Circle, LwPolyline.
Uses CmdResult::DivideEntity / MeasureEntity with geometry computed in cmd_result.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-02 23:43:33 +03:00
Hakan SevenandClaude Sonnet 4.6 641cc2d70b Feat: JOIN command — merge collinear Lines or co-circular Arcs
Selection-gathering mode: select objects, press Enter to apply.
- Lines: checks collinearity + no-gap, merges into single line span
- Arcs: checks same center/radius + contiguous angles, merges to Arc or Circle
- Uses CmdResult::JoinEntities; geometry computed in cmd_result from document

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-02 23:41:53 +03:00
Hakan SevenandClaude Sonnet 4.6 4b8ae08a19 Feat: BREAK command (BR) — split Line/Arc/Circle/LwPolyline at two points
3-step interactive flow:
  1. Entity pick (first break point recorded at click location)
  2. Optional first point refinement
  3. Second break point → CmdResult::BreakEntity applied in cmd_result

Geometry:
- Line: project p1/p2 onto line parameter space → two line fragments
- Arc:  project p1/p2 to arc angles → trim CCW from p1 to p2
- Circle: same as Arc, converts Circle → Arc
- LwPolyline: nearest-vertex split → two polyline fragments

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-02 23:39:51 +03:00
Hakan SevenandClaude Sonnet 4.6 a3bb2714c1 Feat: DIST / ID / AREA inquiry commands
Add three classic CAD measurement commands:
- DIST (DI): two-point pick → distance, angle, delta XYZ
- ID: one-point pick → coordinates
- AREA: multi-point polygon pick (Enter to close) → area + perimeter

New CmdResult::Measurement(String) variant ends active command and
prints result to command line without modifying the document.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-02 23:36:53 +03:00
Hakan SevenandClaude Sonnet 4.6 70a8f5bf3f Feat: ZOOM IN/OUT/WINDOW commands; ZoomToWindow CmdResult
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-02 23:28:00 +03:00
Hakan SevenandClaude Sonnet 4.6 d66673a4fa Feat: VPLAYER ALL — freeze/thaw layer across all viewports in layout
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-02 23:13:09 +03:00
Hakan SevenandClaude Sonnet 4.6 28f441b3f2 Feat: RAY and XLINE creation commands (2-point interactive draw)
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-02 23:05:57 +03:00
Hakan SevenandClaude Sonnet 4.6 fa4fcf3c10 Feat: EXPLODE for Polyline, Polyline2D (bulge→Arc), Polyline3D → Lines
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-02 23:03:49 +03:00
Hakan SevenandClaude Sonnet 4.6 73b224c191 Feat: viewport display lock, extended properties, VPLAYER and VPORTS commands
- Enforce status.locked in pan_active_viewport and zoom_active_viewport:
  locked viewports now reject pan/zoom inputs entirely
- Add perspective, render_mode, shade_plot_mode, hide_plot, ucs_icon_visible
  fields to the viewport property panel with appropriate pickers/toggles
- Add VPORTS command: lists all user viewports in the current layout
  (id, size, position, scale, on/locked state) in the command line
- Add VPLAYER command: per-viewport layer freeze/thaw from the command line
  (F <layer> to freeze, T <layer> to thaw, Enter to exit)
- Add CmdResult::VpLayerUpdate variant and its handler in apply_cmd_result

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-03-31 23:52:18 +03:00
Hakan SevenandClaude Sonnet 4.6 a0596a14ff Fix: MVIEW preview rectangle drawn in XZ plane instead of XY
The preview rectangle used c1.y (constant) for all four corners and
pt.z for Z instead of c1.z. Corners 3 and 4 now correctly use pt.y
(varying Y) and the constant c1.z, producing a proper XY-plane rectangle.
Fixed in both layout/mview.rs and manage/mview.rs.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-03-31 13:15:06 +03:00
Hakan SevenandClaude Sonnet 4.6 e1d296da10 Phase 7: Plot settings and PDF export
- Add printpdf 0.9.1 dependency for native PDF generation.
- New src/io/pdf_export.rs: converts paper-space WireModels to a PDF
  page (per-wire stroke color, line weight in Pt, NaN-split segments).
  White/near-white colors are inverted to black for print output.
- Add PlotExport / PlotExportPath messages: opens a save-file dialog
  and writes a .pdf next to the drawing file.
- Add PageSetupOpen/Close/WidthEdit/HeightEdit/Commit messages: a
  centered modal panel lets the user enter paper width and height (mm);
  on commit the Layout object's min/max_limits are updated in-place.
- Register PRINT / PLOT / EXPORT and PAGESETUP (PS) commands in
  dispatch_command; fix MVIEW error message to English.
- Layout ribbon gains a "Plot" group with Page Setup and Export PDF
  ribbon buttons.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-03-31 08:05:17 +03:00
Hakan SevenandClaude Sonnet 4.6 a88542a69a Fix ribbon active state, polar snap, FILLET pick mode, and arc preview plane
- Deactivate ribbon tool highlight when command ends (issue #1)
- Reset last_point on new command dispatch to fix polar snap offset (issue #2)
- FILLET/CHAMFER: disable text input during entity pick so clicks reach viewport (issue #3)
- Dropdown icon buttons now use RibbonToolClick so they highlight blue when active
- FILLET/CHAMFER: AutoCAD-style sub-step UX — typing R/D + Enter prompts for value
- Fix FILLET arc preview plane: arc was rendering in XZ instead of XY
- Bump version to 0.1.1

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-03-31 00:31:28 +03:00
Hakan SevenandClaude Sonnet 4.6 468633c1fe Co-locate CadCommand impls with their ribbon toolbar modules
Each command implementation is now in the same file as its ribbon
tool definition. Groups moved to a dedicated groups/ toolbar folder.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-03-22 23:21:29 +03:00