Skip to content

Commit 9fc403e

Browse files
Transfrom and crash fix
1 parent 3337b81 commit 9fc403e

File tree

1 file changed

+8
-1
lines changed
  • cadquery/occ_impl/exporters

1 file changed

+8
-1
lines changed

cadquery/occ_impl/exporters/dxf.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,17 @@ def _dxf_spline(e: Edge, msp: ezdxf.layouts.Modelspace, plane: Plane):
7676
curve, adaptor.FirstParameter(), adaptor.LastParameter(), CURVE_TOLERANCE
7777
)
7878

79+
# need to apply the transform on the geometry level
80+
spline.Transform(plane.fG.wrapped.Trsf())
81+
7982
order = spline.Degree() + 1
8083
knots = list(spline.KnotSequence())
8184
poles = [(p.X(), p.Y(), p.Z()) for p in spline.Poles()]
82-
weights = list(spline.Weights()) if spline.IsRational() else None
85+
weights = (
86+
[spline.Weight(i) for i in range(1, spline.NbPoles() + 1)]
87+
if spline.IsRational()
88+
else None
89+
)
8390

8491
if spline.IsPeriodic():
8592
pad = spline.NbKnots() - spline.LastUKnotIndex()

0 commit comments

Comments
 (0)