forked from 1b-agent/opencadstudio-upstream
chore: bump codec d28fd71, kernel a03e4f0, graph 79bdc4b
Codec: PRs #71-#74 merged (MPOLYGON layout, multiline ATTDEF/ATTRIB DXF, DXF MATERIAL/ACSH matrix, restorable SAT/SAB + history roots) and issues #55 #64-#69 fixed. EntityType now boxes Surface, Extended, Table, MultiLeader and Helix (2344 B -> 848 B per entity): construction sites wrap in Box, the entity traits forward through Box, and the python plugin generator converts with into(). Kernel: PR #70 (cuboid ring winding). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
8c1471078d
commit
443b935a3f
31 files changed
+147
-84
No files matched your search
@@ -160,7 +160,7 @@ impl CadCommand for DataLinkPlaceCommand {
|
||||
self.table.insertion_point = codec::types::Vector3::new(point.x, point.y, point.z);
|
||||
CmdResult::CommitAndExit(
|
||||
self.plane
|
||||
.place_entity(EntityType::Table(self.table.clone())),
|
||||
.place_entity(EntityType::Table(Box::new(self.table.clone()))),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ impl MLeaderCommand {
|
||||
ml.text_style_handle = style_handle;
|
||||
ml.context.text_style_handle = style_handle;
|
||||
}
|
||||
let entity = self.plane.place_entity(EntityType::MultiLeader(ml));
|
||||
let entity = self.plane.place_entity(EntityType::MultiLeader(Box::new(ml)));
|
||||
if self.content_type == LeaderContentType::MText && self.text.is_empty() {
|
||||
CmdResult::CommitAndEditText(entity)
|
||||
} else {
|
||||
|
||||
@@ -271,7 +271,7 @@ impl TableCommand {
|
||||
row.style = Some(styles[row_index.min(2)].clone());
|
||||
}
|
||||
}
|
||||
self.plane.place_entity(EntityType::Table(table))
|
||||
self.plane.place_entity(EntityType::Table(Box::new(table)))
|
||||
}
|
||||
|
||||
fn preview_grid(
|
||||
@@ -795,7 +795,7 @@ impl CadCommand for TableCellEditCommand {
|
||||
cell.set_text(&formatted);
|
||||
self.table.block_record_handle = None;
|
||||
Some(CmdResult::ReplaceMany(
|
||||
vec![(self.handle, vec![EntityType::Table(self.table.clone())])],
|
||||
vec![(self.handle, vec![EntityType::Table(Box::new(self.table.clone()))])],
|
||||
Vec::new(),
|
||||
))
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ impl HelixCommand {
|
||||
helix.turn_height = if curve.turns == 0.0 { 0.0 } else { height / curve.turns };
|
||||
helix.handedness = self.counter_clockwise;
|
||||
helix.constraint = self.constraint;
|
||||
Some(EntityType::Helix(helix))
|
||||
Some(EntityType::Helix(Box::new(helix)))
|
||||
}
|
||||
|
||||
fn commit(&mut self, height: f64, axis: DVec3) -> CmdResult {
|
||||
|
||||
@@ -75,7 +75,8 @@ impl ReverseCommand {
|
||||
}
|
||||
EntityType::Spline(sp) => Some(EntityType::Spline(reverse_spline(sp))),
|
||||
EntityType::Helix(helix) => {
|
||||
crate::entities::helix::reversed(helix).map(EntityType::Helix)
|
||||
crate::entities::helix::reversed(helix)
|
||||
.map(|helix| EntityType::Helix(Box::new(helix)))
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
|
||||
@@ -117,7 +117,10 @@ impl PointCloudCropCommand {
|
||||
if let ExtendedEntityData::PointCloudEx(data) = &mut cloud.data {
|
||||
change(data);
|
||||
}
|
||||
CmdResult::UpdateEntityAndFinish { handle: self.handle, entity: EntityType::Extended(cloud) }
|
||||
CmdResult::UpdateEntityAndFinish {
|
||||
handle: self.handle,
|
||||
entity: EntityType::Extended(Box::new(cloud)),
|
||||
}
|
||||
}
|
||||
|
||||
fn axes(data: &PointCloudExData) -> glam::DMat3 {
|
||||
@@ -296,7 +299,7 @@ impl CadCommand for PointCloudCropCommand {
|
||||
match self.picked.take() {
|
||||
Some(EntityType::Extended(cloud)) if matches!(cloud.data, ExtendedEntityData::PointCloudEx(_)) => {
|
||||
self.handle = handle;
|
||||
self.cloud = Some(cloud);
|
||||
self.cloud = Some(*cloud);
|
||||
if self.uncrop {
|
||||
return self.finish(|data| data.croppings.clear());
|
||||
}
|
||||
|
||||
@@ -2793,7 +2793,7 @@ pub fn empty_extruded_surface(direction: DVec3, taper_angle: f64) -> EntityType
|
||||
options.is_solid = false;
|
||||
*sweep_vector = Vector3::new(direction.x, direction.y, direction.z);
|
||||
}
|
||||
EntityType::Surface(surface)
|
||||
EntityType::Surface(Box::new(surface))
|
||||
}
|
||||
|
||||
pub fn empty_revolved_surface(
|
||||
@@ -2832,7 +2832,7 @@ pub fn empty_revolved_surface(
|
||||
*stored_start = start_angle;
|
||||
*solid = false;
|
||||
}
|
||||
EntityType::Surface(surface)
|
||||
EntityType::Surface(Box::new(surface))
|
||||
}
|
||||
|
||||
// ── Autocomplete registry ─────────────────────────────────
|
||||
@@ -2909,7 +2909,7 @@ mod thicken_command_tests {
|
||||
let handle = Handle::new(42);
|
||||
let mut command = ThickenCommand::new(vec![
|
||||
(Handle::new(1), EntityType::Line(codec::entities::Line::default())),
|
||||
(handle, EntityType::Surface(codec::entities::Surface::new(codec::entities::SurfaceKind::Plane))),
|
||||
(handle, EntityType::Surface(Box::new(codec::entities::Surface::new(codec::entities::SurfaceKind::Plane)))),
|
||||
]);
|
||||
assert!(!command.is_selection_gathering());
|
||||
assert_eq!(command.handles, vec![handle]);
|
||||
|
||||
@@ -172,7 +172,7 @@ impl SectionPlaneCommand {
|
||||
self.kind == SectionKind::Slice,
|
||||
depth,
|
||||
);
|
||||
EntityType::Extended(entity)
|
||||
EntityType::Extended(Box::new(entity))
|
||||
}
|
||||
|
||||
fn line_at(&self, point: DVec3, viewing: DVec3, vertical_hint: DVec3) -> (Vec<DVec3>, DVec3) {
|
||||
|
||||
Reference in new issue
Block a user