茂之钳 6cfd186780
CI / Build & Test (push) Failing after 33s
CI / Release Build (push) Failing after 32s
feat(brep): S13-A — IGES import support
Implement IGES (Initial Graphics Exchange Specification) file reader that
converts IGES entities to B-Rep models.

Key features:
- 80-character fixed-width card image parser (S/G/D/P/T sections)
- Directory Entry parsing with all 18 DE fields per entity
- Parameter Data parsing with DE pointer tracking
- D exponent notation support (e.g., 1.5D+2 = 150)

Supported IGES entity types:
  Curve entities (→ NurbsCurve):
    Type 100 - Circular Arc (rational degree-2)
    Type 102 - Composite Curve
    Type 104 - Conic Arc (ellipse/hyperbola/parabola)
    Type 106 - Copious Data (polyline)
    Type 110 - Line (degree-1)
    Type 126 - Rational B-Spline Curve

  Surface entities (→ NurbsSurface):
    Type 108 - Plane
    Type 114 - Parametric Spline Surface
    Type 118 - Ruled Surface
    Type 120 - Surface of Revolution
    Type 122 - Tabulated Cylinder (extrude)
    Type 128 - Rational B-Spline Surface
    Type 140 - Offset Surface
    Type 192 - Right Circular Cylindrical Surface
    Type 194 - Right Circular Conical Surface
    Type 196 - Spherical Surface
    Type 198 - Toroidal Surface

  Topology entities (→ BrepModel):
    Type 186 - Manifold Solid B-Rep Object
    Type 502 - Vertex
    Type 504 - Edge
    Type 508 - Loop
    Type 510 - Face
    Type 514 - Shell

Tests cover: line, arc, cylinder, sphere, cone, torus, plane,
B-spline curve/surface, ruled surface, revolution surface,
tabulated cylinder, copious data polyline, manifold solid B-Rep,
D exponent notation, empty/truncated file handling, and file errors.
2026-07-24 07:37:03 +00:00
2026-07-23 07:51:23 +00:00

ViewDesignEngine — 高性能 CAD 计算几何算法库

C++17 实现的计算几何引擎。提供曲线曲面建模、网格处理、布尔运算、空间索引、碰撞检测等底层几何计算能力。

Tests Version C++

快速开始

# 基础构建 + 测试
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j$(nproc)
cd build && ctest --output-on-failure

# 启用性能基准测试
cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_BENCHMARKS=ON
cmake --build build -j$(nproc)
cd build && ctest -R bench_

依赖: CMake ≥ 3.16, C++17 编译器, Eigen 3 (自动下载)

模块

模块 命名空间 说明
foundation vde::foundation 数学类型、公差系统、精确谓词、OBJ/STL/PLY/glTF I/O
core vde::core 点/线/面/三角形/AABB、几何变换、距离计算、多边形、凸包、ICP
curves vde::curves Bezier/B-Spline/NURBS 曲线与曲面、求值/求导、自适应细分
mesh vde::mesh 半边网格、Delaunay 2D/3D、QEM 简化、Laplacian/Taubin/HC 平滑、网格质量、Marching Cubes、测地线
spatial vde::spatial BVHSAH)、Octree、KD-Tree、R-TreeSTR bulk-loading
boolean vde::boolean 2D Sutherland-Hodgman 裁剪、3D 网格布尔(union/intersection/difference/sym_diff
collision vde::collision GJK、SAT、Möller-Trumbore 射线-三角形、三角-三角交线
brep vde::brep B-Rep 拓扑建模(box/sphere/cylinder)、NURBS 面、离散化

快速示例

#include <vde/core/point.h>
#include <vde/curves/bezier_curve.h>
#include <vde/mesh/delaunay_2d.h>

using namespace vde::core;
using namespace vde::curves;

// 创建三次 Bezier 曲线求值
BezierCurve curve({
    {0, 0, 0}, {2, 3, 0}, {5, -1, 0}, {7, 0, 0}
});
auto pt = curve.evaluate(0.5);  // t=0.5 处的点
auto dt = curve.derivative(0.5); // 一阶导

// 2D Delaunay 三角剖分
std::vector<Point2D> pts = {{0,0},{1,0},{1,1},{0,1},{0.5,0.5}};
auto mesh = mesh::delaunay_2d(pts);  // 自动三角化

更多示例见 examples/ 目录。

性能基准

操作 规模 时间 吞吐
Bezier eval 100K 2.66 ms 38M evals/s
BVH 构建 1K tris 245 µs 4.1M tris/s
Delaunay 2D 1K pts 3.96 ms 254K pts/s
3D Boolean (Union) ~100 faces 2.05 ms 495 ops/s

完整基准报告:docs/benchmark-report.md

工程指标

  • 源文件: 7,800+ 行
  • 头文件: 2,300+ 行
  • 测试用例: 143 个(100% 通过)
  • 编译: 零错误零警告(GCC 11/Clang 16+
  • 版本: v1.0.0

文档

许可证

Apache License 2.0 — 详见 LICENSE

S
Description
No description provided
Readme 12 MiB
2026-07-27 07:08:22 +00:00
Languages
C++ 98.1%
C 0.9%
CMake 0.5%
Python 0.4%