Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cadquery/occ_impl/exporters/dxf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""DXF export utilities."""

import warnings
from typing import (
Any,
Dict,
Expand Down Expand Up @@ -244,6 +245,13 @@ def _dxf_circle(edge: Edge) -> DxfEntityAttributes:
direction_y = circ.YAxis().Direction()
direction_z = circ.Axis().Direction()

# DXF circle does not support tilted 3D circles.
dz = gp_Dir(0, 0, 1)
if abs(RAD2DEG * direction_z.Angle(dz)) % 180 > 1e-6:
warnings.warn(
"Circle not coplanar. This will fail in the future.",
)

dy = gp_Dir(0, 1, 0)

phi = direction_y.AngleWithRef(dy, direction_z)
Expand Down