feedback: add VDE-123 Hole Wizard + Rib, VDE-124 Weld Geometry, VDE-125 Surface Core Tools
This commit is contained in:
@@ -0,0 +1,121 @@
|
||||
# VDE-123: 异形孔向导 + 加强筋创建
|
||||
|
||||
**Date**: 2026-07-31
|
||||
**Severity**: P0 (mechanical CAD 基础特征)
|
||||
**Status**: Submitted
|
||||
|
||||
## Summary
|
||||
|
||||
ViewDesign 对标 SolidWorks/CATIA 需要两种核心机械特征:
|
||||
1. **异形孔向导 (Hole Wizard)**: 沉头孔、埋头孔、螺纹孔等的参数化创建
|
||||
2. **加强筋 (Rib)**: 从草图轮廓创建加强筋特征
|
||||
|
||||
VDE 目前仅有 `create_threaded_hole`(fastener_library.h),远不具备专业级孔向导能力。
|
||||
`create_rib` 完全不存在。
|
||||
|
||||
## Gap Analysis
|
||||
|
||||
### 异形孔向导
|
||||
|
||||
| 功能 | SolidWorks | VDE 现状 |
|
||||
|------|-----------|---------|
|
||||
| 柱形沉头孔 (Counterbore) | ✅ | ❌ |
|
||||
| 锥形埋头孔 (Countersink) | ✅ | ❌ |
|
||||
| 沉头盲孔 (Counterdrill) | ✅ | ❌ |
|
||||
| 简单直孔 (Simple) | ✅ | ❌ |
|
||||
| 螺纹孔 (Tapped) | ✅ | ⚠️ 仅有 `create_threaded_hole` |
|
||||
| 锥管螺纹孔 (Pipe Tap) | ✅ | ❌ |
|
||||
| 从草图点批量创建 | ✅ | ❌ |
|
||||
| 孔标注 (工程图) | ✅ | ❌ |
|
||||
| 装配孔系列 | ✅ | ❌ |
|
||||
| 底孔直径自动计算 (ISO/ANSI) | ✅ | ❌ |
|
||||
|
||||
### 加强筋
|
||||
|
||||
| 功能 | SolidWorks | VDE 现状 |
|
||||
|------|-----------|---------|
|
||||
| 平行于草图平面 (Parallel) | ✅ | ❌ |
|
||||
| 垂直于草图平面 (Normal) | ✅ | ❌ |
|
||||
| 线性/自然拔模 | ✅ | ❌ |
|
||||
| 厚度双向/单向/中间面 | ✅ | ❌ |
|
||||
| 开放轮廓自动延伸 | ✅ | ❌ |
|
||||
|
||||
## Proposed API
|
||||
|
||||
```cpp
|
||||
namespace vde::brep {
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// Hole Wizard (异形孔向导)
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
enum class HoleType { Simple, Counterbore, Countersink, Counterdrill, Tapped, PipeTap };
|
||||
enum class HoleEndCondition { Blind, ThroughAll, UpToNext, UpToFace, UpToVertex };
|
||||
enum class ThreadStandard { ISO, ANSI, JIS, GB };
|
||||
|
||||
struct HoleWizardSpec {
|
||||
HoleType type;
|
||||
// 尺寸规格
|
||||
double diameter = 10.0;
|
||||
double depth = 20.0;
|
||||
// 沉头/埋头
|
||||
double cbore_diameter = 0.0;
|
||||
double cbore_depth = 0.0;
|
||||
double csink_angle_deg = 90.0;
|
||||
// 螺纹
|
||||
double thread_depth = 0.0;
|
||||
ThreadStandard thread_std = ThreadStandard::ISO;
|
||||
std::string thread_size = "M10x1.5";
|
||||
// 尾端
|
||||
HoleEndCondition end_condition = HoleEndCondition::Blind;
|
||||
double tip_angle_deg = 118.0;
|
||||
// 近端/远端曲面
|
||||
int start_face_id = -1;
|
||||
int end_face_id = -1;
|
||||
};
|
||||
|
||||
[[nodiscard]] BrepModel create_hole_wizard(
|
||||
const BrepModel& body,
|
||||
const core::Point3D& position,
|
||||
const core::Vector3D& direction,
|
||||
const HoleWizardSpec& spec);
|
||||
|
||||
[[nodiscard]] std::vector<BrepModel> create_holes_from_points(
|
||||
const BrepModel& body,
|
||||
const std::vector<core::Point3D>& positions,
|
||||
const core::Vector3D& direction,
|
||||
const HoleWizardSpec& spec);
|
||||
|
||||
// 底孔直径查询表
|
||||
[[nodiscard]] double tap_drill_size(
|
||||
const std::string& thread_size,
|
||||
ThreadStandard standard = ThreadStandard::ISO,
|
||||
double engagement_percent = 0.75);
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// Rib (加强筋)
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
enum class RibOrientation { ParallelToSketch, NormalToSketch };
|
||||
enum class RibThicknessDirection { OneSide, BothSides, MidPlane };
|
||||
|
||||
struct RibParams {
|
||||
double thickness = 2.0;
|
||||
RibOrientation orientation = RibOrientation::NormalToSketch;
|
||||
RibThicknessDirection thickness_dir = RibThicknessDirection::BothSides;
|
||||
double draft_angle_deg = 0.0;
|
||||
bool closed_loop = false;
|
||||
};
|
||||
|
||||
[[nodiscard]] BrepModel create_rib(
|
||||
const BrepModel& body,
|
||||
const std::vector<curves::NurbsCurve>& sketch_contours,
|
||||
const rib_params& params);
|
||||
|
||||
} // namespace vde::brep
|
||||
```
|
||||
|
||||
## Impact
|
||||
|
||||
- 异形孔向导:机械零件中 30%+ 的特征是孔特征,无此功能严重影响可用性
|
||||
- 加强筋:注塑件/铸造件设计的基础特征,缺失即无法完成基本零件设计
|
||||
@@ -0,0 +1,129 @@
|
||||
# VDE-124: 焊接几何创建
|
||||
|
||||
**Date**: 2026-07-31
|
||||
**Severity**: P0 (mechanical CAD 基础特征)
|
||||
**Status**: Submitted
|
||||
|
||||
## Summary
|
||||
|
||||
VDE 目前仅有 `AssemblyFeatureType::WeldJoint` 枚举标记,无任何实际焊接几何创建函数。
|
||||
焊接是机械设计的基础需求,对标 SolidWorks Weldments 需补充完整的焊接几何能力。
|
||||
|
||||
## Gap Analysis
|
||||
|
||||
| 功能 | SolidWorks 对应 | VDE 现状 |
|
||||
|------|----------------|---------|
|
||||
| 角焊缝 (Fillet Weld) | ✅ | ❌ |
|
||||
| 坡口焊缝 (Groove Weld: V/J/U) | ✅ | ❌ |
|
||||
| 塞焊 (Plug Weld) | ✅ | ❌ |
|
||||
| 槽焊 (Slot Weld) | ✅ | ❌ |
|
||||
| 焊道几何生成 | ✅ (沿边扫掠) | ❌ |
|
||||
| 焊接符号 3D 标注 | ✅ | ❌ (仅 PMIType 枚举) |
|
||||
| 焊接切割清单 | ✅ | ❌ |
|
||||
| 结构构件型材库 | ✅ (工字钢/槽钢/角钢/方管) | ❌ |
|
||||
|
||||
## Proposed API
|
||||
|
||||
```cpp
|
||||
namespace vde::brep {
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// Weld Types (焊接类型)
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
enum class WeldJointType {
|
||||
Fillet, // 角焊缝 (三角形截面)
|
||||
GrooveV, // V 型坡口焊缝
|
||||
GrooveJ, // J 型坡口焊缝
|
||||
GrooveU, // U 型坡口焊缝
|
||||
SquareButt, // I 型对接焊缝
|
||||
BevelButt, // 单边 V 型坡口焊缝
|
||||
Plug, // 塞焊
|
||||
Slot // 槽焊
|
||||
};
|
||||
|
||||
// 焊缝参数
|
||||
struct WeldParams {
|
||||
WeldJointType type = WeldJointType::Fillet;
|
||||
double size = 3.0; // 焊脚尺寸 (fillet) 或焊缝宽度
|
||||
double depth = 3.0; // 熔深
|
||||
double length = 0.0; // 0=全段焊接, >0=指定长度
|
||||
double pitch = 0.0; // 间断焊间距 (0=连续焊)
|
||||
bool all_around = false; // 圆周焊接符号
|
||||
bool field_weld = false; // 现场焊接符号
|
||||
std::string contour = "flat"; // flat/convex/concave
|
||||
};
|
||||
|
||||
// 焊缝结果
|
||||
struct WeldBeadResult {
|
||||
BrepModel bead_body; // 焊道几何体
|
||||
double volume = 0.0; // 焊料体积 (用于成本估算)
|
||||
std::string weld_symbol; // 自动生成的焊接符号文本
|
||||
};
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// API
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
/// 在两零件之间创建焊缝
|
||||
[[nodiscard]] WeldBeadResult create_weld(
|
||||
const Assembly& assembly,
|
||||
const std::string& part_a,
|
||||
const std::string& part_b,
|
||||
int edge_id_a, int edge_id_b,
|
||||
const WeldParams& params);
|
||||
|
||||
/// 在单一边缘创建焊缝 (非装配模式)
|
||||
[[nodiscard]] WeldBeadResult create_weld_on_edge(
|
||||
const BrepModel& body,
|
||||
int edge_id,
|
||||
const core::Vector3D& weld_direction,
|
||||
const WeldParams& params);
|
||||
|
||||
/// 创建坡口焊缝
|
||||
[[nodiscard]] WeldBeadResult create_groove_weld(
|
||||
const BrepModel& body_a,
|
||||
const BrepModel& body_b,
|
||||
const core::Vector3D& groove_normal,
|
||||
double root_gap, double groove_angle_deg,
|
||||
const WeldParams& params);
|
||||
|
||||
/// 批量焊接 (焊接装配)
|
||||
struct AssemblyWeldResult {
|
||||
std::vector<WeldBeadResult> beads;
|
||||
double total_weld_volume = 0.0;
|
||||
std::vector<std::string> cut_list; // 切割清单
|
||||
};
|
||||
|
||||
[[nodiscard]] AssemblyWeldResult create_assembly_welds(
|
||||
const Assembly& assembly,
|
||||
const std::vector<std::tuple<std::string,std::string,int,int>>& weld_specs,
|
||||
const WeldParams& params);
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// Structural Members (结构构件型材库)
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
enum class StructuralShape {
|
||||
IBeam, WideFlange, Channel, Angle, EqualAngle,
|
||||
SquareTube, RectTube, RoundTube, RoundBar
|
||||
};
|
||||
|
||||
struct StructuralMemberParams {
|
||||
StructuralShape shape;
|
||||
std::string size_spec = "100x50"; // 规格 (e.g. "I10", "50x50x6")
|
||||
bool corner_treatment = false; // 端部修剪
|
||||
};
|
||||
|
||||
[[nodiscard]] BrepModel create_structural_member(
|
||||
const curves::NurbsCurve& path,
|
||||
const StructuralMemberParams& params);
|
||||
|
||||
} // namespace vde::brep
|
||||
```
|
||||
|
||||
## Impact
|
||||
|
||||
- 焊接是钢结构/机械装配的基础连接方式
|
||||
- 型材库是钢结构设计的核心需求(对标 SolidWorks Weldments)
|
||||
- 缺失即无法完成焊接件设计
|
||||
@@ -0,0 +1,170 @@
|
||||
# VDE-125: 曲面核心工具 — 增厚/缝合/边界/填充/直纹/偏移
|
||||
|
||||
**Date**: 2026-07-31
|
||||
**Severity**: P0 (曲面建模基础)
|
||||
**Status**: Submitted
|
||||
|
||||
## Summary
|
||||
|
||||
VDE 的 NURBS 曲面基础非常完备,但缺少将曲面转换为实体、以及从曲线创建曲面的核心工具。
|
||||
对标 CATIA GSD / SolidWorks Surfacing 需要以下 6 个基础函数:
|
||||
|
||||
| 功能 | VDE 现状 | 说明 |
|
||||
|------|---------|------|
|
||||
| thicken (加厚) | ❌ | 将开放曲面体加厚为实体 |
|
||||
| sew (缝合) | ❌ | 多个相邻曲面缝合为封闭壳体/实体 |
|
||||
| boundary_surface (边界曲面) | ❌ | 由 U/V 向曲线网格生成曲面 |
|
||||
| fill_surface (填充曲面) | ❌ | N 边封闭区域填充曲面 |
|
||||
| ruled_surface (直纹曲面) | ❌ | 两条曲线之间线性插值 |
|
||||
| offset_surface (曲面偏移) | ❌ | 沿法线偏移整个曲面 (3D) |
|
||||
|
||||
## Gap Analysis
|
||||
|
||||
### 1. Thicken (加厚曲面为实体)
|
||||
- 输入: NurbsSurface + 厚度 + 方向 (单侧/双侧)
|
||||
- 输出: BrepModel (实体)
|
||||
- 对标: SolidWorks Thicken, CATIA GSD ThickSurface
|
||||
|
||||
### 2. Sew (缝合曲面)
|
||||
- 输入: vector<NurbsSurface> + 缝合容差
|
||||
- 输出: BrepModel (缝合后的壳体/实体)
|
||||
- 对标: SolidWorks Knit Surface, CATIA GSD Join
|
||||
|
||||
### 3. Boundary Surface (边界曲面)
|
||||
- 输入: U 向曲线列表 (guides) + V 向曲线列表 (profiles)
|
||||
- 输出: NurbsSurface
|
||||
- 对标: SolidWorks Boundary Surface, CATIA GSD Blend
|
||||
|
||||
### 4. Fill Surface (填充曲面)
|
||||
- 输入: N 条边界曲线 (≥3) + 连续性约束 + 内部引导线 (可选)
|
||||
- 输出: NurbsSurface
|
||||
- 对标: SolidWorks Filled Surface, CATIA GSD Fill
|
||||
|
||||
### 5. Ruled Surface (直纹曲面)
|
||||
- 输入: 两条导向曲线 + 方向参数
|
||||
- 输出: NurbsSurface (直纹面)
|
||||
- 对标: SolidWorks Ruled Surface, CATIA GSD Ruled
|
||||
|
||||
### 6. Offset Surface (曲面 3D 偏移)
|
||||
- 输入: NurbsSurface + 偏移距离
|
||||
- 输出: NurbsSurface (等距曲面)
|
||||
- 对标: SolidWorks Offset Surface, CATIA GSD Offset
|
||||
- 已有 `exact_offset.h` 但仅针对曲线,非曲面 3D 偏移
|
||||
|
||||
## Proposed API
|
||||
|
||||
```cpp
|
||||
namespace vde::brep {
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// Thicken (加厚)
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
enum class ThickenDirection { OneSide, BothSides, MidPlane };
|
||||
|
||||
struct ThickenParams {
|
||||
double thickness = 1.0;
|
||||
ThickenDirection direction = ThickenDirection::OneSide;
|
||||
bool cap_ends = true; // 封口
|
||||
bool merge_result = true; // 合并结果实体
|
||||
};
|
||||
|
||||
[[nodiscard]] BrepModel thicken(
|
||||
const BrepModel& surface_body,
|
||||
const ThickenParams& params);
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// Sew (缝合)
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
struct SewParams {
|
||||
double tolerance = 1e-6;
|
||||
bool try_make_solid = true; // 尝试生成实体
|
||||
bool merge_faces = true; // 合并共面
|
||||
bool remove_duplicates = true; // 去除重复面
|
||||
};
|
||||
|
||||
[[nodiscard]] BrepModel sew(
|
||||
const std::vector<BrepModel>& surface_bodies,
|
||||
const SewParams& params = {});
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// Boundary Surface (边界曲面)
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
struct BoundarySurfaceParams {
|
||||
int degree_u = 3;
|
||||
int degree_v = 3;
|
||||
int continuity = 2; // G0=0, G1=1, G2=2
|
||||
};
|
||||
|
||||
[[nodiscard]] curves::NurbsSurface boundary_surface(
|
||||
const std::vector<curves::NurbsCurve>& u_curves, // U 向导引线
|
||||
const std::vector<curves::NurbsCurve>& v_curves, // V 向轮廓线
|
||||
const BoundarySurfaceParams& params = {});
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// Fill Surface (填充曲面 / N 边补面)
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
struct FillSurfaceParams {
|
||||
int continuity = 2; // G0/G1/G2
|
||||
int n_u = 10; // U 向控制点数
|
||||
int n_v = 10; // V 向控制点数
|
||||
bool minimize_energy = true;
|
||||
std::vector<curves::NurbsCurve> guide_curves; // 可选的内部引导线
|
||||
};
|
||||
|
||||
[[nodiscard]] curves::NurbsSurface fill_surface(
|
||||
const std::vector<curves::NurbsCurve>& boundaries,
|
||||
const FillSurfaceParams& params = {});
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// Ruled Surface (直纹曲面)
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
enum class RuledDirection { NormalToSurface, TaperedToVector, PerpendicularToVector };
|
||||
|
||||
struct RuledParams {
|
||||
double length = 10.0;
|
||||
RuledDirection direction = RuledDirection::NormalToSurface;
|
||||
core::Vector3D reference_vector = core::Vector3D::UnitZ();
|
||||
int degree_v = 1; // 直纹面 V 向通常为 1 阶
|
||||
int num_samples = 50;
|
||||
};
|
||||
|
||||
[[nodiscard]] curves::NurbsSurface ruled_surface(
|
||||
const curves::NurbsCurve& guide_curve,
|
||||
const RuledParams& params);
|
||||
|
||||
/// 两条曲线间的直纹面
|
||||
[[nodiscard]] curves::NurbsSurface ruled_surface_between(
|
||||
const curves::NurbsCurve& curve_a,
|
||||
const curves::NurbsCurve& curve_b);
|
||||
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
// Offset Surface (曲面 3D 偏移)
|
||||
// ═══════════════════════════════════════════════════════════
|
||||
|
||||
struct OffsetSurfaceParams {
|
||||
double distance = 1.0;
|
||||
double tolerance = 1e-6;
|
||||
bool both_sides = false;
|
||||
bool trim_intersections = true;
|
||||
};
|
||||
|
||||
[[nodiscard]] curves::NurbsSurface offset_surface(
|
||||
const curves::NurbsSurface& surface,
|
||||
const OffsetSurfaceParams& params);
|
||||
|
||||
} // namespace vde::brep
|
||||
```
|
||||
|
||||
## Impact
|
||||
|
||||
- `thicken` + `sew` 是曲面到实体的桥梁,缺失即无法完成曲面建模工作流
|
||||
- `boundary_surface` + `fill_surface` 是曲面建模的"起手式"
|
||||
- `ruled_surface` 是拔模面/分型面快速创建的基础
|
||||
- `offset_surface` 是等壁厚零件设计的基础
|
||||
|
||||
这 6 个函数是曲面建模的**最小可行集**。
|
||||
Reference in New Issue
Block a user