feat: Python 绑定 — pybind11 核心/曲线/网格模块
CI / Build & Test (push) Failing after 33s
CI / Release Build (push) Failing after 32s

- 使用 pybind11 v2.11.1 (FetchContent) 构建 _vde 原生模块
- 模块化结构: bind_core.cpp / bind_curves.cpp / bind_mesh.cpp
- 暴露核心类型: Point2D, Point3D, Vector3D, AABB3D, Polygon2D
- 暴露曲线: BezierCurve, BSplineCurve, NurbsCurve
- 暴露网格: delaunay_2d/3d, DelaunayResult, HalfedgeMesh
- 变换函数: translate, rotate, scale 等
- Python 包 vde/ 含 __init__.py 及子模块封装
- setup.py 支持 pip install -e . 可编辑安装
- VDE_BUILD_PYTHON CMake 选项 (默认 OFF),通过 -DVDE_BUILD_PYTHON=ON 启用
This commit is contained in:
茂之钳
2026-07-24 03:58:19 +00:00
parent 1ac5a27d4c
commit bd37f2249d
15 changed files with 1186 additions and 219 deletions
+12
View File
@@ -0,0 +1,12 @@
"""
ViewDesignEngine — CAD computational geometry engine for Python.
Submodules:
vde.core — Point3D, Vector3D, AABB3D, Polygon2D, convex hull, distance, transforms
vde.curves — BezierCurve, BSplineCurve, NurbsCurve
vde.mesh — delaunay_2d, delaunay_3d, HalfedgeMesh
"""
from ._vde import core, curves, mesh
__version__ = "1.0.0"
__all__ = ["core", "curves", "mesh"]
+41
View File
@@ -0,0 +1,41 @@
"""
vde.core — Core geometry types and operations.
Re-exports from the native _vde.core submodule:
Point2D, Point3D, Vector3D, AABB3D, Polygon2D
distance, convex_hull_2d, convex_hull_3d
translate, rotate, rotate_x, rotate_y, rotate_z, scale
"""
from vde._vde.core import (
Point2D,
Point3D,
Vector3D,
AABB3D,
Polygon2D,
distance,
convex_hull_2d,
convex_hull_3d,
translate,
rotate,
rotate_x,
rotate_y,
rotate_z,
scale,
)
__all__ = [
"Point2D",
"Point3D",
"Vector3D",
"AABB3D",
"Polygon2D",
"distance",
"convex_hull_2d",
"convex_hull_3d",
"translate",
"rotate",
"rotate_x",
"rotate_y",
"rotate_z",
"scale",
]
+17
View File
@@ -0,0 +1,17 @@
"""
vde.curves — Parametric curves for CAD.
Re-exports from the native _vde.curves submodule:
BezierCurve, BSplineCurve, NurbsCurve
"""
from vde._vde.curves import (
BezierCurve,
BSplineCurve,
NurbsCurve,
)
__all__ = [
"BezierCurve",
"BSplineCurve",
"NurbsCurve",
]
+21
View File
@@ -0,0 +1,21 @@
"""
vde.mesh — Mesh generation and processing.
Re-exports from the native _vde.mesh submodule:
delaunay_2d, delaunay_3d, DelaunayResult, TetrahedronMesh, HalfedgeMesh
"""
from vde._vde.mesh import (
delaunay_2d,
delaunay_3d,
DelaunayResult,
TetrahedronMesh,
HalfedgeMesh,
)
__all__ = [
"delaunay_2d",
"delaunay_3d",
"DelaunayResult",
"TetrahedronMesh",
"HalfedgeMesh",
]