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
@@ -34,7 +34,7 @@ impl UnitContext {
|
||||
/// The settings as this drawing holds them. Every place that formats or
|
||||
/// reads a number seeds the context from here, so none of them can be
|
||||
/// working from a different idea of the drawing's conventions.
|
||||
pub fn from_header(header: &acadrust::document::HeaderVariables) -> Self {
|
||||
pub fn from_header(header: &codec::document::HeaderVariables) -> Self {
|
||||
Self {
|
||||
lunits: header.linear_unit_format,
|
||||
luprec: header.linear_unit_precision,
|
||||
@@ -71,7 +71,7 @@ thread_local! {
|
||||
}
|
||||
|
||||
/// Record which text styles fix their height, from the drawing's style table.
|
||||
pub fn set_fixed_text_heights(document: &acadrust::CadDocument) {
|
||||
pub fn set_fixed_text_heights(document: &codec::CadDocument) {
|
||||
FIXED_TEXT_HEIGHTS.with(|cell| {
|
||||
let mut map = cell.borrow_mut();
|
||||
map.clear();
|
||||
@@ -754,7 +754,7 @@ fn parse_angle_deg_unbounded(value: &str) -> Option<f64> {
|
||||
/// Re-exported rather than imported at each call site so the twelve modules
|
||||
/// that already reach for `entities::common::BulgeArc` keep working, and so
|
||||
/// there is one obvious place to see that the maths moved out.
|
||||
pub use cadkernel::geom2d::BulgeArc;
|
||||
pub use kernel::geom2d::BulgeArc;
|
||||
|
||||
/// Convert a 2D BulgeArc into a 3D TangentGeom::Arc with its world center,
|
||||
/// plane axes, radius, and counter-clockwise start/end sweep angles.
|
||||
@@ -944,7 +944,7 @@ pub(crate) fn tapered_band_points(
|
||||
if bulge.abs() < 1e-9 {
|
||||
push(p1[0], p1[1], ew0 as f32);
|
||||
} else if let Some(arc) = BulgeArc::from_bulge(p0, p1, bulge) {
|
||||
let samples = arc.tessellate_angle(cadkernel::tessellation::DEFAULT_ANGLE);
|
||||
let samples = arc.tessellate_angle(kernel::tessellation::DEFAULT_ANGLE);
|
||||
let segments = samples.len().saturating_sub(1).max(1);
|
||||
for (index, s) in samples.into_iter().enumerate().skip(1) {
|
||||
let t = index as f64 / segments as f64;
|
||||
@@ -970,10 +970,10 @@ pub(crate) fn wide_band_outline(
|
||||
restart_per_segment: bool,
|
||||
to_wcs: &dyn Fn(f64, f64) -> (f64, f64, f64),
|
||||
) -> WideBandOutline {
|
||||
let source = cadkernel::geom2d::Polyline {
|
||||
let source = kernel::geom2d::Polyline {
|
||||
vertices: verts
|
||||
.iter()
|
||||
.map(|(position, bulge, _, _)| cadkernel::geom2d::PolylineVertex {
|
||||
.map(|(position, bulge, _, _)| kernel::geom2d::PolylineVertex {
|
||||
position: *position,
|
||||
bulge: *bulge,
|
||||
})
|
||||
@@ -990,10 +990,10 @@ pub(crate) fn wide_band_outline(
|
||||
.take(segment_count)
|
||||
.map(|(_, _, start, end)| [*start, *end])
|
||||
.collect();
|
||||
let boundary = cadkernel::geom2d::polyline_band_boundary(
|
||||
let boundary = kernel::geom2d::polyline_band_boundary(
|
||||
&source,
|
||||
&widths,
|
||||
cadkernel::tessellation::DEFAULT_ANGLE,
|
||||
kernel::tessellation::DEFAULT_ANGLE,
|
||||
);
|
||||
let mut points = Vec::new();
|
||||
let mut stations = Vec::new();
|
||||
|
||||
Reference in new issue
Block a user