- src/entities/shape.rs: diamond marker at insertion point (SHX glyphs
cannot be rendered without the binary .shx file, so a placeholder is used)
- Grips: single insertion-point grip
- Properties: Name, Style (read-only), Insert X/Y/Z, Size, Rotation
- Transformable: translate, mirror, scale, rotate
- Registered in entities/mod.rs, entities/traits.rs, app/commands.rs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- DocumentTab: bg_color / paper_bg_color Optional<[f32;4]> fields
- view.rs: use custom color when set, fall back to defaults
- BACKGROUND <r> <g> <b>: set model or paper-space background (0–255 RGB)
- BACKGROUND RESET: restore default dark grey / paper grey
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When add_entity receives a RasterImage without a definition_handle,
create an ImageDefinition object in document.objects and link it.
This ensures DWG/DXF files save the IMAGEDEF section correctly so
other CAD programs can resolve image paths on reload.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace raw text dump with proper boxed feature-control frame:
- parse_gdt_rows(): splits %%v cells and ^J row separators
- substitute_gdt_codes(): strips {\Fgdt;X} patterns, maps symbol chars
to 3-letter ASCII labels (POS, PRP, PAR, SYM, CIR, CYL, …)
- tessellate_tolerance(): outer rectangle, row separators, column
dividers, and CXF-tessellated cell text — all as Vec<Vec<[f32;2]>>
(TruckObject::Text polyline path)
- Column widths computed per cell content; text centred in each cell
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- STYLE DIALOG / TEXTSTYLE DIALOG opens the Text Style Font Browser
- Three-panel dialog: style list | built-in CXF font list | properties
- Properties panel: font file text field, width factor, oblique angle
- Apply button commits edits; Set Current sets the active text style
- Built-in font picker (20 CXF fonts from assets/fonts/) auto-applies
font to the selected style on click
- Preview pane shows "AaBbCc 0123" sample text
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- TABLESTYLE/TS command: LIST, NEW subcommands for managing table styles
- Table Style Manager dialog: style list with details panel showing
name, margins, suppression flags, and row styles (data/header/title)
with text style, height, and alignment per row type
- New / Delete buttons in the dialog
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 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 <noreply@anthropic.com>
Wipeout entities now render a background-colored solid fill polygon
(via the hatch GPU pipeline) that masks other hatch fills beneath them.
Fills use model space background (0.11 grey) or paper space background
(0.22/0.24/0.28). Polygon and rectangular clip boundaries both supported.
Selected wipeouts use a translucent blue highlight instead.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- src/io/plot_style.rs: PlotStyleTable and PlotStyleEntry data structures;
CTB reader (deflate/zlib decompressed text format) with ACI→RGB and
ACI→lineweight lookup; CTB writer (zlib compressed); LW_TABLE constant
- src/io/pdf_export.rs: accept optional PlotStyleTable; apply ACI color
and lineweight overrides during PDF rendering
- src/scene/wire_model.rs: add `aci: u8` field to carry ACI index
- src/scene/render.rs: render_style() now returns ACI alongside RGBA
- src/scene/mod.rs + tessellate.rs: propagate aci through wire building
- app: PlotStyleLoad/Loaded/Clear messages and handlers;
PLOTSTYLE LOAD | CLEAR | STATUS command; active_plot_style state on H7CAD
- flate2 added as dependency
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add DimStyleDialogOpen/Close/Apply/Select/Tab/New/SetCurrent/Delete
messages and DsEdit/DsToggle with DsField enum for fine-grained edits
- Store active dialog state (selected style, current tab, edit buffers)
directly on H7CAD for all 28 most-used DimStyle properties
- dimstyle_overlay: 5-tab modal panel (Lines, Arrows, Text,
Scale/Units, Tolerances) with style list, Apply and Close buttons
- DIMSTYLE / DDIM with no sub-command now opens the dialog;
DIMSTYLE LIST / NEW / SET sub-commands remain available
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add `active_ucs: Option<Ucs>` per-tab state to DocumentTab
- Add `ucs_to_wcs`, `wcs_to_ucs`, `ucs_z_axis`, `ucs_rotated_z` helpers
- Add `Camera::pick_on_plane` for ray–plane intersection against any plane
- Mouse picks project onto the active UCS XY plane instead of world XY
- Typed coordinates are converted from UCS space to WCS before dispatch
- UCS command now really activates/deactivates a UCS:
- `UCS W` resets to WCS (clears active_ucs)
- `UCS <name>` activates a named UCS
- `UCS SAVE <name>` saves the current active UCS
- `UCS ORIGIN x,y,z` shifts origin (in current UCS space)
- `UCS X/Y/Z <angle>` rotates the UCS around its own axes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Before layout completes the viewport bounds are 0×0, causing project_point3
to produce NaN/Inf coordinates which panicked in lyon_path assertions.
Added early-return when bounds < 10px, and finite checks on all projected
and derived coordinates before calling any canvas drawing functions.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Screen-space UCS icon drawn on the existing selection canvas overlay.
Axes are projected from world space so the icon rotates with the camera,
always showing the correct X/Y/Z orientation relative to the drawing plane.
Each axis has its canonical color (X=red, Y=green, Z=blue) with arrowheads.
Icon visibility controlled by show_ucs_icon flag (default on); toggled by
UCSICON ON/OFF command which also updates paper-space viewport entities.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
TruckConvertible renders the 4 perimeter edges as wireframe outline.
The scene injects a solid-fill HatchModel for the filled quad using the
existing hatch GPU pipeline (DXF Z-order: p0→p1→p3→p2).
Grippable provides 4 square corner grips; grip moves rebuild the fill model.
PropertyEditable exposes all 4 corners and thickness. Transformable handles
move/rotate/scale/mirror via the standard entity transform path.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Polyline, Line, CircularArc, EllipticArc, and Spline boundary edges
all get diamond grips at their control vertices. Dragging a grip updates
the underlying DXF boundary vertex and immediately rebuilds the GPU
hatch model via Scene::apply_grip.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Linear/Aligned: first point, second point, definition point, text position
Radius/Diameter: center (angle_vertex), radius point, text position
Angular2Ln/Angular3Pt: vertex, two extension points, arc def point, text
Ordinate: origin, feature location, leader endpoint, text position
Text position grip shared across all types; measurement recalculated after edit.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
LIST (LI) now shows per-type details:
- Line: from/to coordinates + length
- Circle: center + radius + area
- Arc: center + radius + start/end angles
- LwPolyline: vertex count, closed flag, elevation
- Text/MText: content preview + height + insertion point
- Insert: block name + position + scale + rotation
- Spline: control point count + degree + closed flag
- Ellipse: center + major length + minor ratio
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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 <noreply@anthropic.com>
Pastes clipboard entities without translating to a pick point.
Useful for pasting between drawings at exact original positions.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ZOOM ALL (ZA) — fit all entities (alias for ZOOM EXTENTS)
ZOOM SCALE <n> (ZS) — set zoom factor (1/n multiplied to camera distance)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
QSELECT TYPE <type> — select all entities of given type (e.g. LINE, CIRCLE)
QSELECT LAYER <name> — select all entities on the given layer
QSELECT COLOR <n|BYLAYER> — select all entities with given color index
QSELECT LINETYPE <name> — select all entities with given linetype
Deselects current selection and replaces with matched entities.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
COUNT — count all entities grouped by type
COUNT LAYER — group by layer name
COUNT TYPE — group by entity type (same as default)
COUNT <layername> — count entities on a specific layer by type
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
FIND <search> — list all Text/MText/Attribute containing search
FIND <search> REPLACE <rep> — replace first occurrence
FINDALL <search> REPLACE <rep> — replace all occurrences
Works on Text, MText, AttributeDefinition, AttributeEntity.
Case-insensitive search; replaces preserving case in replacement.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
Status bar: shows "N VP" pill (with tooltip) when in a paper layout that has
user viewports (id > 1). New Scene::viewport_count() method.
REVCLOUD: closed LwPolyline with arc bumps (bulge = 0.5) along each edge.
Click polygon corners, Enter to close into a revision cloud shape.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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 <noreply@anthropic.com>
wires_for_block() now looks up the SortEntitiesTable for the current block.
When found, wires are sorted by sort_handle.value() so DRAWORDER F/B results
are immediately visible in the viewport (not just written to DXF).
Entities not in the sort table default to u64::MAX/2 (middle of draw order).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>