Files
make-cad/docs/api/make_angle_arc_rwire.md
T
倪旌哲 e907fa88a4 Add Vertex and Wire classes documentation; implement auto documentation generation script
- Created `vertex.md` and `wire.md` to document the Vertex and Wire classes in the SimpleCAD API, detailing their attributes, methods, and usage examples.
- Introduced `auto_docs_gen.py` script to automate the extraction of API information from `operations.py` and generate markdown documentation.
- Updated `operations.py` to correct a comment regarding the target normal vector in the `helical_sweep_rsolid` function.
2025-07-06 23:24:31 +08:00

1.3 KiB

make_angle_arc_rwire

API定义

def make_angle_arc_rwire(center: Tuple[float, float, float], radius: float, start_angle: float, end_angle: float, normal: Tuple[float, float, float] = (0, 0, 1)) -> Wire

API作用

通过指定中心点、半径和角度范围创建圆弧线。 角度采用度数制,0度对应X轴正方向,逆时针为正角度。 可以创建任意角度范围的圆弧线。

API参数说明

center

  • 说明: 圆心坐标

radius

  • 说明: 半径

start_angle

  • 说明: 起始角度(弧度)

end_angle

  • 说明: 结束角度(弧度)

normal

  • 说明: 法向量

返回值

Wire: 线对象,表示通过角度创建的圆弧线

异常

  • ValueError: 当半径小于等于0或其他参数无效时

API使用例子

>>> # 创建90度圆弧线(从0度到90度)
>>> arc_90_wire = make_angle_arc_rwire((0, 0, 0), 2.0, 0, 90)

>>> # 创建180度半圆弧线
>>> semicircle_wire = make_angle_arc_rwire((0, 0, 0), 1.5, 0, 180)

>>> # 创建270度圆弧线
>>> arc_270_wire = make_angle_arc_rwire((0, 0, 0), 1.0, 45, 315)

>>> # 创建垂直平面(YZ,法相指向X轴正方向)上的圆弧线
>>> vertical_arc_wire = make_angle_arc_rwire((0, 0, 0), 1.0, 0, 90, (1, 0, 0))