fix: correct arc sweep direction for reversed normals and mirrored blocks

- Arc rendering now respects the normal vector: when normal.z < 0 the
  midpoint is placed on the clockwise side so the curve sweeps the right way
- Removed spurious .to_radians() / .to_degrees() round-trips in arc.rs
  (angles are already stored in the unit the trig functions expect)
- apply_grip and apply_transform use consistent angle units
- normalize_insert_entity no longer converts arc angles; the old conversion
  was only needed by the now-removed .to_radians() call in to_truck
- Added fix_mirrored_arc: swaps arc start/end angles when the INSERT has a
  mirrored scale (x_scale * y_scale < 0) so exploded arcs curve correctly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Sonnet 4.6 committed 2026-04-22 21:48:21 +03:00
1 parent a255b99863
commit e2f5715de8
3 files changed
+47 -30

No files matched your search

+2
View File
@@ -518,11 +518,13 @@ impl Scene {
}
if let EntityType::Insert(ins) = e {
let is_mirrored = ins.x_scale() * ins.y_scale() < 0.0;
return ins
.explode_from_document(&self.document)
.iter()
.cloned()
.map(crate::modules::home::modify::explode::normalize_insert_entity)
.map(|sub| crate::modules::home::modify::explode::fix_mirrored_arc(sub, is_mirrored))
.flat_map(|sub| {
let (sub_color, sub_pattern_length, sub_pattern, sub_line_weight_px, sub_aci) =
self.render_style(&sub);