mirror of
https://github.com/storytold/cadcraft.git
synced 2026-12-02 02:38:30 -06:00
* HATCH by internal point keeps the arcs of its boundary (#1167) The boundary search works on flattened curves, so a hatch made by picking inside a circle stored 158 chords and AREA came out short (5025.22 for pi*40^2 = 5026.55). Each traced edge now keeps the input polyline it came from (region::Boundary::outer_edges, Island::edges, outline_edges, enclosing_loop_edges_gap; bridged gaps are None), and each input polyline is one piece of one object: a line, a circle, an arc or one segment of a polyline. arcs::with_arcs turns each run of edges on the same circular piece back into one bulged vertex and moves the corners onto the exact curves (line-circle or circle-circle crossing nearest the traced corner, within the reach a shallow crossing needs, else onto the circle). Nothing is matched by proximity, so a line or an ellipse next to a circle is never taken for it. The associative refill does the same, so a hatch keeps its arcs when its objects move. dedup_loops now merges only loops with the same role: a loop that is one pick's outer loop and another's island stays twice, as the even-odd fill needs (one hatch picked inside a circle and around it, or inside a square within a square, left the inner shape empty once the two loops matched). A boundary object selected twice is used once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Hatch arcs: origin from the arcs' extents; opposite-role duplicate loops cancel - HPORIGINMODE's corners came from the loop vertices only, so a circle kept as two half-circles had no height and its corner origins fell on its centre line. The extents now include each bulged edge's arc. - A pick inside a circle and one around it keep the circle as an outer loop and as an island. The renderer collapsed the two into one loop, so the circle drew empty, and AREA measured them by nesting. Two loops that are the same boundary now collapse only in the same role (a repeated loop); in opposite roles they cancel, as they do under the odd-parity fill. AREA measures the loops the fill keeps (`hatch_fill_loop_indices`), exactly with their arcs. - Tests: the circle's corner origins, BOUNDARY keeping a circle's and a rounded rectangle's arcs, and the drawn fill and AREA of the circle inside a square. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Hatch loops: same-role repeats collapse before opposite roles cancel; HATCHEDIT keeps islands - The renderer cancelled an outer loop and an island as it met them, so the same loops in another order filled differently (outer, island, outer left a hole; outer, outer, island left none). Repeats within a role now collapse first, then an outer loop and an island that are the same boundary cancel, spending the same comparison budget. - HATCHEDIT adding a boundary the hatch already has (its island) added a second copy, which then cancelled the island. A boundary already there is no longer added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * HATCHEDIT: a boundary already there takes the added objects' links Adding a boundary the hatch already has dropped the added loop, and with it the objects it came from, so an unlinked island picked with addBoundary stayed unlinked. The objects now join the loop already there (no second copy is added). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * AREA of a hatch tests nesting at an edge's middle, as the fill does AREA tested whether a loop is an island at its first vertex, which can lie on the loop around it (an island touching the outer boundary): the island was then added instead of subtracted. It now uses the fill's own test point, the middle of the first non-degenerate edge (`hatch_loop_probe`). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Hatch loop dedup: look only at loops that could match, stop when the budget is spent The comparison budget bounded `same_polygon`, but both passes still walked every kept loop for each new one, O(n²) in the number of loops however few matched. Loops are now found by (role, vertex count), so only possible matches are looked at, and once the budget is spent no more are. A test sorts 40,000 distinct loops. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: hatch gap tolerance (HPGAPTOL) is done, not missing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: BOUNDARY keeps the arcs of what it traces Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
213 lines
4.3 KiB
Rust
213 lines
4.3 KiB
Rust
mod angle_prompts;
|
|
mod angle_settings;
|
|
mod annotate_options;
|
|
mod annotative;
|
|
mod arc_ctrl_direction;
|
|
mod array_commands;
|
|
mod array_counts;
|
|
mod array_key_point;
|
|
mod array_live;
|
|
mod assoc_array;
|
|
mod attdef_command;
|
|
mod attdisp_attsync;
|
|
mod attedit_prompts;
|
|
mod attrib_modes;
|
|
mod attrib_props;
|
|
mod attribute_tag_matching;
|
|
mod attribute_tools;
|
|
mod attribute_value_baseline;
|
|
mod block_description;
|
|
mod block_keep;
|
|
mod block_redefine;
|
|
mod blockreplace;
|
|
mod break_closed_polyline;
|
|
mod break_ends_and_closing_side;
|
|
mod break_join_locked_layers;
|
|
mod break_keeps_z;
|
|
mod break_trim_keep_handle;
|
|
mod break_trim_polyline_rules;
|
|
mod breakatpoint_command_line;
|
|
mod burst;
|
|
mod change_command;
|
|
mod chprop_command;
|
|
mod classic_array;
|
|
mod compare_export;
|
|
mod constraint_geometry;
|
|
mod constraint_infer;
|
|
mod copy_count;
|
|
mod copy_modes;
|
|
mod count;
|
|
mod dash_block;
|
|
mod dash_units;
|
|
mod data_extraction;
|
|
mod dim_baseline_spacing;
|
|
mod dim_chain;
|
|
mod dim_commands;
|
|
mod dim_explode_text;
|
|
mod dim_properties;
|
|
mod dim_radial_inside;
|
|
mod dim_radial_outside;
|
|
mod dim_style_menu;
|
|
mod dim_text_frame;
|
|
mod dim_vars;
|
|
mod dimstyle_cli;
|
|
mod dimtedit_prompts;
|
|
mod drafting_spacing;
|
|
mod draw_prompts;
|
|
mod draworder;
|
|
mod dyn_input;
|
|
mod dynamic_block_data;
|
|
mod dynamic_grips;
|
|
mod explode_stretched;
|
|
mod extend_polyline_arc_end;
|
|
mod extend_polyline_end_choice;
|
|
mod extrim;
|
|
mod fillet_chamfer;
|
|
mod fix_holds_grips;
|
|
mod followups_626;
|
|
mod greek_keyboard;
|
|
mod grip_dim_input;
|
|
mod grip_options;
|
|
mod grip_selection;
|
|
mod group_selection;
|
|
mod groups;
|
|
mod hatch_arcs;
|
|
mod hatch_assoc;
|
|
mod hatch_dialog_helpers;
|
|
mod hatch_generate_boundary;
|
|
mod hatch_numeric_validation;
|
|
mod hatch_options;
|
|
mod helix;
|
|
mod hidden_grip_targets;
|
|
mod inquiry_keywords;
|
|
mod inquiry_variables;
|
|
mod inquiry_z;
|
|
mod insert_attrib_entry;
|
|
mod insert_attribute_prompts;
|
|
mod insert_enter;
|
|
mod insert_prompts;
|
|
mod isometric;
|
|
mod join_close;
|
|
mod join_on_source;
|
|
mod json_param_validation;
|
|
mod kept_dimension_snaps;
|
|
mod layer_cmdline;
|
|
mod layer_merge_delete;
|
|
mod layer_state_cmdline;
|
|
mod layoff_repeat;
|
|
mod layout_prompts;
|
|
mod leader_command;
|
|
#[allow(clippy::unwrap_used, clippy::expect_used, clippy::panic)]
|
|
mod lisp_corpus;
|
|
mod lisp_findfile;
|
|
mod lisp_undo_in_routine;
|
|
mod malformed_handles;
|
|
mod matchprop;
|
|
mod measure_distance_snapping;
|
|
mod metric_linetypes;
|
|
mod minsert;
|
|
mod mirror_degenerate_line;
|
|
mod mleader_content;
|
|
mod mleader_remember;
|
|
mod mleader_text_edit;
|
|
mod mline;
|
|
mod mocoro;
|
|
mod modify_curves;
|
|
mod mtext_columns;
|
|
mod mtext_options;
|
|
mod mtext_ortho;
|
|
mod multiline_attributes;
|
|
mod named_viewports;
|
|
mod named_views;
|
|
mod non_finite_edits;
|
|
mod offset_closed_spline;
|
|
mod offset_ellipse_side;
|
|
mod offset_move;
|
|
mod oops_command;
|
|
mod options_profile;
|
|
mod overkill;
|
|
mod parallel_display_list;
|
|
mod pedit_heights;
|
|
mod pedit_multiple;
|
|
mod pedit_splinedit;
|
|
mod pick_text;
|
|
mod pickdrag;
|
|
mod pline_arc_xline_options;
|
|
mod plot_styles;
|
|
mod point_modifiers;
|
|
mod polyface_explode;
|
|
mod post_command_passes;
|
|
mod prompt_keywords;
|
|
mod prompt_or_once;
|
|
mod properties_describe;
|
|
mod properties_set_locked;
|
|
mod properties_set_text_dims;
|
|
mod props_bad_lineweight;
|
|
mod props_insert_scale_attribs;
|
|
mod purge_kept_dimension_blocks;
|
|
mod purge_mlinestyles;
|
|
mod purge_prompts;
|
|
mod qdim;
|
|
mod qdim_modes;
|
|
mod qleader;
|
|
mod query_entities;
|
|
mod quickcalc;
|
|
mod recent_commands;
|
|
mod rectang_ortho;
|
|
mod rectang_polygon_order;
|
|
mod refedit;
|
|
mod region;
|
|
mod rename_cmdline;
|
|
mod revcloud_recognised;
|
|
mod rotate_reference;
|
|
mod rotation_grip_input;
|
|
mod scale_offset_z;
|
|
mod select_keywords;
|
|
mod select_similar;
|
|
mod select_underscore_keywords;
|
|
mod selection_cycling;
|
|
mod selection_modes;
|
|
mod setvar_cecolor;
|
|
mod setvar_coverage;
|
|
mod shapes;
|
|
mod snap_annotations;
|
|
mod snap_blocks;
|
|
mod snap_curves;
|
|
mod snap_intersections_aperture;
|
|
mod snap_nearest;
|
|
mod snap_overrides;
|
|
mod snap_tracking;
|
|
mod snaps_more;
|
|
mod solid_command;
|
|
mod space_is_enter;
|
|
mod spline_degree;
|
|
mod spline_options;
|
|
mod stretch;
|
|
mod stretch_select;
|
|
mod table_formulas;
|
|
mod table_styles;
|
|
mod temp_tracking;
|
|
mod text_commands;
|
|
mod text_left_justify;
|
|
mod tolerance;
|
|
mod transparent;
|
|
mod trim_closed_polyline;
|
|
mod trim_cut_at_the_pick;
|
|
mod trim_cut_where_an_arc_span_starts;
|
|
mod trim_extend_json_pick;
|
|
mod trim_extend_options;
|
|
mod trim_highlight;
|
|
mod trim_keeps_z_and_width;
|
|
mod undo_count;
|
|
mod undo_layout_tab;
|
|
mod viewport_clip;
|
|
mod viewport_frozen_selection;
|
|
mod vplayer_prompts;
|
|
mod vports;
|
|
mod wipeout_grips;
|
|
mod xclip;
|
|
mod xdata_follows_entity;
|
|
mod zoom_keywords;
|
|
mod zoom_viewport;
|
|
mod zoom_window_ortho;
|