refactor(cad): use direct stack dependencies

This commit is contained in:
Hakan Seven committed 2026-08-10 15:03:31 +03:00
1 parent 3b4fbabdba
commit ac8183ec91
36 files changed
+87 -101

No files matched your search

+1 -1
View File
@@ -11,7 +11,7 @@ use crate::command::{CadCommand, CmdResult};
use crate::modules::{IconKind, ModuleEvent, ToolDef};
use crate::scene::model::wire_model::WireModel;
use glam::DVec3;
use acadrust::kernel::space::NurbsCurve3;
use cadkernel::space::NurbsCurve3;
#[allow(dead_code)]
pub fn tool() -> ToolDef {
+1 -1
View File
@@ -1,4 +1,4 @@
use acadrust::kernel::space::polygon;
use cadkernel::space::polygon;
use acadrust::{EntityType, Handle};
use glam::DVec3;
+1 -1
View File
@@ -2,7 +2,7 @@
// MEASURE command — place Point entities at fixed-distance intervals along an entity.
use acadrust::entities::Point as PointEnt;
use acadrust::kernel::space::PlanarCurve;
use cadkernel::space::PlanarCurve;
use acadrust::types::Vector3;
use acadrust::{EntityType, Handle};
use glam::DVec3;
+2 -2
View File
@@ -6,12 +6,12 @@
//! geometric curvature (G2).
use acadrust::entities::{EntityCommon, Spline};
use acadrust::kernel::space::curve as space_curve;
use cadkernel::space::curve as space_curve;
use acadrust::types::Vector3;
use acadrust::{EntityType, Handle};
use glam::DVec3;
use crate::t;
use acadrust::kernel::space::NurbsCurve3;
use cadkernel::space::NurbsCurve3;
use crate::command::{CadCommand, CmdOption, CmdResult};
use crate::entities::common::BulgeArc;
+1 -1
View File
@@ -14,7 +14,7 @@ use acadrust::entities::{Arc as ArcEnt, Line as LineEnt, LwPolyline};
// Shared plane geometry, from cadkernel via the local adapters.
use super::geom;
use super::geom::{arc_points as arc_pts, line_line as ll, normalize_angle as norm_angle};
use acadrust::kernel::geom2d::{
use cadkernel::geom2d::{
circle_circle_points as circle_circle_pts, fillet_between_rays, fillets_between, line_circle,
Arc as KernelArc, Curve as KernelCurve, Fillet as KernelFillet,
Line as KernelLine, Tolerance,
+2 -2
View File
@@ -11,11 +11,11 @@
//! resident render path splits the `f64` into a high/low pair instead. Only a
//! caller knows which of the two it is.
use acadrust::kernel::geom2d::{self, Ellipse};
use cadkernel::geom2d::{self, Ellipse};
/// Re-exported unchanged: these already speak in plain `f64`, so there is no
/// call-shape difference for this module to absorb.
pub use acadrust::kernel::geom2d::{arc_parameter, lerp, normalize_angle};
pub use cadkernel::geom2d::{arc_parameter, lerp, normalize_angle};
/// Preview geometry keeps the density the commands have always used.
const SEGMENTS_PER_RADIAN: f64 = geom2d::DEFAULT_SEGMENTS_PER_RADIAN;
+1 -1
View File
@@ -11,7 +11,7 @@ use crate::modules::draw::modify::spline_ops::{spline_cut, spline_to_nurbs};
use acadrust::entities::{
Arc as ArcEnt, Ellipse as EllipseEnt, Line as LineEnt, LwPolyline, Spline as SplineEnt,
};
use acadrust::kernel::geom2d::{
use cadkernel::geom2d::{
Curve, Ellipse as KernelEllipse, EllipseArc as KernelEllipseArc,
};
use acadrust::types::Vector3;
+3 -3
View File
@@ -20,8 +20,8 @@ use acadrust::entities::{
use acadrust::{EntityType, Handle};
// Polyline offsetting, and the angle normalisation that goes with it, come
// from the kernel; only the entity conversion stays here.
use acadrust::kernel::geom2d::nurbs::clamped_uniform_knots;
use acadrust::kernel::geom2d::{
use cadkernel::geom2d::nurbs::clamped_uniform_knots;
use cadkernel::geom2d::{
offset_polyline, Polyline as KernelPolyline, PolylineVertex as KernelVertex,
};
use glam::{DVec3, Vec3};
@@ -361,7 +361,7 @@ fn perp_distance(entity: &EntityType, pt: Vec3) -> f64 {
// ── Wire preview points ─────────────────────────────────────────────────────
/// Preview density, matching the figure the drawn wires use.
const PREVIEW_SEGMENTS_PER_RADIAN: f64 = acadrust::kernel::geom2d::DEFAULT_SEGMENTS_PER_RADIAN;
const PREVIEW_SEGMENTS_PER_RADIAN: f64 = cadkernel::geom2d::DEFAULT_SEGMENTS_PER_RADIAN;
/// Preview points for an entity, from its own curve.
///
+2 -2
View File
@@ -12,8 +12,8 @@
// straightens every segment.
use acadrust::entities::LwVertex;
use acadrust::kernel::geom2d::nurbs::clamped_uniform_knots;
use acadrust::kernel::geom2d::NurbsCurve;
use cadkernel::geom2d::nurbs::clamped_uniform_knots;
use cadkernel::geom2d::NurbsCurve;
use acadrust::types::Vector2;
use acadrust::{EntityType, Handle};
use glam::{DVec2, DVec3};
+2 -2
View File
@@ -10,8 +10,8 @@
// fine until it is measured.
use acadrust::entities::Spline;
use acadrust::kernel::geom2d::{NurbsCurve, Parameterization};
use acadrust::kernel::space::Plane;
use cadkernel::geom2d::{NurbsCurve, Parameterization};
use cadkernel::space::Plane;
use acadrust::types::Vector3;
use acadrust::Handle;
+3 -3
View File
@@ -27,8 +27,8 @@ use acadrust::entities::{
use acadrust::types::Vector3;
use acadrust::{EntityType, Handle};
use glam::DVec3;
use acadrust::kernel::geom2d::nurbs::clamped_uniform_knots;
use acadrust::kernel::geom2d::{
use cadkernel::geom2d::nurbs::clamped_uniform_knots;
use cadkernel::geom2d::{
intersect as kernel_intersect, Arc as KernelArc, Circle as KernelCircle, Curve,
Extent as KernelExtent,
Ellipse as KernelEllipse, EllipseArc as KernelEllipseArc, Line as KernelLine,
@@ -77,7 +77,7 @@ const TRIM_EXTENT: f64 = 1_000_000.0;
/// Sampling density for the plan-view point lists the fence and preview
/// passes walk. The renderer's own figure, so a preview cut lands where the
/// drawn geometry is rather than a chord away from it.
const SAMPLE_SEGMENTS_PER_RADIAN: f64 = acadrust::kernel::geom2d::DEFAULT_SEGMENTS_PER_RADIAN;
const SAMPLE_SEGMENTS_PER_RADIAN: f64 = cadkernel::geom2d::DEFAULT_SEGMENTS_PER_RADIAN;
/// If a trim interval endpoint is beyond this threshold it is treated as "infinite".
#[derive(Clone)]
+1 -1
View File
@@ -11,7 +11,7 @@ use acadrust::entities::Solid3D;
use acadrust::{primitives, EntityType};
use glam::DVec3;
use crate::t;
use acadrust::kernel::brep::Body;
use cadkernel::brep::Body;
use crate::command::{CadCommand, CmdResult, WorkingPlane};
use crate::scene::model::solid_model;