Fixing docstring & angle calculation
Some checks are pending
benchmarks / benchmarks (macos-13, 3.12) (push) Waiting to run
benchmarks / benchmarks (macos-14, 3.12) (push) Waiting to run
benchmarks / benchmarks (ubuntu-latest, 3.12) (push) Waiting to run
benchmarks / benchmarks (windows-latest, 3.12) (push) Waiting to run
Upload coverage reports to Codecov / run (push) Waiting to run
pylint / lint (3.10) (push) Waiting to run
Run type checker / typecheck (3.10) (push) Waiting to run
Run type checker / typecheck (3.13) (push) Waiting to run
Wheel building and publishing / Build wheel on ubuntu-latest (push) Waiting to run
Wheel building and publishing / upload_pypi (push) Blocked by required conditions
tests / tests (macos-13, 3.10) (push) Waiting to run
tests / tests (macos-13, 3.13) (push) Waiting to run
tests / tests (macos-14, 3.10) (push) Waiting to run
tests / tests (macos-14, 3.13) (push) Waiting to run
tests / tests (ubuntu-latest, 3.10) (push) Waiting to run
tests / tests (ubuntu-latest, 3.13) (push) Waiting to run
tests / tests (windows-latest, 3.10) (push) Waiting to run
tests / tests (windows-latest, 3.13) (push) Waiting to run

This commit is contained in:
gumyr 2025-10-01 11:55:42 -04:00
parent 31a73bacda
commit 59a6e3623f
2 changed files with 12 additions and 14 deletions

View file

@ -29,7 +29,7 @@ license:
from __future__ import annotations
from math import cos, sin
from math import atan2, cos, sin
from typing import TYPE_CHECKING, Callable, TypeVar
from typing import cast as tcast
@ -746,7 +746,14 @@ def _make_tan_oriented_lines(
"""
q_curve, _, _, _, _ = _as_gcc_arg(curve, Tangency.UNQUALIFIED)
dir2d = gp_Dir2d(cos(angle), sin(angle))
# reference axis direction (2D angle in radians)
ref_dir = reference.direction
theta_ref = atan2(ref_dir.Y, ref_dir.X)
# total absolute angle
theta_abs = theta_ref + angle
dir2d = gp_Dir2d(cos(theta_abs), sin(theta_abs))
# Reference axis as gp_Lin2d
ref_lin = _gp_lin2d_from_axis(reference)

View file

@ -1851,9 +1851,6 @@ class Edge(Mixin1D, Shape[TopoDS_Edge]):
cls,
tangency_one: tuple[Axis | Edge, Tangency] | Axis | Edge,
tangency_two: Vector,
*,
angle: float | None = None,
direction: Vector | None = None,
) -> ShapeList[Edge]:
"""
Create all planar line(s) on the XY plane tangent to one curve and passing
@ -1865,10 +1862,6 @@ class Edge(Mixin1D, Shape[TopoDS_Edge]):
Geometric entity to be contacted/touched by the line(s).
tangency_two (Vector):
Fixed point through which the line(s) must pass.
angle : float, optional
Line orientation in degrees (measured CCW from the X-axis).
direction : Vector, optional
Direction vector for the line (only X and Y components are used).
Returns:
ShapeList[Edge]: tangent lines
@ -1889,15 +1882,13 @@ class Edge(Mixin1D, Shape[TopoDS_Edge]):
through a fixed point.
Args:
tangency_one
Fixed point through which the line(s) must pass.
tangency_two (Vector):
(tuple[Axis | Edge, Tangency] | Axis | Edge):
Geometric entity to be contacted/touched by the line(s).
tangency_one (Edge): edge that line will be tangent to
tangency_two (Axis): axis that angle will be measured against
angle : float, optional
Line orientation in degrees (measured CCW from the X-axis).
direction : Vector, optional
Direction vector for the line (only X and Y components are used).
Note: one of angle or direction must be provided
Returns:
ShapeList[Edge]: tangent lines