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
@@ -6,7 +6,7 @@
use std::sync::Arc;
use acadrust::kernel::geom2d::{
use cadkernel::geom2d::{
inside_spans, Curve as KernelCurve, Line as KernelLine, Tolerance, XLine as KernelXLine,
};
+1 -1
View File
@@ -45,7 +45,7 @@ pub struct MeshModel {
/// Kernel-owned source for a view-dependent silhouette.
#[derive(Clone, Debug)]
pub struct CurvedGen {
pub source: acadrust::kernel::brep::mesh::SilhouetteSource,
pub source: cadkernel::brep::mesh::SilhouetteSource,
}
#[derive(Clone, Copy, Debug, Default)]
+3 -3
View File
@@ -13,7 +13,7 @@
// The resulting `Body` is cached per entity handle on the Scene so the
// Design-group boolean tools can run on it.
use acadrust::kernel::brep::{self, Body};
use cadkernel::brep::{self, Body};
use crate::scene::model::mesh_model::{MeshLodSet, MeshModel};
@@ -24,7 +24,7 @@ fn tessellation(body: &Body) -> brep::mesh::BodyMesh {
brep::mesh::tessellate(
body,
brep::mesh::TessellationTolerance::new(
acadrust::kernel::tessellation::DEFAULT_ANGLE,
cadkernel::tessellation::DEFAULT_ANGLE,
TOL,
),
)
@@ -346,7 +346,7 @@ pub fn centre(body: &Body) -> Option<[f64; 3]> {
/// exists to test with.
#[cfg(test)]
pub fn volume(body: &Body) -> f64 {
use acadrust::kernel::space::Vec3;
use cadkernel::space::Vec3;
let mesh = tessellation(body).mesh;
let Some(middle) = centre(body) else {
return 0.0;
+6 -6
View File
@@ -12,9 +12,9 @@
// approximated into a surface nobody asked for. That is the kernel's answer
// and this module passes it on.
use acadrust::kernel::brep::{self, Body};
use acadrust::kernel::geom2d::Curve;
use acadrust::kernel::space::{PlanarCurve, Plane};
use cadkernel::brep::{self, Body};
use cadkernel::geom2d::Curve;
use cadkernel::space::{PlanarCurve, Plane};
use acadrust::EntityType;
use crate::entities::curve::entity_curve;
@@ -57,7 +57,7 @@ pub fn profile_of(entity: &EntityType) -> Option<Profile> {
/// A circle as four arcs.
fn quarters(centre: [f64; 2], radius: f64) -> Vec<Curve> {
use acadrust::kernel::geom2d::Arc;
use cadkernel::geom2d::Arc;
use std::f64::consts::FRAC_PI_2;
(0..4)
.map(|quarter| {
@@ -112,7 +112,7 @@ use crate::scene::model::mesh_model::{MeshLodSet, MeshModel};
/// SWEEP through the kernel's tolerance-driven mesh API.
pub fn swept(profile: &EntityType, path: &EntityType, color: [f32; 4]) -> Option<MeshLodSet> {
let max_angle = acadrust::kernel::tessellation::DEFAULT_ANGLE;
let max_angle = cadkernel::tessellation::DEFAULT_ANGLE;
let surface = brep::mesh::sweep_surface(
&entity_curve(profile)?,
&entity_curve(path)?,
@@ -124,7 +124,7 @@ pub fn swept(profile: &EntityType, path: &EntityType, color: [f32; 4]) -> Option
/// LOFT through the kernel's tolerance-driven mesh API.
pub fn lofted(profiles: &[EntityType], color: [f32; 4]) -> Option<MeshLodSet> {
let curves: Vec<PlanarCurve> = profiles.iter().filter_map(entity_curve).collect();
let max_angle = acadrust::kernel::tessellation::DEFAULT_ANGLE;
let max_angle = cadkernel::tessellation::DEFAULT_ANGLE;
mesh_set(brep::mesh::loft_surface(&curves, max_angle)?, color, 1e-9)
}