forked from 1b-agent/opencadstudio-upstream
refactor(wire): add WireModel.points_low parallel buffer (empty default)
Foundation for double-single positions: WireModel now carries an index-paired f32 residual buffer (`points_low`) next to the existing `points` high half. Empty means "all-zero residual", so every existing constructor (interactive draw, previews) is unchanged in behaviour; tessellation from CAD f64 will fill it in the next steps so vertex precision survives at UTM-scale coordinates. Co-Authored-By: Claude Opus 4.7 <[email protected]>
This commit is contained in:
1 parent
a0b4968ad2
commit
97d6993768
39 files changed
+72
-1
No files matched your search
@@ -94,6 +94,7 @@ impl CadCommand for AlignedDimensionCommand {
|
||||
Some(WireModel {
|
||||
name: "dimaligned_preview".into(),
|
||||
points: vec![[p1.x, p1.y, p1.z], [p2.x, p2.y, p2.z]],
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
@@ -134,6 +135,7 @@ fn preview_aligned(p1: Vec3, p2: Vec3, dim_pt: Vec3) -> WireModel {
|
||||
[d1.x, d1.y, d1.z],
|
||||
[d2.x, d2.y, d2.z],
|
||||
],
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -126,6 +126,7 @@ fn preview_wire(points: Vec<Vec3>) -> WireModel {
|
||||
WireModel {
|
||||
name: "dimangular_preview".to_string(),
|
||||
points: points.into_iter().map(|p| [p.x, p.y, p.z]).collect(),
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -97,6 +97,7 @@ fn preview_line(a: Vec3, b: Vec3) -> WireModel {
|
||||
WireModel {
|
||||
name: "dimdia_preview".into(),
|
||||
points: vec![[a.x, a.y, a.z], [b.x, b.y, b.z]],
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -155,6 +155,7 @@ impl CadCommand for DimBaselineCommand {
|
||||
[dim_line_pt.x, dim_line_pt.y, dim_line_pt.z],
|
||||
[dim_line_pt2.x, dim_line_pt2.y, dim_line_pt2.z],
|
||||
],
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -135,6 +135,7 @@ impl CadCommand for DimContinueCommand {
|
||||
[dim_line_pt.x, dim_line_pt.y, dim_line_pt.z],
|
||||
[dim_line_pt2.x, dim_line_pt2.y, dim_line_pt2.z],
|
||||
],
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -92,6 +92,7 @@ impl CadCommand for DimJogLineCommand {
|
||||
[pt.x + d * 0.3, pt.y, pt.z - d],
|
||||
[pt.x + d, pt.y, pt.z],
|
||||
],
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -106,6 +106,7 @@ impl CadCommand for DimTeditCommand {
|
||||
[pt.x - d, pt.y, pt.z + d],
|
||||
[pt.x - d, pt.y, pt.z - d],
|
||||
],
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -165,6 +165,7 @@ fn preview_wire(pts: &[Vec3]) -> WireModel {
|
||||
WireModel {
|
||||
name: "leader_preview".into(),
|
||||
points,
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -133,6 +133,7 @@ fn preview_wire(points: Vec<Vec3>) -> WireModel {
|
||||
WireModel {
|
||||
name: "dimlinear_preview".to_string(),
|
||||
points: points.into_iter().map(|p| [p.x, p.y, p.z]).collect(),
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -151,6 +151,7 @@ fn preview_wire(pts: &[Vec3]) -> WireModel {
|
||||
WireModel {
|
||||
name: "mleader_preview".into(),
|
||||
points,
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -458,6 +458,7 @@ fn preview_wire(pts: &[Vec3]) -> WireModel {
|
||||
WireModel {
|
||||
name: "mleader_edit_preview".into(),
|
||||
points: pts.iter().map(|p| [p.x, p.y, p.z]).collect(),
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -90,6 +90,7 @@ impl CadCommand for QdimCommand {
|
||||
Some(WireModel {
|
||||
name: "qdim_preview".into(),
|
||||
points: vec![[pt.x - d * 3.0, pt.y, pt.z], [pt.x + d * 3.0, pt.y, pt.z]],
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -102,6 +102,7 @@ fn preview_wire(points: Vec<Vec3>) -> WireModel {
|
||||
WireModel {
|
||||
name: "dimradius_preview".to_string(),
|
||||
points: points.into_iter().map(|p| [p.x, p.y, p.z]).collect(),
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -150,6 +150,7 @@ impl CadCommand for TableCommand {
|
||||
[x, y, z - h],
|
||||
[x, y, z],
|
||||
],
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -92,6 +92,7 @@ impl CadCommand for ToleranceCommand {
|
||||
[pt.x, pt.y, pt.z - d],
|
||||
[pt.x, pt.y, pt.z + d],
|
||||
],
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -168,6 +168,7 @@ impl CadCommand for AttdefCommand {
|
||||
[pt.x, pt.y, pt.z - d],
|
||||
[pt.x, pt.y, pt.z + d],
|
||||
],
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -613,6 +613,7 @@ fn line_wire(from: Vec3, to: Vec3) -> WireModel {
|
||||
WireModel {
|
||||
name: "rubber_band".into(),
|
||||
points: vec![[from.x, from.y, from.z], [to.x, to.y, to.z]],
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -78,6 +78,7 @@ impl CadCommand for LineCommand {
|
||||
Some(WireModel {
|
||||
name: "rubber_band".to_string(),
|
||||
points: vec![[last.x, last.y, last.z], [pt.x, pt.y, pt.z]],
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -133,6 +133,7 @@ impl CadCommand for MlineCommand {
|
||||
Some(WireModel {
|
||||
name: "mline_preview".into(),
|
||||
points: pts,
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -110,6 +110,7 @@ impl CadCommand for ImageCommand {
|
||||
Some(WireModel {
|
||||
name: "image_preview".into(),
|
||||
points: vec![p0, p1, p2, p3, p0],
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -76,6 +76,7 @@ impl CadCommand for RayCommand {
|
||||
Some(WireModel {
|
||||
name: "ray_preview".into(),
|
||||
points: vec![[base.x, base.y, base.z], [far.x, far.y, far.z]],
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
@@ -157,6 +158,7 @@ impl CadCommand for XLineCommand {
|
||||
[far_neg.x, far_neg.y, far_neg.z],
|
||||
[far_pos.x, far_pos.y, far_pos.z],
|
||||
],
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -82,6 +82,7 @@ impl CadCommand for RevCloudCommand {
|
||||
Some(WireModel {
|
||||
name: "revcloud_preview".into(),
|
||||
points: preview_pts,
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -122,6 +122,7 @@ impl CadCommand for WipeoutCommand {
|
||||
[min.x, max.y, max.z],
|
||||
[min.x, min.y, min.z],
|
||||
],
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
@@ -148,6 +149,7 @@ impl CadCommand for WipeoutCommand {
|
||||
Some(WireModel {
|
||||
name: "wipeout_poly_preview".into(),
|
||||
points: pts,
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -66,6 +66,7 @@ impl CadCommand for AreaCommand {
|
||||
Some(WireModel {
|
||||
name: "area_preview".into(),
|
||||
points: pts,
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -61,6 +61,7 @@ impl CadCommand for DistCommand {
|
||||
Some(WireModel {
|
||||
name: "dist_preview".into(),
|
||||
points: vec![[p1.x, p1.y, p1.z], [pt.x, pt.y, pt.z]],
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -88,6 +88,7 @@ impl CadCommand for MviewCommand {
|
||||
[c1.x, pt.y, c1.z],
|
||||
[c1.x, c1.y, c1.z],
|
||||
],
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -307,6 +307,7 @@ fn wire(name: &str, points: Vec<[f32; 3]>) -> WireModel {
|
||||
WireModel {
|
||||
name: name.into(),
|
||||
points,
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -59,6 +59,7 @@ impl CadCommand for PlotWindowCommand {
|
||||
[p1.x, pt.y, pt.z],
|
||||
[p1.x, p1.y, p1.z],
|
||||
],
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
@@ -59,6 +59,7 @@ impl CadCommand for ZoomWindowCommand {
|
||||
[min.x, max.y, 0.0],
|
||||
[min.x, min.y, 0.0],
|
||||
],
|
||||
points_low: Vec::new(),
|
||||
color: WireModel::CYAN,
|
||||
selected: false,
|
||||
pattern_length: 0.0,
|
||||
|
||||
Reference in new issue
Block a user