Files
OneCAD-Draft/src/modules/insert/mod.rs
T
Hakan SevenandClaude Opus 4.8 c19c18c2f2 feat(commands): expand standard CAD command coverage
Integrate a large batch of standard CAD commands and fix several
name/behaviour mismatches, with no product references in code.

3D solids (reusing the truck B-rep pipeline):
- SLICE, INTERFERE, PRESSPULL, POLYSOLID, PYRAMID, SECTION
- 3DROTATE, 3DMIRROR, 3DALIGN (cached-solid transforms)

Annotation / text:
- ARCTEXT, SPLINEFIT (Catmull-Rom to Bezier), DIMJOGGED, OBJECTSCALE
  (XData markers honoured by the existing geometry-gen / tessellator)

Blocks / misc:
- NCOPY (block-content extraction via explode_entity)
- OPTIONS, SYNCPVIEWPORTS, THICKEN, plus earlier toggles, aliases,
  system variables, and layer/style/view commands

POINTCLOUD/RECAP and UNDERLAYLAYERS/UOSNAP are intentionally left out:
they require a proprietary binary / PDF-layer parser, a GPU point
renderer, and real test files.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-29 08:23:58 +03:00

126 lines
5.1 KiB
Rust

// Insert module — references, point clouds, blocks, attributes, import, content.
mod attdef;
mod attedit;
mod attman;
mod attsync;
pub mod base_point;
mod content_browser;
pub(crate) mod create_block;
mod design_center;
mod edit_block;
pub(crate) mod insert_block;
mod landxml;
pub mod minsert;
mod mview_block;
mod open_obj;
mod pc_attach;
mod snap_underlays;
pub(crate) mod solid3d_cmds;
mod underlay_layers;
pub(crate) mod wblock;
mod xadjust;
pub(crate) mod xattach;
mod xclip;
use crate::modules::{CadModule, IconKind, RibbonGroup, RibbonItem};
pub struct InsertModule;
impl CadModule for InsertModule {
fn id(&self) -> &'static str {
"insert"
}
fn title(&self) -> &'static str {
"Insert"
}
fn ribbon_groups(&self) -> Vec<RibbonGroup> {
vec![
// ── Reference ────────────────────────────────────────────────────
RibbonGroup {
title: "Reference",
tools: vec![
RibbonItem::LargeTool(xattach::tool()),
RibbonItem::LargeTool(xclip::tool()),
RibbonItem::LargeTool(xadjust::tool()),
RibbonItem::Tool(underlay_layers::tool()),
RibbonItem::Dropdown {
id: "FRAMES_DROPDOWN",
icon: IconKind::Svg(include_bytes!(
"../../../assets/icons/underlay_frames.svg"
)),
items: vec![
(
"FRAMES0",
"Frames Off",
IconKind::Svg(include_bytes!(
"../../../assets/icons/underlay_frames.svg"
)),
),
(
"FRAMES1",
"Frames On",
IconKind::Svg(include_bytes!(
"../../../assets/icons/underlay_frames.svg"
)),
),
(
"FRAMES2",
"Frames & Print",
IconKind::Svg(include_bytes!(
"../../../assets/icons/underlay_frames.svg"
)),
),
],
default: "FRAMES1",
},
RibbonItem::Tool(snap_underlays::tool()),
],
},
// ── Point Cloud ───────────────────────────────────────────────────
RibbonGroup {
title: "Point Cloud",
tools: vec![RibbonItem::LargeTool(pc_attach::tool())],
},
// ── Block ─────────────────────────────────────────────────────────
RibbonGroup {
title: "Block",
tools: vec![
RibbonItem::LargeTool(mview_block::tool()),
RibbonItem::LargeTool(insert_block::tool()),
RibbonItem::Tool(create_block::tool()),
RibbonItem::Tool(edit_block::tool()),
RibbonItem::Tool(base_point::tool()),
],
},
// ── Attributes ────────────────────────────────────────────────────
RibbonGroup {
title: "Attributes",
tools: vec![
RibbonItem::LargeTool(attdef::tool()),
RibbonItem::LargeTool(attedit::tool()),
RibbonItem::Tool(attman::tool()),
RibbonItem::Tool(attsync::tool()),
],
},
// ── Import ────────────────────────────────────────────────────────
RibbonGroup {
title: "Import",
tools: vec![
RibbonItem::LargeTool(open_obj::tool()),
RibbonItem::LargeTool(landxml::tool()),
],
},
// ── Content ───────────────────────────────────────────────────────
RibbonGroup {
title: "Content",
tools: vec![
RibbonItem::LargeTool(content_browser::tool()),
RibbonItem::LargeTool(design_center::tool()),
],
},
]
}
}