Files
make-cad/docs/api/make_spline_redge.md
T
倪旌哲 b80a323445 feat: Add automation scripts for updating API exports and syncing documentation
- Introduced `make_export.py` to automate the update of `__init__.py` with new API functions from `operations.py` and `evolve.py`.
- Implemented function extraction, categorization, and generation of import statements and aliases.
- Added `ragflow_sync.py` for synchronizing SimpleCADAPI documentation with RAGFlow database, including chunking markdown files and managing dataset.
- Updated package version to 1.0.5 in `uv.lock`.
2025-07-24 02:11:44 +08:00

1.4 KiB

make_spline_redge

API定义

def make_spline_redge(points: List[Tuple[float, float, float]], tangents: Optional[List[Tuple[float, float, float]]] = None) -> Edge

来源文件: operations.py

API作用

创建平滑的样条曲线边,用于构建复杂的曲线路径。样条曲线会平滑地通过 所有控制点,可选择性地指定每个点的切线方向来控制曲线的形状。

API参数说明

points

  • 类型: List[Tuple[float, float, float]]
  • 说明: 控制点坐标列表 [(x, y, z), ...], 至少需要2个点,点的顺序决定样条曲线的走向

tangents

  • 类型: Optional[List[Tuple[float, float, float]]], optional
  • 说明: 可选的切线向量列表 [(x, y, z), ...],如果提供则数量必须与控制点一致

返回值说明

Edge: 创建的边对象,表示通过控制点的平滑样条曲线

异常

  • ValueError: 当控制点少于2个或切线向量数量不匹配时抛出异常

API使用例子

# 创建简单的样条曲线
points = [(0, 0, 0), (1, 2, 0), (3, 1, 0), (4, 3, 0)]
spline = make_spline_redge(points)
# 创建带切线控制的样条曲线
points = [(0, 0, 0), (2, 0, 0), (4, 0, 0)]
tangents = [(1, 0, 0), (0, 1, 0), (1, 0, 0)]
controlled_spline = make_spline_redge(points, tangents)
# 创建3D样条曲线
points_3d = [(0, 0, 0), (1, 1, 1), (2, 0, 2), (3, 1, 1)]
spline_3d = make_spline_redge(points_3d)