forked from 1b-agent/opencadstudio-upstream
feat: node graph overlay; move to opencadcodec/opencadkernel/opencadgraph
The codec and kernel repositories and crates are renamed opencadcodec and opencadkernel. Inside OCS they are depended on under short keys, so code reads `codec::`, `kernel::` and the new `graph::` (opencadgraph, the node graph engine). File-format and protocol spellings stay as they were: the ACIS product id `acadrust`, the ACADRUST_* switches and the plugin version keys `acadrust_version` / `acadrust_source`. A button left of MCP on the command line opens a translucent node graph over the viewport, with a palette of object, input, math, logic, list, text and geometry nodes added by click or drag. An object node owns drawing entities and its rows are the Properties panel's own rows for them: the single-object page is extracted from refresh_properties as entity_property_sections, values use the control protocol's property_json, and writes go through set_property_value with a property target override, so the panel, MCP and the graph share one read/write path. A list reaching an object row makes one entity per element. Each graph action is one undo step; the canvas pans and zooms. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
56c04408d6
commit
f537aff75c
430 files changed
+9925
-8540
No files matched your search
@@ -1,22 +1,22 @@
|
||||
// Faz 4c-0 preserve-verify (risk #10): an *untouched* annotative file must
|
||||
// round-trip every per-object annotation-context leaf without dropping or
|
||||
// mutating it. acadrust does not model `AcDb*ObjectContextData` — it keeps each
|
||||
// mutating it. opencadcodec does not model `AcDb*ObjectContextData` — it keeps each
|
||||
// leaf verbatim as `Unknown{raw_dwg_data}` and re-emits it on same-version save,
|
||||
// while side-mapping the leaf's `340` annotation-scale handle into
|
||||
// `context_scales`. This certifies that passthrough is intact at the current
|
||||
// acadrust HEAD before any encoder work touches the save path.
|
||||
// opencadcodec HEAD before any encoder work touches the save path.
|
||||
//
|
||||
// Uses the golden reference `~/Downloads/0718-mbmdmc.dwg` (AC1032/R2018). The
|
||||
// test skips (does not fail) when that file is absent so it never breaks CI.
|
||||
|
||||
use OpenCADStudio::io;
|
||||
use acadrust::objects::ObjectType;
|
||||
use codec::objects::ObjectType;
|
||||
|
||||
const GOLDEN: &str = "/home/hakanseven/Downloads/0718-mbmdmc.dwg";
|
||||
|
||||
/// Raw bytes of every annotation-context leaf, sorted so the comparison is
|
||||
/// independent of handle ordering/renumbering across the round-trip.
|
||||
fn leaf_blobs(doc: &acadrust::CadDocument) -> Vec<Vec<u8>> {
|
||||
fn leaf_blobs(doc: &codec::CadDocument) -> Vec<Vec<u8>> {
|
||||
let mut blobs: Vec<Vec<u8>> = doc
|
||||
.context_scales
|
||||
.keys()
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
// survives a DWG save/reload — i.e. an OCS-authored annotative object carries a
|
||||
// genuine per-scale representation, interoperably, not just the native flag.
|
||||
|
||||
use acadrust::entities::{EntityType, MText};
|
||||
use acadrust::objects::{Dictionary, ObjectContextKind, ObjectType, Scale};
|
||||
use acadrust::types::Vector3;
|
||||
use acadrust::{CadDocument, DxfVersion, Handle};
|
||||
use codec::entities::{EntityType, MText};
|
||||
use codec::objects::{Dictionary, ObjectContextKind, ObjectType, Scale};
|
||||
use codec::types::Vector3;
|
||||
use codec::{CadDocument, DxfVersion, Handle};
|
||||
use OpenCADStudio::io;
|
||||
use OpenCADStudio::scene::annotative;
|
||||
|
||||
@@ -134,7 +134,7 @@ fn ocs_synthesized_mtext_context_survives_dwg_roundtrip() {
|
||||
|
||||
#[test]
|
||||
fn ocs_synthesized_block_context_survives_dwg_roundtrip() {
|
||||
use acadrust::entities::Insert;
|
||||
use codec::entities::Insert;
|
||||
|
||||
let mut doc = CadDocument::with_version(DxfVersion::AC1032);
|
||||
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
// plot printed the block as bare monochrome outlines. `synced_hatch_models`
|
||||
// (the viewport) explodes visible INSERTs and materializes their fills; both
|
||||
// paths now share `exploded_insert_hatch_models`.
|
||||
use acadrust::entities::hatch::{
|
||||
use codec::entities::hatch::{
|
||||
BoundaryEdge, BoundaryPath, BoundaryPathFlags, HatchPatternLine, LineEdge,
|
||||
};
|
||||
use acadrust::entities::Hatch;
|
||||
use acadrust::types::{Color as AcadColor, Vector2};
|
||||
use acadrust::EntityType;
|
||||
use codec::entities::Hatch;
|
||||
use codec::types::{Color as AcadColor, Vector2};
|
||||
use codec::EntityType;
|
||||
use OpenCADStudio::scene::model::hatch_model::HatchPattern;
|
||||
use OpenCADStudio::scene::Scene;
|
||||
|
||||
@@ -76,7 +76,7 @@ fn block_internal_hatch_reaches_export() {
|
||||
// A blue hatch, wrapped into a block and inserted in model space — the
|
||||
// minimal shape of "coloured fill nested in a block".
|
||||
let h = scene.add_entity(EntityType::Hatch(square_hatch(5)));
|
||||
let identity = acadrust::types::Transform::identity();
|
||||
let identity = codec::types::Transform::identity();
|
||||
scene
|
||||
.create_block_from_entities(&[h], "LOGO", &identity, &identity)
|
||||
.expect("wrap hatch into a block + insert");
|
||||
@@ -250,7 +250,7 @@ fn app_created_hatch_roundtrips_catalog_spacing() {
|
||||
boundary_exterior: None,
|
||||
boundary_sources: None,
|
||||
boundary_paths: None,
|
||||
style: acadrust::entities::HatchStyleType::Normal,
|
||||
style: codec::entities::HatchStyleType::Normal,
|
||||
pattern: entry.gpu.clone(),
|
||||
name: "ANSI31".into(),
|
||||
color: [0.75, 0.75, 0.75, 0.85],
|
||||
@@ -309,7 +309,7 @@ fn nested_hatch_serializes_only_outer_as_external() {
|
||||
boundary_exterior: None,
|
||||
boundary_sources: None,
|
||||
boundary_paths: None,
|
||||
style: acadrust::entities::HatchStyleType::Normal,
|
||||
style: codec::entities::HatchStyleType::Normal,
|
||||
pattern: HatchPattern::Solid,
|
||||
name: "SOLID".into(),
|
||||
color: [0.45, 0.45, 0.45, 0.60],
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
// The scene mirrors the real-world shape of the bug: a block whose children
|
||||
// are [wipeout, line, text], inserted into a drawing big enough that the
|
||||
// insert's child band is as fine-grained as a real one.
|
||||
use acadrust::entities::{Insert, Text, Wipeout};
|
||||
use acadrust::tables::BlockRecord;
|
||||
use acadrust::types::Vector3;
|
||||
use acadrust::EntityType;
|
||||
use codec::entities::{Insert, Text, Wipeout};
|
||||
use codec::tables::BlockRecord;
|
||||
use codec::types::Vector3;
|
||||
use codec::EntityType;
|
||||
use OpenCADStudio::scene::cache::block_cache::{expand_insert, BlockCache};
|
||||
use OpenCADStudio::scene::view::render::InheritStyle;
|
||||
use OpenCADStudio::scene::Scene;
|
||||
@@ -26,7 +26,7 @@ const DEPTH_QUANTA: f32 = 16_777_216.0; // 2^24 (Depth24Plus)
|
||||
fn block_text_depth_composes_through_the_instance_path() {
|
||||
let mut scene = Scene::new();
|
||||
|
||||
let br_h = acadrust::Handle::new(scene.document.next_handle());
|
||||
let br_h = codec::Handle::new(scene.document.next_handle());
|
||||
let mut br = BlockRecord::new("MARK");
|
||||
br.handle = br_h;
|
||||
scene.document.block_records.add(br).unwrap();
|
||||
@@ -42,7 +42,7 @@ fn block_text_depth_composes_through_the_instance_path() {
|
||||
|
||||
// Child 1: a spacer so the text sits two sibling steps above the wipe,
|
||||
// the same gap as the real BS33-11 mark blocks.
|
||||
let mut spacer = acadrust::entities::Line::default();
|
||||
let mut spacer = codec::entities::Line::default();
|
||||
spacer.start = Vector3::new(-10.0, -10.0, 0.0);
|
||||
spacer.end = Vector3::new(10.0, 10.0, 0.0);
|
||||
let mut spacer_e = EntityType::Line(spacer);
|
||||
@@ -63,7 +63,7 @@ fn block_text_depth_composes_through_the_instance_path() {
|
||||
// per-sibling spacing at a handful of 24-bit quanta, where an oversized
|
||||
// wipeout depth bias would swallow it).
|
||||
for i in 0..600 {
|
||||
let mut line = acadrust::entities::Line::default();
|
||||
let mut line = codec::entities::Line::default();
|
||||
line.start = Vector3::new(f64::from(i) * 10.0 - 3000.0, -50.0, 0.0);
|
||||
line.end = Vector3::new(f64::from(i) * 10.0 - 3000.0, 50.0, 0.0);
|
||||
let _ = scene.document.add_entity(EntityType::Line(line));
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Regression for #161: COPY must duplicate a dimension's baked block so the
|
||||
// copy renders at the copy position, not on top of the original.
|
||||
use acadrust::entities::{Dimension, DimensionLinear, Line};
|
||||
use acadrust::tables::BlockRecord;
|
||||
use acadrust::types::Vector3;
|
||||
use acadrust::{EntityType, Handle};
|
||||
use codec::entities::{Dimension, DimensionLinear, Line};
|
||||
use codec::tables::BlockRecord;
|
||||
use codec::types::Vector3;
|
||||
use codec::{EntityType, Handle};
|
||||
use glam::DVec3;
|
||||
use OpenCADStudio::command::EntityTransform;
|
||||
use OpenCADStudio::scene::Scene;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
//! Check DIMTMOVE through the scene's actual dimension tessellation.
|
||||
|
||||
use acadrust::entities::{Dimension, DimensionAligned, DimensionLinear};
|
||||
use acadrust::types::Vector3;
|
||||
use acadrust::xdata::XDataValue;
|
||||
use acadrust::EntityType;
|
||||
use codec::entities::{Dimension, DimensionAligned, DimensionLinear};
|
||||
use codec::types::Vector3;
|
||||
use codec::xdata::XDataValue;
|
||||
use codec::EntityType;
|
||||
use OpenCADStudio::entities::dim_override as ov;
|
||||
use OpenCADStudio::scene::Scene;
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
// is silently lost, which is exactly why the row was kept read-only before.
|
||||
// This is the regression guard for that persistence.
|
||||
|
||||
use acadrust::entities::{Dimension, DimensionLinear, Leader, Line};
|
||||
use acadrust::tables::BlockRecord;
|
||||
use acadrust::types::{Color, Vector3};
|
||||
use acadrust::xdata::XDataValue;
|
||||
use acadrust::{CadDocument, EntityType, Handle};
|
||||
use codec::entities::{Dimension, DimensionLinear, Leader, Line};
|
||||
use codec::tables::BlockRecord;
|
||||
use codec::types::{Color, Vector3};
|
||||
use codec::xdata::XDataValue;
|
||||
use codec::{CadDocument, EntityType, Handle};
|
||||
use OpenCADStudio::entities::dim_override as dov;
|
||||
use OpenCADStudio::scene::Scene;
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
// truly can't be found, synthesises a fresh one so registration sticks. These
|
||||
// guards exercise that repair through the page-setup and CTAB write paths.
|
||||
|
||||
use acadrust::objects::{ObjectType, PlotSettings};
|
||||
use acadrust::Handle;
|
||||
use codec::objects::{ObjectType, PlotSettings};
|
||||
use codec::Handle;
|
||||
use OpenCADStudio::scene::Scene;
|
||||
|
||||
/// Break a document the way a foreign DWG does: dangle the header root pointer
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use acadrust::entities::EntityType;
|
||||
use acadrust::types::{Handle, Vector3};
|
||||
use codec::entities::EntityType;
|
||||
use codec::types::{Handle, Vector3};
|
||||
use OpenCADStudio::scene::named_parameters::DrivingValue;
|
||||
use OpenCADStudio::scene::parametric_constraints::{
|
||||
ConstraintKind, ParametricRef, ParametricScope,
|
||||
@@ -7,7 +7,7 @@ use OpenCADStudio::scene::parametric_constraints::{
|
||||
use OpenCADStudio::scene::{ChangeKind, Scene};
|
||||
|
||||
fn add_line(scene: &mut Scene, x1: f64, y1: f64, x2: f64, y2: f64) -> Handle {
|
||||
scene.add_entity(EntityType::Line(acadrust::entities::Line::from_points(
|
||||
scene.add_entity(EntityType::Line(codec::entities::Line::from_points(
|
||||
Vector3::new(x1, y1, 0.0),
|
||||
Vector3::new(x2, y2, 0.0),
|
||||
)))
|
||||
@@ -28,7 +28,7 @@ fn set_line_end(scene: &mut Scene, handle: Handle, end: Vector3) {
|
||||
|
||||
fn add_circle(scene: &mut Scene, cx: f64, cy: f64, radius: f64) -> Handle {
|
||||
scene.add_entity(EntityType::Circle(
|
||||
acadrust::entities::Circle::from_center_radius(Vector3::new(cx, cy, 0.0), radius),
|
||||
codec::entities::Circle::from_center_radius(Vector3::new(cx, cy, 0.0), radius),
|
||||
))
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ fn add_arc(
|
||||
end_angle: f64,
|
||||
) -> Handle {
|
||||
scene.add_entity(EntityType::Arc(
|
||||
acadrust::entities::Arc::from_center_radius_angles(
|
||||
codec::entities::Arc::from_center_radius_angles(
|
||||
Vector3::new(cx, cy, 0.0),
|
||||
radius,
|
||||
start_angle,
|
||||
@@ -66,7 +66,7 @@ fn arc_geom(scene: &Scene, handle: Handle) -> (Vector3, f64) {
|
||||
|
||||
fn add_ellipse(scene: &mut Scene, cx: f64, cy: f64, major_axis: (f64, f64), ratio: f64) -> Handle {
|
||||
scene.add_entity(EntityType::Ellipse(
|
||||
acadrust::entities::Ellipse::from_center_axes(
|
||||
codec::entities::Ellipse::from_center_axes(
|
||||
Vector3::new(cx, cy, 0.0),
|
||||
Vector3::new(major_axis.0, major_axis.1, 0.0),
|
||||
ratio,
|
||||
@@ -126,10 +126,10 @@ fn horizontal_constraint_levels_the_line_when_an_endpoint_moves() {
|
||||
fn horizontal_constraint_levels_a_polyline_segment() {
|
||||
let mut scene = Scene::new();
|
||||
let polyline = scene.add_entity(EntityType::LwPolyline(
|
||||
acadrust::entities::LwPolyline::from_points(vec![
|
||||
acadrust::types::Vector2::new(0.0, 0.0),
|
||||
acadrust::types::Vector2::new(5.0, 2.0),
|
||||
acadrust::types::Vector2::new(10.0, 7.0),
|
||||
codec::entities::LwPolyline::from_points(vec![
|
||||
codec::types::Vector2::new(0.0, 0.0),
|
||||
codec::types::Vector2::new(5.0, 2.0),
|
||||
codec::types::Vector2::new(10.0, 7.0),
|
||||
]),
|
||||
));
|
||||
scene
|
||||
@@ -152,9 +152,9 @@ fn horizontal_constraint_levels_a_polyline_segment() {
|
||||
|
||||
#[test]
|
||||
fn horizontal_constraint_does_not_flatten_a_polyline_arc_segment() {
|
||||
let mut source = acadrust::entities::LwPolyline::new();
|
||||
source.add_point_with_bulge(acadrust::types::Vector2::new(0.0, 0.0), 0.5);
|
||||
source.add_point(acadrust::types::Vector2::new(5.0, 2.0));
|
||||
let mut source = codec::entities::LwPolyline::new();
|
||||
source.add_point_with_bulge(codec::types::Vector2::new(0.0, 0.0), 0.5);
|
||||
source.add_point(codec::types::Vector2::new(5.0, 2.0));
|
||||
let mut scene = Scene::new();
|
||||
let polyline = scene.add_entity(EntityType::LwPolyline(source));
|
||||
scene
|
||||
@@ -539,7 +539,7 @@ fn copying_two_constrained_entities_carries_their_constraint_along() {
|
||||
fn a_duplicated_horizontal_constraint_is_reported_as_redundant() {
|
||||
// `solve_scope` resolves the redundant row back to the
|
||||
// `ConstraintId` a `ConflictResolverPanel` would name.
|
||||
use cadkernel_constraints::diagnosis::RedundancyKind;
|
||||
use kernel_constraints::diagnosis::RedundancyKind;
|
||||
use OpenCADStudio::scene::parametric_constraints::ConstraintKind;
|
||||
|
||||
let mut scene = Scene::new();
|
||||
@@ -576,7 +576,7 @@ fn a_duplicated_horizontal_constraint_is_reported_as_redundant() {
|
||||
|
||||
#[test]
|
||||
fn two_conflicting_distance_targets_are_reported_as_conflicting() {
|
||||
use cadkernel_constraints::diagnosis::RedundancyKind;
|
||||
use kernel_constraints::diagnosis::RedundancyKind;
|
||||
use OpenCADStudio::scene::parametric_constraints::ConstraintKind;
|
||||
|
||||
let mut scene = Scene::new();
|
||||
@@ -737,7 +737,7 @@ fn midpoint_constraint_pulls_a_point_onto_a_lines_midpoint() {
|
||||
fn midpoint_constraint_supports_a_point_entity() {
|
||||
let mut scene = Scene::new();
|
||||
let base = add_line(&mut scene, 0.0, 0.0, 10.0, 6.0);
|
||||
let point = scene.add_entity(EntityType::Point(acadrust::entities::Point::at(
|
||||
let point = scene.add_entity(EntityType::Point(codec::entities::Point::at(
|
||||
Vector3::new(20.0, 20.0, 0.0),
|
||||
)));
|
||||
scene
|
||||
@@ -761,7 +761,7 @@ fn midpoint_constraint_supports_a_point_entity() {
|
||||
fn coincident_constraint_supports_a_block_insertion_point() {
|
||||
let mut scene = Scene::new();
|
||||
let line = add_line(&mut scene, 0.0, 0.0, 10.0, 4.0);
|
||||
let insert = scene.add_entity(EntityType::Insert(acadrust::entities::Insert::new(
|
||||
let insert = scene.add_entity(EntityType::Insert(codec::entities::Insert::new(
|
||||
"fixture",
|
||||
Vector3::new(30.0, 20.0, 0.0),
|
||||
)));
|
||||
@@ -1223,7 +1223,7 @@ fn point_on_curve_constraint_keeps_a_point_within_an_arcs_sweep() {
|
||||
"point should land exactly on the arc: dist={dist} radius={radius}"
|
||||
);
|
||||
assert!(
|
||||
cadkernel::geom2d::angle_within_arc(
|
||||
kernel::geom2d::angle_within_arc(
|
||||
(p.y - center.y).atan2(p.x - center.x),
|
||||
start_angle,
|
||||
end_angle,
|
||||
@@ -1234,9 +1234,9 @@ fn point_on_curve_constraint_keeps_a_point_within_an_arcs_sweep() {
|
||||
|
||||
#[test]
|
||||
fn point_on_curve_constraint_keeps_a_point_within_a_polyline_arc_segment() {
|
||||
let mut source = acadrust::entities::LwPolyline::new();
|
||||
source.add_point_with_bulge(acadrust::types::Vector2::new(0.0, 0.0), 1.0);
|
||||
source.add_point(acadrust::types::Vector2::new(10.0, 0.0));
|
||||
let mut source = codec::entities::LwPolyline::new();
|
||||
source.add_point_with_bulge(codec::types::Vector2::new(0.0, 0.0), 1.0);
|
||||
source.add_point(codec::types::Vector2::new(10.0, 0.0));
|
||||
let mut scene = Scene::new();
|
||||
let polyline = scene.add_entity(EntityType::LwPolyline(source));
|
||||
let marker = add_line(&mut scene, 5.0, 20.0, 6.0, 20.0);
|
||||
@@ -1257,7 +1257,7 @@ fn point_on_curve_constraint_keeps_a_point_within_a_polyline_arc_segment() {
|
||||
let EntityType::LwPolyline(polyline) = scene.document.get_entity(polyline).unwrap() else {
|
||||
panic!("expected a lightweight polyline");
|
||||
};
|
||||
let arc = cadkernel::geom2d::BulgeArc::from_bulge(
|
||||
let arc = kernel::geom2d::BulgeArc::from_bulge(
|
||||
[
|
||||
polyline.vertices[0].location.x,
|
||||
polyline.vertices[0].location.y,
|
||||
@@ -1272,7 +1272,7 @@ fn point_on_curve_constraint_keeps_a_point_within_a_polyline_arc_segment() {
|
||||
let distance = (point.x - arc.center[0]).hypot(point.y - arc.center[1]);
|
||||
assert!((distance - arc.radius).abs() < 1e-6);
|
||||
assert!(
|
||||
cadkernel::geom2d::angle_within_arc(
|
||||
kernel::geom2d::angle_within_arc(
|
||||
(point.y - arc.center[1]).atan2(point.x - arc.center[0]),
|
||||
arc.start_angle,
|
||||
arc.start_angle + arc.sweep,
|
||||
@@ -1324,7 +1324,7 @@ fn radius_and_endpoint_coincident_constraints_coexist_on_the_same_arc() {
|
||||
}
|
||||
|
||||
// Phase 2 of the same plan: `Diameter`/`DistanceX`/`DistanceY` reuse
|
||||
// existing `cadkernel_constraints` primitives (`Equal`'s `ratio`, `Difference`) with no
|
||||
// existing `opencadkernel_constraints` primitives (`Equal`'s `ratio`, `Difference`) with no
|
||||
// new solver-crate code.
|
||||
|
||||
#[test]
|
||||
@@ -1404,7 +1404,7 @@ fn normal_constraint_pulls_the_line_through_the_circles_center() {
|
||||
}
|
||||
|
||||
// Phase 5 of the same plan: an `Ellipse` registers center/focus1/minor-
|
||||
// radius (converted from acadrust's center + major-axis-vector + ratio
|
||||
// radius (converted from opencadcodec's center + major-axis-vector + ratio
|
||||
// parametrization). Only center-based whole-entity constraints are wired
|
||||
// up so far — Concentric, CenterPoint, Fixed — mirroring how Arc started
|
||||
// at "center/radius only" in Phase 1. Axis-length constraints and
|
||||
@@ -1475,8 +1475,8 @@ fn center_point_constraint_pulls_a_lines_endpoint_onto_an_ellipses_center() {
|
||||
|
||||
#[test]
|
||||
fn a_tilted_ellipse_round_trips_through_the_solver_without_drifting() {
|
||||
// The riskiest part of Ellipse support: converting acadrust's center +
|
||||
// major-axis-*vector* + minor/major ratio into `cadkernel_constraints`'s center +
|
||||
// The riskiest part of Ellipse support: converting opencadcodec's center +
|
||||
// major-axis-*vector* + minor/major ratio into `opencadkernel_constraints`'s center +
|
||||
// focus + minor-radius, then back, for a major axis that ISN'T
|
||||
// axis-aligned (an axis-aligned one wouldn't exercise the direction
|
||||
// math at all). A solve with nothing actually pulling on it should
|
||||
@@ -1519,7 +1519,7 @@ fn concentric_constraint_does_not_reshape_the_ellipse_when_its_center_actually_m
|
||||
// ALREADY concentric with the ellipse, so Concentric's equations start
|
||||
// out satisfied and the ellipse's center never actually has to move —
|
||||
// it doesn't exercise the bug at all. Here the circle starts elsewhere,
|
||||
// forcing a real center move, which is exactly when `cadkernel_constraints::geo::
|
||||
// forcing a real center move, which is exactly when `kernel_constraints::geo::
|
||||
// Ellipse`'s absolute `focus1` point used to get left behind: `center`
|
||||
// moved to meet the circle, `focus1` didn't (nothing else referenced
|
||||
// it), so the derived major-axis direction/length and minor/major
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
//! #1266: decoded IMAGE/OLE content must survive the shared PDF/preview/print path.
|
||||
#![cfg(not(target_arch = "wasm32"))]
|
||||
|
||||
use acadrust::entities::{Insert, Viewport, Wipeout};
|
||||
use acadrust::types::{Vector2, Vector3};
|
||||
use acadrust::EntityType;
|
||||
use codec::entities::{Insert, Viewport, Wipeout};
|
||||
use codec::types::{Vector2, Vector3};
|
||||
use codec::EntityType;
|
||||
use std::sync::Arc;
|
||||
use OpenCADStudio::io::pdf_export::{
|
||||
export_pdf, export_pdf_pages, PdfPageInput, PdfPlotOptions, PlotContent, PlotGroupSplits,
|
||||
@@ -357,7 +357,7 @@ fn viewport_projection_clips_images_and_respects_frozen_and_nonplot_layers() {
|
||||
|
||||
#[test]
|
||||
fn linked_image_uses_decoded_pixels_and_its_image_clip_without_reopening() {
|
||||
use acadrust::entities::{ClipBoundary, RasterImage};
|
||||
use codec::entities::{ClipBoundary, RasterImage};
|
||||
let path = std::env::temp_dir().join(format!("ocs1266-linked-{}.png", std::process::id()));
|
||||
let source = image();
|
||||
image::save_buffer(&path, &source.image.pixels, 32, 32, image::ColorType::Rgba8).unwrap();
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
// see `emit_text`'s ops. What only an integration test can cover is that the
|
||||
// real entity -> scene.entity_wires() -> export_pdf path carries text at all,
|
||||
// per entity kind — so that is what this asserts.
|
||||
use acadrust::entities::{Dimension, DimensionLinear, Text};
|
||||
use acadrust::types::Vector3;
|
||||
use acadrust::EntityType;
|
||||
use codec::entities::{Dimension, DimensionLinear, Text};
|
||||
use codec::types::Vector3;
|
||||
use codec::EntityType;
|
||||
use OpenCADStudio::io::pdf_export::{
|
||||
export_pdf, PdfPageInput, PdfPlotOptions, PlotContent, PlotWire,
|
||||
};
|
||||
@@ -35,7 +35,7 @@ fn text_and_dim_reach_pdf_export() {
|
||||
// regression — the actual reported bug — green.
|
||||
// Tessellation names each wire after its entity handle (see the
|
||||
// `w.name.parse::<u64>()` lookup in the render pipeline).
|
||||
let has_text = |h: acadrust::types::Handle| {
|
||||
let has_text = |h: codec::types::Handle| {
|
||||
let want = h.value().to_string();
|
||||
wires
|
||||
.iter()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use acadrust::{entities::Circle, types::Vector3, EntityType};
|
||||
use codec::{entities::Circle, types::Vector3, EntityType};
|
||||
use glam::DVec3;
|
||||
use OpenCADStudio::command::WorkingPlane;
|
||||
use OpenCADStudio::scene::{model::presspull_model, Scene};
|
||||
@@ -31,7 +31,7 @@ fn area_picks_follow_exact_curves_and_keep_holes() {
|
||||
assert!(loops
|
||||
.iter()
|
||||
.flatten()
|
||||
.all(|curve| !matches!(curve, cadkernel::geom2d::Curve::Line(_))));
|
||||
.all(|curve| !matches!(curve, kernel::geom2d::Curve::Line(_))));
|
||||
let body = presspull_model::extrusion_body(&entity, [0.0, 0.0, 10.0]).unwrap();
|
||||
assert!(body.validate().is_empty());
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use acadrust::entities::{EntityCommon, ExtendedEntity, ExtendedEntityData, SectionObjectData};
|
||||
use acadrust::objects::{ClassObjectData, ObjectType};
|
||||
use acadrust::types::{Color, Handle, Vector3};
|
||||
use acadrust::xdata::{ExtendedDataRecord, XDataValue};
|
||||
use acadrust::EntityType;
|
||||
use codec::entities::{EntityCommon, ExtendedEntity, ExtendedEntityData, SectionObjectData};
|
||||
use codec::objects::{ClassObjectData, ObjectType};
|
||||
use codec::types::{Color, Handle, Vector3};
|
||||
use codec::xdata::{ExtendedDataRecord, XDataValue};
|
||||
use codec::EntityType;
|
||||
use OpenCADStudio::scene::Scene;
|
||||
|
||||
fn add_slice(scene: &mut Scene) -> Handle {
|
||||
@@ -32,7 +32,7 @@ fn add_slice(scene: &mut Scene) -> Handle {
|
||||
}))
|
||||
}
|
||||
|
||||
fn assert_section_graph(document: &acadrust::CadDocument, extension: &str) {
|
||||
fn assert_section_graph(document: &codec::CadDocument, extension: &str) {
|
||||
let (handle, section) = document
|
||||
.entities()
|
||||
.find_map(|entity| match entity {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use acadrust::entities::{Insert, MText};
|
||||
use acadrust::tables::{BlockRecord, TextStyle};
|
||||
use acadrust::types::Vector3;
|
||||
use acadrust::{CadDocument, EntityType, Handle};
|
||||
use codec::entities::{Insert, MText};
|
||||
use codec::tables::{BlockRecord, TextStyle};
|
||||
use codec::types::Vector3;
|
||||
use codec::{CadDocument, EntityType, Handle};
|
||||
use OpenCADStudio::scene::cache::block_cache::{expand_insert, BlockCache};
|
||||
use OpenCADStudio::scene::view::render::InheritStyle;
|
||||
use OpenCADStudio::scene::WireModel;
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
//! `ucs_from_normal` in `src/app/helpers.rs`, which is `pub(crate)` and so out
|
||||
//! of reach from here.
|
||||
|
||||
use acadrust::{entities::Circle, types::Vector3, EntityType};
|
||||
use codec::{entities::Circle, types::Vector3, EntityType};
|
||||
use OpenCADStudio::scene::model::{presspull_model, solid_model};
|
||||
|
||||
/// Extrude a disc into a puck 10 units tall, centred on the origin.
|
||||
fn puck() -> cadkernel::brep::Body {
|
||||
fn puck() -> kernel::brep::Body {
|
||||
let entity = EntityType::Circle(Circle::from_center_radius(
|
||||
Vector3::new(0.0, 0.0, 0.0),
|
||||
100.0,
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
//! 0.15 mm): every single-line diagram plotted as black blobs.
|
||||
#![cfg(not(target_arch = "wasm32"))]
|
||||
|
||||
use acadrust::entities::{LwPolyline, LwVertex, Viewport};
|
||||
use acadrust::types::{Vector2, Vector3};
|
||||
use acadrust::EntityType;
|
||||
use codec::entities::{LwPolyline, LwVertex, Viewport};
|
||||
use codec::types::{Vector2, Vector3};
|
||||
use codec::EntityType;
|
||||
use OpenCADStudio::scene::Scene;
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Regression for #284: ZOOM Extents must ignore the ±1e6 display segments
|
||||
// that XLine/Ray tessellate into, instead of fitting the camera to them.
|
||||
use acadrust::entities::{Line, XLine};
|
||||
use acadrust::types::Vector3;
|
||||
use acadrust::EntityType;
|
||||
use codec::entities::{Line, XLine};
|
||||
use codec::types::Vector3;
|
||||
use codec::EntityType;
|
||||
use OpenCADStudio::scene::Scene;
|
||||
|
||||
fn add_rect(scene: &mut Scene) {
|
||||
|
||||
Reference in new issue
Block a user