forked from 1b-agent/opencadstudio-upstream
fix(pick): hit-test lineweight width and thickness walls
Selection tested a flat 8 px radius around each wire's centreline and nothing else, so two things the user can see were not pickable. A wire renders as a band `line_weight_px` wide, so pick now widens to that rendered half-width via `pick_tolerance_px`, mirroring the wire shader's `select(0.5, half_width, lwdisplay_enable)`. Behaviour is unchanged for every standard weight (the widest, 2.11 mm, renders 7.97 px half-width — just under the 8 px threshold); this keeps the two sides from drifting apart if the display boost in `lineweight_to_px` ever changes. Entities extruded by a DXF thickness draw their wall as four edges with nothing in between, so the interior was a hole the cursor fell through. WireModel gains `pick_tris`: triangles hit-testing treats as solid and the renderer never uploads. Kept apart from `fill_tris` because that channel reaches the GPU, and a wall that rendered shaded would change how every thickness drawing looks. Ranked below `fill_tris` — those are drawn, these are not, so where they overlap the drawn face is what the user means. Walls are dropped when a wire is projected into a floating viewport: `points` are reprojected and clipped into paper coords there, so cloned model-space triangles would hit-test at a model-scale offset. Extruded entities stay selectable by their edges, which do get projected. The wall loop runs on every hover that misses everything else, so it rejects on the wire's AABB first — an extruded circle is ~128 triangles and a drawing full of thickness would otherwise project every wall on each mouse move. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
72d471c2e7
commit
3f060a570a
63 files changed
+514
-83
No files matched your search
+12
-10
@@ -6,7 +6,7 @@ use crate::entities::common::{
|
||||
center_grip, edit_prop as edit, parse_f64, ro_prop as ro, square_grip,
|
||||
};
|
||||
use crate::entities::traits::TruckConvertible;
|
||||
use crate::scene::convert::acad_to_truck::{TruckEntity, TruckObject};
|
||||
use crate::scene::convert::acad_to_truck::{extrusion_wall_tris, TruckEntity, TruckObject};
|
||||
use crate::scene::model::object::{GripApply, GripDef, PropSection};
|
||||
use crate::scene::model::wire_model::{SnapHint, TangentGeom};
|
||||
|
||||
@@ -56,17 +56,17 @@ fn to_truck(arc: &Arc) -> TruckEntity {
|
||||
let n = 32usize;
|
||||
let ccw_end = if ea >= sa { ea } else { ea + TAU };
|
||||
let (start_a, end_a) = (sa, ccw_end);
|
||||
let base: Vec<[f64; 3]> = (0..=n)
|
||||
.map(|i| {
|
||||
let p = arc_pt(start_a + (end_a - start_a) * (i as f64 / n as f64));
|
||||
[p.x, p.y, p.z]
|
||||
})
|
||||
.collect();
|
||||
let mut pts: Vec<[f64; 3]> = Vec::with_capacity((n + 1) * 2 + 8);
|
||||
for i in 0..=n {
|
||||
let a = start_a + (end_a - start_a) * (i as f64 / n as f64);
|
||||
let p = arc_pt(a);
|
||||
pts.push([p.x, p.y, p.z]);
|
||||
}
|
||||
pts.extend_from_slice(&base);
|
||||
pts.push([f64::NAN; 3]);
|
||||
for i in 0..=n {
|
||||
let a = start_a + (end_a - start_a) * (i as f64 / n as f64);
|
||||
let p = arc_pt(a);
|
||||
pts.push([p.x + t * nx, p.y + t * ny, p.z + t * nz]);
|
||||
for &[x, y, z] in &base {
|
||||
pts.push([x + t * nx, y + t * ny, z + t * nz]);
|
||||
}
|
||||
pts.push([f64::NAN; 3]);
|
||||
let ps = arc_pt(sa);
|
||||
@@ -77,6 +77,7 @@ fn to_truck(arc: &Arc) -> TruckEntity {
|
||||
pts.push([pe.x, pe.y, pe.z]);
|
||||
pts.push([pe.x + t * nx, pe.y + t * ny, pe.z + t * nz]);
|
||||
return TruckEntity {
|
||||
pick_tris: extrusion_wall_tris(&base, [t * nx, t * ny, t * nz]),
|
||||
object: TruckObject::Lines(pts),
|
||||
snap_pts: vec![(cv, SnapHint::Center), (mv, SnapHint::Midpoint)],
|
||||
tangent_geoms: vec![tangent],
|
||||
@@ -92,6 +93,7 @@ fn to_truck(arc: &Arc) -> TruckEntity {
|
||||
let v_end = builder::vertex(p_end);
|
||||
let edge = builder::circle_arc(&v_start, &v_end, p_mid);
|
||||
TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Curve(edge),
|
||||
snap_pts: vec![(cv, SnapHint::Center), (mv, SnapHint::Midpoint)],
|
||||
tangent_geoms: vec![tangent],
|
||||
|
||||
@@ -216,6 +216,7 @@ fn build_attr_truck(input: AttrTextInputs<'_>, document: &acadrust::CadDocument)
|
||||
let _ = input.line_count;
|
||||
let _ = input.is_multiline;
|
||||
return TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Text(layout.strokes),
|
||||
snap_pts: vec![(snap_pt, SnapHint::Insertion)],
|
||||
tangent_geoms: vec![],
|
||||
@@ -313,6 +314,7 @@ fn build_attr_truck(input: AttrTextInputs<'_>, document: &acadrust::CadDocument)
|
||||
let _ = input.line_count; // round-trip only — recomputed above
|
||||
|
||||
TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Text(strokes_all),
|
||||
snap_pts: vec![(snap_pt, SnapHint::Insertion)],
|
||||
tangent_geoms: vec![],
|
||||
|
||||
+11
-7
@@ -6,7 +6,7 @@ use crate::entities::common::{
|
||||
center_grip, edit_prop as edit, parse_f64, ro_prop as ro, square_grip,
|
||||
};
|
||||
use crate::entities::traits::TruckConvertible;
|
||||
use crate::scene::convert::acad_to_truck::{TruckEntity, TruckObject};
|
||||
use crate::scene::convert::acad_to_truck::{extrusion_wall_tris, TruckEntity, TruckObject};
|
||||
use crate::scene::model::object::{GripApply, GripDef, PropSection};
|
||||
use crate::scene::model::wire_model::{SnapHint, TangentGeom};
|
||||
|
||||
@@ -64,14 +64,16 @@ fn to_truck(circle: &Circle) -> TruckEntity {
|
||||
cwz + r * (c * ax.2 + s * ay.2),
|
||||
)
|
||||
};
|
||||
let base: Vec<[f64; 3]> = (0..=n)
|
||||
.map(|i| {
|
||||
let (x, y, z) = circ_pt(i as f64 * tau / n as f64);
|
||||
[x, y, z]
|
||||
})
|
||||
.collect();
|
||||
let mut pts: Vec<[f64; 3]> = Vec::with_capacity((n + 1) * 2 + 4 * 3);
|
||||
for i in 0..=n {
|
||||
let (x, y, z) = circ_pt(i as f64 * tau / n as f64);
|
||||
pts.push([x, y, z]);
|
||||
}
|
||||
pts.extend_from_slice(&base);
|
||||
pts.push([f64::NAN; 3]);
|
||||
for i in 0..=n {
|
||||
let (x, y, z) = circ_pt(i as f64 * tau / n as f64);
|
||||
for &[x, y, z] in &base {
|
||||
pts.push([x + t * nx, y + t * ny, z + t * nz]);
|
||||
}
|
||||
pts.push([f64::NAN; 3]);
|
||||
@@ -84,6 +86,7 @@ fn to_truck(circle: &Circle) -> TruckEntity {
|
||||
}
|
||||
}
|
||||
return TruckEntity {
|
||||
pick_tris: extrusion_wall_tris(&base, [t * nx, t * ny, t * nz]),
|
||||
object: TruckObject::Lines(pts),
|
||||
snap_pts,
|
||||
tangent_geoms: vec![tangent],
|
||||
@@ -98,6 +101,7 @@ fn to_truck(circle: &Circle) -> TruckEntity {
|
||||
let lower = builder::circle_arc(&left, &right, p_bot);
|
||||
let wire: Wire = [upper, lower].into_iter().collect();
|
||||
TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Contour(wire),
|
||||
snap_pts,
|
||||
tangent_geoms: vec![tangent],
|
||||
|
||||
@@ -1352,6 +1352,8 @@ fn tessellate_dimension_inner(
|
||||
let (ext1, ext2) = split_ext_lines(&geom.ext_lines);
|
||||
if !ext1.is_empty() {
|
||||
wires.push(WireModel {
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
dash_from_start: false,
|
||||
dash_align_end: None,
|
||||
text_verts: Vec::new(),
|
||||
@@ -1376,6 +1378,8 @@ fn tessellate_dimension_inner(
|
||||
}
|
||||
if !ext2.is_empty() {
|
||||
wires.push(WireModel {
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
dash_from_start: false,
|
||||
dash_align_end: None,
|
||||
text_verts: Vec::new(),
|
||||
@@ -1400,6 +1404,8 @@ fn tessellate_dimension_inner(
|
||||
}
|
||||
} else {
|
||||
wires.push(WireModel {
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
dash_from_start: false,
|
||||
dash_align_end: None,
|
||||
text_verts: Vec::new(),
|
||||
@@ -1425,6 +1431,8 @@ fn tessellate_dimension_inner(
|
||||
}
|
||||
|
||||
wires.push(WireModel {
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
dash_from_start: false,
|
||||
dash_align_end: None,
|
||||
text_verts: Vec::new(),
|
||||
@@ -1466,6 +1474,8 @@ fn tessellate_dimension_inner(
|
||||
aci_to_rgba(&c)
|
||||
};
|
||||
wires.push(WireModel {
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
dash_from_start: false,
|
||||
dash_align_end: None,
|
||||
text_verts: Vec::new(),
|
||||
|
||||
@@ -96,6 +96,7 @@ fn to_truck(ell: &Ellipse) -> TruckEntity {
|
||||
(q(0.0, -r_minor), SnapHint::Quadrant),
|
||||
];
|
||||
TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Contour(wire),
|
||||
snap_pts,
|
||||
tangent_geoms: vec![],
|
||||
@@ -128,6 +129,7 @@ fn to_truck(ell: &Ellipse) -> TruckEntity {
|
||||
[pt_end.x, pt_end.y, pt_end.z],
|
||||
];
|
||||
TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Curve(edge),
|
||||
snap_pts: vec![(center_v3, SnapHint::Center)],
|
||||
tangent_geoms: vec![],
|
||||
|
||||
@@ -96,6 +96,7 @@ fn to_truck(leader: &Leader) -> TruckEntity {
|
||||
}
|
||||
|
||||
TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(points),
|
||||
snap_pts: vec![],
|
||||
tangent_geoms: tangents,
|
||||
@@ -589,6 +590,8 @@ impl LeaderTess for Leader {
|
||||
|
||||
if verts.len() < 2 {
|
||||
return WireModel {
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
dash_from_start: false,
|
||||
dash_align_end: None,
|
||||
text_verts: Vec::new(),
|
||||
@@ -693,6 +696,8 @@ impl LeaderTess for Leader {
|
||||
}
|
||||
|
||||
WireModel {
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
dash_from_start: false,
|
||||
dash_align_end: None,
|
||||
text_verts: Vec::new(),
|
||||
|
||||
@@ -6,7 +6,7 @@ use crate::entities::common::{
|
||||
center_grip, edit_prop as edit, parse_f64, ro_prop as ro, square_grip,
|
||||
};
|
||||
use crate::entities::traits::TruckConvertible;
|
||||
use crate::scene::convert::acad_to_truck::{TruckEntity, TruckObject};
|
||||
use crate::scene::convert::acad_to_truck::{extrusion_wall_tris, TruckEntity, TruckObject};
|
||||
use crate::scene::model::object::{GripApply, GripDef, PropSection};
|
||||
use crate::scene::model::wire_model::TangentGeom;
|
||||
|
||||
@@ -45,6 +45,7 @@ fn to_truck(line: &Line) -> TruckEntity {
|
||||
p1t,
|
||||
];
|
||||
return TruckEntity {
|
||||
pick_tris: extrusion_wall_tris(&kv, [t * nx, t * ny, t * nz]),
|
||||
object: TruckObject::Lines(pts),
|
||||
snap_pts: vec![],
|
||||
tangent_geoms: vec![tangent],
|
||||
@@ -57,6 +58,7 @@ fn to_truck(line: &Line) -> TruckEntity {
|
||||
let v1 = builder::vertex(p1);
|
||||
let edge = builder::line(&v0, &v1);
|
||||
TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Curve(edge),
|
||||
snap_pts: vec![],
|
||||
tangent_geoms: vec![tangent],
|
||||
|
||||
@@ -7,7 +7,7 @@ use crate::entities::common::{
|
||||
stepper_prop as stepper,
|
||||
};
|
||||
use crate::entities::traits::TruckConvertible;
|
||||
use crate::scene::convert::acad_to_truck::{TruckEntity, TruckObject};
|
||||
use crate::scene::convert::acad_to_truck::{extrusion_wall_tris, TruckEntity, TruckObject};
|
||||
use crate::scene::model::object::{GripApply, GripDef, PropSection, PropValue, Property};
|
||||
use crate::scene::model::wire_model::TangentGeom;
|
||||
|
||||
@@ -91,6 +91,7 @@ fn thick_segments(
|
||||
}
|
||||
}
|
||||
TruckEntity {
|
||||
pick_tris: extrusion_wall_tris(path_pts, [t * nx, t * ny, t * nz]),
|
||||
object: TruckObject::Lines(pts),
|
||||
snap_pts: vec![],
|
||||
tangent_geoms: tangents,
|
||||
@@ -103,6 +104,7 @@ fn to_truck(pline: &LwPolyline) -> TruckEntity {
|
||||
let verts = &pline.vertices;
|
||||
if verts.is_empty() {
|
||||
return TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Point(builder::vertex(Point3::new(0.0, 0.0, 0.0))),
|
||||
snap_pts: vec![],
|
||||
tangent_geoms: vec![],
|
||||
@@ -221,6 +223,7 @@ fn to_truck(pline: &LwPolyline) -> TruckEntity {
|
||||
}
|
||||
}
|
||||
return TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::SegmentedLines(pts),
|
||||
snap_pts: vec![],
|
||||
tangent_geoms: tgs,
|
||||
@@ -269,6 +272,7 @@ fn to_truck(pline: &LwPolyline) -> TruckEntity {
|
||||
}
|
||||
|
||||
TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Contour(edges.into_iter().collect::<Wire>()),
|
||||
snap_pts: vec![],
|
||||
tangent_geoms: tangents,
|
||||
|
||||
@@ -195,6 +195,7 @@ impl TruckConvertible for Face3D {
|
||||
}
|
||||
|
||||
Some(TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(pts),
|
||||
snap_pts: vec![
|
||||
(Vec3::from(p0f).as_dvec3(), SnapHint::Node),
|
||||
@@ -369,6 +370,7 @@ impl TruckConvertible for PolygonMesh {
|
||||
}
|
||||
|
||||
Some(TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(pts),
|
||||
snap_pts: vec![],
|
||||
tangent_geoms: vec![],
|
||||
@@ -524,6 +526,7 @@ impl TruckConvertible for PolyfaceMesh {
|
||||
}
|
||||
|
||||
Some(TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(pts),
|
||||
snap_pts: vec![],
|
||||
tangent_geoms: vec![],
|
||||
@@ -690,6 +693,7 @@ impl TruckConvertible for Mesh {
|
||||
let key_vertices: Vec<[f64; 3]> = self.vertices.iter().map(|v| [v.x, v.y, v.z]).collect();
|
||||
|
||||
Some(TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(pts),
|
||||
snap_pts,
|
||||
tangent_geoms: vec![],
|
||||
|
||||
@@ -162,6 +162,7 @@ impl TruckConvertible for MLine {
|
||||
.collect();
|
||||
|
||||
Some(TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(pts),
|
||||
snap_pts,
|
||||
tangent_geoms: vec![],
|
||||
|
||||
@@ -150,6 +150,7 @@ fn to_truck(t: &MText, document: &acadrust::CadDocument) -> TruckEntity {
|
||||
t.insertion_point.z,
|
||||
);
|
||||
TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Text(layout.strokes),
|
||||
snap_pts: vec![(insertion, SnapHint::Insertion)],
|
||||
tangent_geoms: vec![],
|
||||
|
||||
@@ -298,6 +298,7 @@ fn to_truck(ml: &MultiLeader, document: &acadrust::CadDocument) -> Option<TruckE
|
||||
}
|
||||
|
||||
Some(TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(points),
|
||||
snap_pts,
|
||||
tangent_geoms: tangents,
|
||||
@@ -1399,6 +1400,8 @@ impl MultiLeaderTess for MultiLeader {
|
||||
// WireModels so the renderer respects per-piece coloring.
|
||||
let mut wires: Vec<WireModel> = Vec::new();
|
||||
wires.push(WireModel {
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
dash_from_start: false,
|
||||
dash_align_end: None,
|
||||
text_verts: Vec::new(),
|
||||
@@ -1684,6 +1687,8 @@ impl MultiLeaderTess for MultiLeader {
|
||||
xy = xy.max(y);
|
||||
}
|
||||
wires.push(WireModel {
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
dash_from_start: false,
|
||||
dash_align_end: None,
|
||||
text_verts: sdf_verts,
|
||||
@@ -1749,6 +1754,8 @@ impl MultiLeaderTess for MultiLeader {
|
||||
wcs_corners[3],
|
||||
];
|
||||
wires.push(WireModel {
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
dash_from_start: false,
|
||||
dash_align_end: None,
|
||||
text_verts: Vec::new(),
|
||||
@@ -1782,6 +1789,8 @@ impl MultiLeaderTess for MultiLeader {
|
||||
wcs_corners[0],
|
||||
];
|
||||
wires.push(WireModel {
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
dash_from_start: false,
|
||||
dash_align_end: None,
|
||||
text_verts: Vec::new(),
|
||||
|
||||
@@ -17,6 +17,7 @@ fn to_truck(ole: &Ole2Frame) -> TruckEntity {
|
||||
if (x1 - x0).abs() < 1e-6 && (y1 - y0).abs() < 1e-6 {
|
||||
let s = 0.5_f64;
|
||||
return TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(vec![[-s, 0.0, z], [s, 0.0, z]]),
|
||||
snap_pts: vec![],
|
||||
tangent_geoms: vec![],
|
||||
@@ -46,6 +47,7 @@ fn to_truck(ole: &Ole2Frame) -> TruckEntity {
|
||||
];
|
||||
let center = glam::DVec3::new(cx, cy, z);
|
||||
TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(pts),
|
||||
snap_pts: vec![(center, SnapHint::Center)],
|
||||
tangent_geoms: vec![],
|
||||
|
||||
@@ -40,6 +40,7 @@ fn point_truck(pt: &Point, pdmode: i16, s: f64) -> TruckEntity {
|
||||
// Default: a single vertex (driver handles the dot pixel).
|
||||
let p = Point3::new(wx, wy, wz);
|
||||
return TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Point(builder::vertex(p)),
|
||||
snap_pts: vec![(snap, SnapHint::Node)],
|
||||
tangent_geoms: vec![],
|
||||
@@ -51,6 +52,7 @@ fn point_truck(pt: &Point, pdmode: i16, s: f64) -> TruckEntity {
|
||||
if pts.is_empty() {
|
||||
// PDMODE 1 = nothing — emit an empty Lines wire so picking still works.
|
||||
return TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(vec![]),
|
||||
snap_pts: vec![(snap, SnapHint::Node)],
|
||||
tangent_geoms: vec![],
|
||||
@@ -59,6 +61,7 @@ fn point_truck(pt: &Point, pdmode: i16, s: f64) -> TruckEntity {
|
||||
};
|
||||
}
|
||||
TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(pts),
|
||||
snap_pts: vec![(snap, SnapHint::Node)],
|
||||
tangent_geoms: vec![],
|
||||
|
||||
@@ -6,7 +6,7 @@ use crate::entities::common::{
|
||||
edit_prop as edit, parse_f64, ro_prop as ro, square_grip, stepper_prop as stepper,
|
||||
};
|
||||
use crate::entities::traits::{Grippable, PropertyEditable, Transformable, TruckConvertible};
|
||||
use crate::scene::convert::acad_to_truck::{TruckEntity, TruckObject};
|
||||
use crate::scene::convert::acad_to_truck::{extrusion_wall_tris, TruckEntity, TruckObject};
|
||||
use crate::scene::model::object::{GripApply, GripDef, PropSection, PropValue, Property};
|
||||
use crate::scene::model::wire_model::TangentGeom;
|
||||
|
||||
@@ -26,6 +26,7 @@ fn tessellate_polyline(pl: &Polyline) -> TruckEntity {
|
||||
|
||||
let key_verts = pts.clone();
|
||||
TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(points),
|
||||
snap_pts: vec![],
|
||||
tangent_geoms: vec![],
|
||||
@@ -169,6 +170,7 @@ fn tessellate_polyline2d(pl: &Polyline2D) -> TruckEntity {
|
||||
let verts = &pl.vertices;
|
||||
if verts.is_empty() {
|
||||
return TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(vec![]),
|
||||
snap_pts: vec![],
|
||||
tangent_geoms: vec![],
|
||||
@@ -253,6 +255,7 @@ fn tessellate_polyline2d(pl: &Polyline2D) -> TruckEntity {
|
||||
}
|
||||
}
|
||||
return TruckEntity {
|
||||
pick_tris: extrusion_wall_tris(&path, [t * nx, t * ny, t * nz]),
|
||||
object: TruckObject::Lines(pts),
|
||||
snap_pts: vec![],
|
||||
tangent_geoms: tgs,
|
||||
@@ -301,6 +304,7 @@ fn tessellate_polyline2d(pl: &Polyline2D) -> TruckEntity {
|
||||
}
|
||||
|
||||
TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Contour(edges.into_iter().collect::<Wire>()),
|
||||
snap_pts: vec![],
|
||||
tangent_geoms: tangents,
|
||||
@@ -578,6 +582,7 @@ fn tessellate_polyline3d(pl: &Polyline3D) -> TruckEntity {
|
||||
}
|
||||
|
||||
TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(points),
|
||||
snap_pts: vec![],
|
||||
tangent_geoms: vec![],
|
||||
|
||||
@@ -115,6 +115,7 @@ impl TruckConvertible for RasterImage {
|
||||
};
|
||||
|
||||
Some(TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(pts),
|
||||
snap_pts: vec![],
|
||||
tangent_geoms: vec![],
|
||||
@@ -348,6 +349,7 @@ impl TruckConvertible for Wipeout {
|
||||
};
|
||||
|
||||
Some(TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(pts),
|
||||
snap_pts: vec![],
|
||||
tangent_geoms: vec![],
|
||||
|
||||
@@ -29,6 +29,7 @@ impl TruckConvertible for Ray {
|
||||
];
|
||||
let start: [f64; 3] = [bp.x, bp.y, bp.z];
|
||||
Some(TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(vec![start, far]),
|
||||
snap_pts: vec![],
|
||||
tangent_geoms: vec![],
|
||||
@@ -169,6 +170,7 @@ impl TruckConvertible for XLine {
|
||||
bp.z - nz * DISPLAY_EXTENT,
|
||||
];
|
||||
Some(TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(vec![far_neg, far_pos]),
|
||||
snap_pts: vec![],
|
||||
tangent_geoms: vec![],
|
||||
|
||||
@@ -74,6 +74,7 @@ impl TruckConvertible for Shape {
|
||||
);
|
||||
|
||||
Some(TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(pts),
|
||||
snap_pts: vec![(snap_pt, SnapHint::Insertion)],
|
||||
tangent_geoms: vec![],
|
||||
|
||||
@@ -54,6 +54,7 @@ impl TruckConvertible for Solid {
|
||||
];
|
||||
|
||||
Some(TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(pts),
|
||||
snap_pts: snap,
|
||||
tangent_geoms: vec![],
|
||||
|
||||
@@ -23,6 +23,7 @@ fn to_truck(spl: &Spline) -> TruckEntity {
|
||||
let key_vertices: Vec<[f64; 3]> =
|
||||
spl.fit_points.iter().map(|p| [p.x, p.y, p.z]).collect();
|
||||
return TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(pts),
|
||||
snap_pts: vec![],
|
||||
tangent_geoms: vec![],
|
||||
@@ -31,6 +32,7 @@ fn to_truck(spl: &Spline) -> TruckEntity {
|
||||
};
|
||||
}
|
||||
return TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Point(builder::vertex(Point3::new(0.0, 0.0, 0.0))),
|
||||
snap_pts: vec![],
|
||||
tangent_geoms: vec![],
|
||||
@@ -106,6 +108,7 @@ fn to_truck(spl: &Spline) -> TruckEntity {
|
||||
};
|
||||
|
||||
TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object,
|
||||
snap_pts: vec![],
|
||||
tangent_geoms: vec![],
|
||||
|
||||
@@ -345,6 +345,7 @@ impl TruckConvertible for Table {
|
||||
})
|
||||
.collect();
|
||||
Some(TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(pts_f64),
|
||||
snap_pts: vec![(glam::DVec3::new(self.insertion_point.x, self.insertion_point.y, self.insertion_point.z), SnapHint::Insertion)],
|
||||
tangent_geoms: vec![],
|
||||
@@ -748,6 +749,8 @@ pub fn tessellate_table(
|
||||
let mk =
|
||||
|color: [f32; 4], points: Vec<[f32; 3]>, fill_tris: Vec<[f32; 3]>, lw: f32| -> WireModel {
|
||||
WireModel {
|
||||
pick_tris: Vec::new(),
|
||||
pick_tris_low: Vec::new(),
|
||||
dash_from_start: false,
|
||||
dash_align_end: None,
|
||||
text_verts: Vec::new(),
|
||||
|
||||
@@ -113,6 +113,7 @@ fn to_truck(t: &Text, document: &acadrust::CadDocument) -> TruckEntity {
|
||||
&value,
|
||||
);
|
||||
TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Text(vec![TextStroke {
|
||||
strokes,
|
||||
origin: p.origin,
|
||||
|
||||
@@ -493,6 +493,7 @@ impl TruckConvertible for Tolerance {
|
||||
}
|
||||
|
||||
Some(TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Text(groups),
|
||||
snap_pts: vec![(snap_pt, SnapHint::Insertion)],
|
||||
tangent_geoms: vec![],
|
||||
|
||||
@@ -53,6 +53,7 @@ impl TruckConvertible for Underlay {
|
||||
// Insertion grip.
|
||||
let key: Vec<[f64; 3]> = pts.clone();
|
||||
Some(TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(pts),
|
||||
snap_pts: vec![(glam::DVec3::new(self.insertion_point.x, self.insertion_point.y, self.insertion_point.z), SnapHint::Node)],
|
||||
tangent_geoms: vec![],
|
||||
@@ -63,6 +64,7 @@ impl TruckConvertible for Underlay {
|
||||
// No clip boundary: draw a cross at insertion point.
|
||||
let pts = cross_wire(origin, 1.0);
|
||||
Some(TruckEntity {
|
||||
pick_tris: Vec::new(),
|
||||
object: TruckObject::Lines(pts),
|
||||
snap_pts: vec![(glam::DVec3::new(self.insertion_point.x, self.insertion_point.y, self.insertion_point.z), SnapHint::Node)],
|
||||
tangent_geoms: vec![],
|
||||
|
||||
Reference in new issue
Block a user