cargo fmt
This commit is contained in:
parent
468cbde5e1
commit
ca07268c7c
204 changed files with 13988 additions and 5516 deletions
|
|
@ -4,9 +4,9 @@ use glam::Vec3;
|
|||
use crate::command::EntityTransform;
|
||||
use crate::entities::common::{ro_prop as ro, square_grip};
|
||||
use crate::entities::traits::{Grippable, PropertyEditable, Transformable, TruckConvertible};
|
||||
use crate::scene::wire_model::SnapHint;
|
||||
use crate::scene::acad_to_truck::{TruckEntity, TruckObject};
|
||||
use crate::scene::object::{GripApply, GripDef, PropSection};
|
||||
use crate::scene::wire_model::SnapHint;
|
||||
|
||||
// ── Face3D ────────────────────────────────────────────────────────────────────
|
||||
|
||||
|
|
@ -125,7 +125,9 @@ impl PropertyEditable for Face3D {
|
|||
}
|
||||
|
||||
fn apply_geom_prop(&mut self, field: &str, value: &str) {
|
||||
let Ok(v) = value.trim().parse::<f64>() else { return };
|
||||
let Ok(v) = value.trim().parse::<f64>() else {
|
||||
return;
|
||||
};
|
||||
match field {
|
||||
"f3_p1x" => self.first_corner.x = v,
|
||||
"f3_p1y" => self.first_corner.y = v,
|
||||
|
|
@ -153,12 +155,7 @@ impl Transformable for Face3D {
|
|||
&mut entity.third_corner,
|
||||
&mut entity.fourth_corner,
|
||||
] {
|
||||
crate::scene::transform::reflect_xy_point(
|
||||
&mut corner.x,
|
||||
&mut corner.y,
|
||||
p1,
|
||||
p2,
|
||||
);
|
||||
crate::scene::transform::reflect_xy_point(&mut corner.x, &mut corner.y, p1, p2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -174,12 +171,20 @@ impl TruckConvertible for PolygonMesh {
|
|||
return None;
|
||||
}
|
||||
|
||||
let closed_m = self.flags.contains(acadrust::entities::PolygonMeshFlags::CLOSED_M);
|
||||
let closed_n = self.flags.contains(acadrust::entities::PolygonMeshFlags::CLOSED_N);
|
||||
let closed_m = self
|
||||
.flags
|
||||
.contains(acadrust::entities::PolygonMeshFlags::CLOSED_M);
|
||||
let closed_n = self
|
||||
.flags
|
||||
.contains(acadrust::entities::PolygonMeshFlags::CLOSED_N);
|
||||
|
||||
let pt = |i: usize, j: usize| -> [f32; 3] {
|
||||
let v = &self.vertices[i * n + j];
|
||||
[v.location.x as f32, v.location.y as f32, v.location.z as f32]
|
||||
[
|
||||
v.location.x as f32,
|
||||
v.location.y as f32,
|
||||
v.location.z as f32,
|
||||
]
|
||||
};
|
||||
|
||||
let mut pts: Vec<[f32; 3]> = Vec::new();
|
||||
|
|
@ -238,7 +243,11 @@ impl Grippable for PolygonMesh {
|
|||
.map(|(i, v)| {
|
||||
square_grip(
|
||||
i,
|
||||
Vec3::new(v.location.x as f32, v.location.y as f32, v.location.z as f32),
|
||||
Vec3::new(
|
||||
v.location.x as f32,
|
||||
v.location.y as f32,
|
||||
v.location.z as f32,
|
||||
),
|
||||
)
|
||||
})
|
||||
.collect()
|
||||
|
|
@ -303,7 +312,11 @@ impl TruckConvertible for PolyfaceMesh {
|
|||
let get_v = |idx: i16| -> Option<[f32; 3]> {
|
||||
let i = (idx.abs() as usize).checked_sub(1)?;
|
||||
let v = self.vertices.get(i)?;
|
||||
Some([v.location.x as f32, v.location.y as f32, v.location.z as f32])
|
||||
Some([
|
||||
v.location.x as f32,
|
||||
v.location.y as f32,
|
||||
v.location.z as f32,
|
||||
])
|
||||
};
|
||||
|
||||
let mut pts: Vec<[f32; 3]> = Vec::new();
|
||||
|
|
@ -356,7 +369,11 @@ impl Grippable for PolyfaceMesh {
|
|||
.map(|(i, v)| {
|
||||
square_grip(
|
||||
i,
|
||||
Vec3::new(v.location.x as f32, v.location.y as f32, v.location.z as f32),
|
||||
Vec3::new(
|
||||
v.location.x as f32,
|
||||
v.location.y as f32,
|
||||
v.location.z as f32,
|
||||
),
|
||||
)
|
||||
})
|
||||
.collect()
|
||||
|
|
|
|||
Loading…
Reference in a new issue