Files
make-cad/docs/api/make_spline_rwire.md
T
倪旌哲 a9d1de7747 Add beartype and ragflow-sdk packages; update simplecadapi version
- Introduced beartype version 0.18.5 with its source and wheel details.
- Added ragflow-sdk version 0.19.1, including dependencies on beartype and requests.
- Updated simplecadapi version from 0.1.2 to 1.0.0.
- Included ragflow-sdk in dev dependencies for testing purposes.
2025-07-07 03:01:09 +08:00

50 lines
1.3 KiB
Markdown

# make_spline_rwire
## API定义
```python
def make_spline_rwire(points: List[Tuple[float, float, float]], tangents: Optional[List[Tuple[float, float, float]]] = None, closed: bool = False) -> Wire
```
## API作用
创建样条曲线线对象,与make_spline_redge功能相同但返回线对象。
可以设置为闭合样条曲线,适用于构建复杂的封闭轮廓。
## API参数说明
### points
- **类型**: `List[Tuple[float, float, float]]`
- **说明**: 控制点坐标列表 [(x, y, z), ...], 至少需要2个点,点的顺序决定样条曲线的走向
### tangents
- **类型**: `Optional[List[Tuple[float, float, float]]], optional`
- **说明**: 可选的切线向量列表 [(x, y, z), ...],如果提供则数量必须与控制点一致
### closed
- **类型**: `bool, optional`
- **说明**: 是否创建闭合的样条曲线,默认为False
### 返回值
Wire: 创建的线对象,包含一个样条曲线
## 异常
- **ValueError**: 当控制点少于2个或切线向量数量不匹配时抛出异常
## API使用例子
```python
# 创建开放样条曲线线
points = [(0, 0, 0), (2, 3, 0), (4, 1, 0), (6, 2, 0)]
spline_wire = make_spline_rwire(points)
# 创建闭合样条曲线
points = [(0, 0, 0), (2, 2, 0), (4, 0, 0), (2, -2, 0)]
closed_spline = make_spline_rwire(points, closed=True)
```