forked from 1b-agent/opencadstudio-upstream
Use feature edges for normal 3D selection (#971)
Use feature edges for normal 3D selection
This commit is contained in:
6 files changed
+225
-18
No files matched your search
@@ -8215,6 +8215,60 @@ impl Scene {
|
||||
)
|
||||
}
|
||||
|
||||
/// Normal object selection for shaded 3D bodies is edge based. This keeps
|
||||
/// the broad face interior available to modelling commands without making
|
||||
/// it part of ordinary object picking.
|
||||
pub fn solid_edge_click_hit(
|
||||
&self,
|
||||
cursor: iced::Point,
|
||||
view_rot: glam::Mat4,
|
||||
eye: glam::DVec3,
|
||||
bounds: iced::Rectangle,
|
||||
candidate_handles: Option<&HashSet<Handle>>,
|
||||
tolerance_px: f32,
|
||||
) -> Option<Handle> {
|
||||
let meshes = self.interaction_meshes_arc();
|
||||
pick::hit_test::mesh_edge_click_hit(
|
||||
cursor,
|
||||
meshes.iter().filter_map(|set| {
|
||||
let handle = set.entity_handle()?;
|
||||
if candidate_handles.is_some_and(|handles| !handles.contains(&handle)) {
|
||||
return None;
|
||||
}
|
||||
let (edges, edges_low) = set.geometry_edges();
|
||||
(!edges.is_empty()).then_some((
|
||||
handle,
|
||||
edges,
|
||||
edges_low,
|
||||
set.instance_transform,
|
||||
))
|
||||
}),
|
||||
view_rot,
|
||||
eye,
|
||||
bounds,
|
||||
tolerance_px,
|
||||
)
|
||||
}
|
||||
|
||||
pub fn solid_edge_hover_hit(
|
||||
&self,
|
||||
cursor: iced::Point,
|
||||
view_rot: glam::Mat4,
|
||||
eye: glam::DVec3,
|
||||
bounds: iced::Rectangle,
|
||||
candidate_handles: Option<&HashSet<Handle>>,
|
||||
tolerance_px: f32,
|
||||
) -> Option<Handle> {
|
||||
self.solid_edge_click_hit(
|
||||
cursor,
|
||||
view_rot,
|
||||
eye,
|
||||
bounds,
|
||||
candidate_handles,
|
||||
tolerance_px,
|
||||
)
|
||||
}
|
||||
|
||||
pub fn solid_click_point_for(
|
||||
&self,
|
||||
cursor: iced::Point,
|
||||
|
||||
Reference in new issue
Block a user