fix(3d): move and paste ACIS solids to the right place

Solids were missing from the entity transform dispatch, so move / rotate /
scale / mirror were silently no-ops on a 3D solid (only its wires shifted)
and a pasted solid stayed at its original location. Add a Transformable impl
for Solid3D/Region/Body/Surface (delegating to acadrust, which now composes
the move into the ACIS body placement) and register them in the dispatcher.

Also make cross-drawing paste land at the cursor: the clipboard centroid is
measured in the source drawing's offset-relative frame, so correct the paste
translation by the source/target world_offset difference (zero within one
drawing). Bumps acadrust for the solid-geometry transform fixes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-21 02:46:56 +03:00
commit de1f1c0e24
6 changed files with 49 additions and 4 deletions

View file

@ -594,7 +594,19 @@ impl OpenCADStudio {
if self.clipboard.is_empty() {
self.command_line.push_error("Clipboard is empty.");
} else {
let delta = base_pt - self.clipboard_centroid;
// The centroid was measured in the source drawing's
// offset-relative frame and `base_pt` is in this drawing's;
// correct by the world_offset difference so a cross-drawing
// paste lands at the cursor instead of drifting by the
// offset gap. Zero for a same-drawing paste. (#135)
let src_wo = self.clipboard_world_offset;
let tgt_wo = self.tabs[i].scene.world_offset;
let wo_corr = glam::Vec3::new(
(tgt_wo[0] - src_wo[0]) as f32,
(tgt_wo[1] - src_wo[1]) as f32,
(tgt_wo[2] - src_wo[2]) as f32,
);
let delta = base_pt - self.clipboard_centroid + wo_corr;
let translate = crate::command::EntityTransform::Translate(delta);
self.push_undo_snapshot(i, "PASTECLIP");
// Recreate any layer / linetype / style the copied entities