feat: implement OCS→WCS transform for Arc, Circle, and Line

Entities carrying a non-standard extrusion normal (normal ≠ (0,0,1)) were
rendered flat in the XY plane. The DXF arbitrary-axis algorithm is now
implemented in scene::transform::{ocs_axes, ocs_point_to_wcs} and applied
during tessellation of Arc, Circle, and Line so they render correctly on
tilted planes in 3D DXF files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-05-02 17:13:42 +03:00
commit 674a94f756
4 changed files with 117 additions and 33 deletions

View file

@ -12,8 +12,15 @@ use crate::scene::object::{GripApply, GripDef, PropSection};
use crate::scene::wire_model::TangentGeom;
fn to_truck(line: &Line) -> TruckEntity {
let p0 = Point3::new(line.start.x, line.start.y, line.start.z);
let p1 = Point3::new(line.end.x, line.end.y, line.end.z);
let normal = (line.normal.x, line.normal.y, line.normal.z);
let (sx, sy, sz) = crate::scene::transform::ocs_point_to_wcs(
(line.start.x, line.start.y, line.start.z), normal,
);
let (ex, ey, ez) = crate::scene::transform::ocs_point_to_wcs(
(line.end.x, line.end.y, line.end.z), normal,
);
let p0 = Point3::new(sx, sy, sz);
let p1 = Point3::new(ex, ey, ez);
let v0 = builder::vertex(p0);
let v1 = builder::vertex(p1);
let edge = builder::line(&v0, &v1);