forked from 1b-agent/opencadstudio-upstream
Merge remote-tracking branch 'origin/main' into codex/pdf-attach-parity
# Conflicts: # locales/ar-SA/opencadstudio.ftl # locales/bg-BG/opencadstudio.ftl # locales/cs-CZ/opencadstudio.ftl # locales/de-DE/opencadstudio.ftl # locales/el-GR/opencadstudio.ftl # locales/en-US/opencadstudio.ftl # locales/es-ES/opencadstudio.ftl # locales/fi-FI/opencadstudio.ftl # locales/fr-FR/opencadstudio.ftl # locales/hi-IN/opencadstudio.ftl # locales/hu-HU/opencadstudio.ftl # locales/it-IT/opencadstudio.ftl # locales/ja-JP/opencadstudio.ftl # locales/ko-KR/opencadstudio.ftl # locales/nl-NL/opencadstudio.ftl # locales/pl-PL/opencadstudio.ftl # locales/pt-BR/opencadstudio.ftl # locales/ru-RU/opencadstudio.ftl # locales/tr-TR/opencadstudio.ftl # locales/zh-CN/opencadstudio.ftl # locales/zh-TW/opencadstudio.ftl # src/app/control/actions.rs # src/app/mod.rs # src/app/update/mod.rs # src/app/view/modal.rs # src/io/xref.rs # src/ui/window/mod.rs
This commit is contained in:
commit
c1ecb0edaf
77 files changed
+5695
-606
No files matched your search
@@ -1428,6 +1428,19 @@ impl Scene {
|
||||
sy += y as f64;
|
||||
n += 1;
|
||||
}
|
||||
// SDF text is carried as textured glyph quads, not ordinary wire
|
||||
// points. Include those vertices so a text-only wire participates
|
||||
// in the robust-centre filter used by ZOOM EXTENTS.
|
||||
for vertex in &wire.text_verts {
|
||||
let x = vertex.pos[0] as f64 + vertex.pos_low[0] as f64;
|
||||
let y = vertex.pos[1] as f64 + vertex.pos_low[1] as f64;
|
||||
if !x.is_finite() || !y.is_finite() {
|
||||
continue;
|
||||
}
|
||||
sx += x;
|
||||
sy += y;
|
||||
n += 1;
|
||||
}
|
||||
if n > 0 {
|
||||
cents.push(WireCent {
|
||||
idx,
|
||||
@@ -1486,6 +1499,17 @@ impl Scene {
|
||||
max = max.max(glam::Vec3::new(x, y, z));
|
||||
}
|
||||
}
|
||||
for vertex in &wire.text_verts {
|
||||
let point = glam::Vec3::new(
|
||||
vertex.pos[0] + vertex.pos_low[0],
|
||||
vertex.pos[1] + vertex.pos_low[1],
|
||||
vertex.pos[2] + vertex.pos_low[2],
|
||||
);
|
||||
if point.is_finite() {
|
||||
min = min.min(point);
|
||||
max = max.max(point);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Fold in 3D-solid mesh AABBs (not subject to the wire IQR reject).
|
||||
for ([ax, ay, bx, by], [az, bz]) in &mesh_aabbs {
|
||||
|
||||
+2
-2
@@ -2884,11 +2884,11 @@ impl Scene {
|
||||
/// standard linetypes and a compatible page setup on every paper layout.
|
||||
pub fn populate_new_drawing_defaults(&mut self) {
|
||||
crate::io::linetypes::populate_document(&mut self.document);
|
||||
// A new drawing is metric, as the reference's ISO template: millimetre
|
||||
// A new drawing is metric, as the reference's new drawing: metre
|
||||
// insertion units, metric measurement, and the ISO-25 dimension style
|
||||
// current. Standard stays available for imperial work.
|
||||
self.document.header.measurement = 1;
|
||||
self.document.header.insertion_units = 4;
|
||||
self.document.header.insertion_units = 6;
|
||||
let iso = crate::scene::creation_style::ensure_iso_dim_style(&mut self.document);
|
||||
self.document.header.current_dimstyle_name = "ISO-25".to_string();
|
||||
// The name alone leaves the header pointing at the previous style, and
|
||||
|
||||
@@ -633,6 +633,28 @@ impl WireModel {
|
||||
out
|
||||
}
|
||||
|
||||
/// Return a preview clone with every point mapped through `map` (an
|
||||
/// INSERT-style placement: per-axis scale, rotation, translation).
|
||||
/// Tangent geometry is dropped; a preview is not snapped to.
|
||||
pub fn mapped(&self, map: impl Fn(glam::DVec3) -> glam::DVec3) -> Self {
|
||||
let mut out = self.clone();
|
||||
out.name = format!("preview_{}", self.name);
|
||||
out.color = Self::CYAN;
|
||||
out.selected = false;
|
||||
map_points(&mut out.points, &mut out.points_low, &map);
|
||||
if let Some(marker) = &mut out.point_marker {
|
||||
marker.origin = map(marker.origin);
|
||||
}
|
||||
if !out.text_verts.is_empty() {
|
||||
out.text_verts = map_text_verts(&self.text_verts, |x, y, z| {
|
||||
let p = map(glam::DVec3::new(x, y, z));
|
||||
(p.x, p.y, p.z)
|
||||
});
|
||||
}
|
||||
out.tangent_geoms.clear();
|
||||
out
|
||||
}
|
||||
|
||||
/// Return a clone with every point rotated around `center` by `angle_rad`.
|
||||
pub fn rotated(&self, center: glam::Vec3, angle_rad: f32) -> Self {
|
||||
self.rotated_about_axis(center, glam::Vec3::Z, angle_rad)
|
||||
|
||||
@@ -2507,7 +2507,9 @@ impl super::Scene {
|
||||
}
|
||||
|
||||
/// The document as written to a file: a dynamic dimension's screen-size
|
||||
/// overrides are a display matter and stay out of the file.
|
||||
/// overrides are a display matter and stay out of the file, and so does
|
||||
/// what resolving an external reference merged in (its geometry, nested
|
||||
/// blocks and styles), which the file never stores.
|
||||
pub(crate) fn document_for_save(&self) -> acadrust::CadDocument {
|
||||
use crate::entities::dim_override as ov;
|
||||
let mut document = self.document.clone();
|
||||
@@ -2530,6 +2532,7 @@ impl super::Scene {
|
||||
}
|
||||
}
|
||||
}
|
||||
crate::io::xref::strip_resolved_xref_content(&mut document);
|
||||
document
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user