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 <noreply@anthropic.com>
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,
|
||||
|
||||
Reference in new issue
Block a user