ducpy 3.2.1__tar.gz → 3.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ducpy-3.2.1 → ducpy-3.2.3}/Cargo.lock +16 -15
- {ducpy-3.2.1 → ducpy-3.2.3}/PKG-INFO +1 -1
- {ducpy-3.2.1 → ducpy-3.2.3}/packages/ducpy/crate/Cargo.toml +3 -3
- ducpy-3.2.3/packages/ducrs/src/lib.rs +12 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/packages/ducrs/src/parse.rs +11 -11
- {ducpy-3.2.1 → ducpy-3.2.3}/packages/ducrs/src/serialize.rs +2 -2
- {ducpy-3.2.1 → ducpy-3.2.3}/packages/ducrs/src/types.rs +3 -2
- ducpy-3.2.3/packages/ducrs/sst-env.d.ts +10 -0
- ducpy-3.2.3/packages/ducrs/tests/common/mod.rs +1008 -0
- ducpy-3.2.3/packages/ducrs/tests/parser_assets.rs +227 -0
- ducpy-3.2.3/packages/ducrs/tests/synthetic_roundtrip.rs +25 -0
- ducpy-3.2.1/packages/ducrs/src/lib.rs +0 -298
- {ducpy-3.2.1 → ducpy-3.2.3}/Cargo.toml +0 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/LICENSE +0 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/README.md +0 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/packages/ducpy/crate/src/lib.rs +0 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/packages/ducrs/.gitignore +0 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/packages/ducrs/Cargo.toml +0 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/packages/ducrs/LICENSE +0 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/packages/ducrs/README.md +0 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/packages/ducrs/build.rs +0 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/packages/ducrs/package.json +0 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/packages/ducrs/release.config.cjs +0 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/packages/ducrs/src/api/document.rs +0 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/packages/ducrs/src/api/meta.rs +0 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/packages/ducrs/src/api/mod.rs +0 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/packages/ducrs/src/api/version_control.rs +0 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/packages/ducrs/src/db/bootstrap.rs +0 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/packages/ducrs/src/db/mod.rs +0 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/packages/ducrs/src/db/native.rs +0 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/packages/ducrs/src/db/wasm.rs +0 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/packages/ducrs/src/serde_utils.rs +0 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/packages/ducrs/tests/.gitignore +0 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/pyproject.toml +0 -0
- {ducpy-3.2.1 → ducpy-3.2.3}/src/ducpy_native/__init__.py +0 -0
|
@@ -390,6 +390,7 @@ dependencies = [
|
|
|
390
390
|
"js-sys",
|
|
391
391
|
"log",
|
|
392
392
|
"serde",
|
|
393
|
+
"serde-wasm-bindgen",
|
|
393
394
|
"serde_json",
|
|
394
395
|
"svg2pdf",
|
|
395
396
|
"svgtypes 0.12.0",
|
|
@@ -411,7 +412,7 @@ dependencies = [
|
|
|
411
412
|
|
|
412
413
|
[[package]]
|
|
413
414
|
name = "ducpy-native"
|
|
414
|
-
version = "3.2.
|
|
415
|
+
version = "3.2.3"
|
|
415
416
|
dependencies = [
|
|
416
417
|
"duc",
|
|
417
418
|
"pyo3",
|
|
@@ -1366,9 +1367,9 @@ dependencies = [
|
|
|
1366
1367
|
|
|
1367
1368
|
[[package]]
|
|
1368
1369
|
name = "pyo3"
|
|
1369
|
-
version = "0.
|
|
1370
|
+
version = "0.24.2"
|
|
1370
1371
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1371
|
-
checksum = "
|
|
1372
|
+
checksum = "e5203598f366b11a02b13aa20cab591229ff0a89fd121a308a5df751d5fc9219"
|
|
1372
1373
|
dependencies = [
|
|
1373
1374
|
"cfg-if",
|
|
1374
1375
|
"indoc",
|
|
@@ -1384,9 +1385,9 @@ dependencies = [
|
|
|
1384
1385
|
|
|
1385
1386
|
[[package]]
|
|
1386
1387
|
name = "pyo3-build-config"
|
|
1387
|
-
version = "0.
|
|
1388
|
+
version = "0.24.2"
|
|
1388
1389
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1389
|
-
checksum = "
|
|
1390
|
+
checksum = "99636d423fa2ca130fa5acde3059308006d46f98caac629418e53f7ebb1e9999"
|
|
1390
1391
|
dependencies = [
|
|
1391
1392
|
"once_cell",
|
|
1392
1393
|
"target-lexicon",
|
|
@@ -1394,9 +1395,9 @@ dependencies = [
|
|
|
1394
1395
|
|
|
1395
1396
|
[[package]]
|
|
1396
1397
|
name = "pyo3-ffi"
|
|
1397
|
-
version = "0.
|
|
1398
|
+
version = "0.24.2"
|
|
1398
1399
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1399
|
-
checksum = "
|
|
1400
|
+
checksum = "78f9cf92ba9c409279bc3305b5409d90db2d2c22392d443a87df3a1adad59e33"
|
|
1400
1401
|
dependencies = [
|
|
1401
1402
|
"libc",
|
|
1402
1403
|
"pyo3-build-config",
|
|
@@ -1404,9 +1405,9 @@ dependencies = [
|
|
|
1404
1405
|
|
|
1405
1406
|
[[package]]
|
|
1406
1407
|
name = "pyo3-macros"
|
|
1407
|
-
version = "0.
|
|
1408
|
+
version = "0.24.2"
|
|
1408
1409
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1409
|
-
checksum = "
|
|
1410
|
+
checksum = "0b999cb1a6ce21f9a6b147dcf1be9ffedf02e0043aec74dc390f3007047cecd9"
|
|
1410
1411
|
dependencies = [
|
|
1411
1412
|
"proc-macro2",
|
|
1412
1413
|
"pyo3-macros-backend",
|
|
@@ -1416,9 +1417,9 @@ dependencies = [
|
|
|
1416
1417
|
|
|
1417
1418
|
[[package]]
|
|
1418
1419
|
name = "pyo3-macros-backend"
|
|
1419
|
-
version = "0.
|
|
1420
|
+
version = "0.24.2"
|
|
1420
1421
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1421
|
-
checksum = "
|
|
1422
|
+
checksum = "822ece1c7e1012745607d5cf0bcb2874769f0f7cb34c4cde03b9358eb9ef911a"
|
|
1422
1423
|
dependencies = [
|
|
1423
1424
|
"heck",
|
|
1424
1425
|
"proc-macro2",
|
|
@@ -1429,9 +1430,9 @@ dependencies = [
|
|
|
1429
1430
|
|
|
1430
1431
|
[[package]]
|
|
1431
1432
|
name = "pythonize"
|
|
1432
|
-
version = "0.
|
|
1433
|
+
version = "0.24.0"
|
|
1433
1434
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1434
|
-
checksum = "
|
|
1435
|
+
checksum = "d5bcac0d0b71821f0d69e42654f1e15e5c94b85196446c4de9588951a2117e7b"
|
|
1435
1436
|
dependencies = [
|
|
1436
1437
|
"pyo3",
|
|
1437
1438
|
"serde",
|
|
@@ -1945,9 +1946,9 @@ dependencies = [
|
|
|
1945
1946
|
|
|
1946
1947
|
[[package]]
|
|
1947
1948
|
name = "target-lexicon"
|
|
1948
|
-
version = "0.
|
|
1949
|
+
version = "0.13.5"
|
|
1949
1950
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1950
|
-
checksum = "
|
|
1951
|
+
checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
|
|
1951
1952
|
|
|
1952
1953
|
[[package]]
|
|
1953
1954
|
name = "termcolor"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "ducpy-native"
|
|
3
|
-
version = "3.2.
|
|
3
|
+
version = "3.2.3"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
description = "Python native extension for the duc file format (used by ducpy)"
|
|
6
6
|
publish = false
|
|
@@ -11,7 +11,7 @@ crate-type = ["cdylib"]
|
|
|
11
11
|
|
|
12
12
|
[dependencies]
|
|
13
13
|
duc = { path = "../../ducrs" }
|
|
14
|
-
pyo3 = { version = "0.
|
|
15
|
-
pythonize = "0.
|
|
14
|
+
pyo3 = { version = "0.24.1", features = ["extension-module"] }
|
|
15
|
+
pythonize = "0.24"
|
|
16
16
|
serde = { version = "1.0", features = ["derive"] }
|
|
17
17
|
serde_json = "1.0"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#[allow(unused_imports)]
|
|
2
|
+
#[allow(non_camel_case_types)]
|
|
3
|
+
#[allow(non_snake_case)]
|
|
4
|
+
#[allow(non_upper_case_globals)]
|
|
5
|
+
pub mod parse;
|
|
6
|
+
pub mod serde_utils;
|
|
7
|
+
pub mod serialize;
|
|
8
|
+
pub mod types;
|
|
9
|
+
|
|
10
|
+
// SQLite storage layer and high-level document API
|
|
11
|
+
pub mod db;
|
|
12
|
+
pub mod api;
|
|
@@ -1374,23 +1374,23 @@ fn read_binding_from_row(row: &rusqlite::Row, offset: usize) -> rusqlite::Result
|
|
|
1374
1374
|
let elem_id: Option<String> = row.get(offset)?;
|
|
1375
1375
|
let Some(element_id) = elem_id else { return Ok(None) };
|
|
1376
1376
|
|
|
1377
|
-
let fixed_x: Option<f64> = row.get(offset +
|
|
1377
|
+
let fixed_x: Option<f64> = row.get(offset + 3)?;
|
|
1378
1378
|
let fixed_point = fixed_x.map(|x| GeometricPoint {
|
|
1379
1379
|
x,
|
|
1380
|
-
y: row.get::<_, f64>(offset +
|
|
1380
|
+
y: row.get::<_, f64>(offset + 4).unwrap_or(0.0),
|
|
1381
1381
|
});
|
|
1382
1382
|
|
|
1383
|
-
let pt_idx: Option<i32> = row.get(offset +
|
|
1383
|
+
let pt_idx: Option<i32> = row.get(offset + 5)?;
|
|
1384
1384
|
let point = pt_idx.map(|index| PointBindingPoint {
|
|
1385
1385
|
index,
|
|
1386
|
-
offset: row.get::<_, f64>(offset +
|
|
1386
|
+
offset: row.get::<_, f64>(offset + 6).unwrap_or(0.0),
|
|
1387
1387
|
});
|
|
1388
1388
|
|
|
1389
|
-
let head_type: Option<i32> = row.get(offset +
|
|
1389
|
+
let head_type: Option<i32> = row.get(offset + 7)?;
|
|
1390
1390
|
let head = head_type.map(|ht| DucHead {
|
|
1391
1391
|
head_type: Some(int_to_line_head(ht)),
|
|
1392
|
-
block_id: row.get::<_, Option<String>>(offset +
|
|
1393
|
-
size: row.get::<_, f64>(offset +
|
|
1392
|
+
block_id: row.get::<_, Option<String>>(offset + 8).unwrap_or(None),
|
|
1393
|
+
size: row.get::<_, f64>(offset + 9).unwrap_or(1.0),
|
|
1394
1394
|
});
|
|
1395
1395
|
|
|
1396
1396
|
Ok(Some(DucPointBinding {
|
|
@@ -1506,10 +1506,10 @@ fn read_table_element(conn: &Connection, base: DucElementBase) -> ParseResult<Du
|
|
|
1506
1506
|
fn read_model_element(conn: &Connection, base: DucElementBase) -> ParseResult<DucElementEnum> {
|
|
1507
1507
|
let id = base.id.clone();
|
|
1508
1508
|
let mut stmt = conn.prepare_cached(
|
|
1509
|
-
"SELECT model_type, code,
|
|
1509
|
+
"SELECT model_type, code, thumbnail FROM element_model WHERE element_id = ?1"
|
|
1510
1510
|
)?;
|
|
1511
|
-
let (model_type, code,
|
|
1512
|
-
Ok((row.get::<_, Option<String>>(0)?, row.get::<_, Option<String>>(1)?, row.get::<_, Option<
|
|
1511
|
+
let (model_type, code, thumbnail) = stmt.query_row(params![id], |row| {
|
|
1512
|
+
Ok((row.get::<_, Option<String>>(0)?, row.get::<_, Option<String>>(1)?, row.get::<_, Option<Vec<u8>>>(2)?))
|
|
1513
1513
|
})?;
|
|
1514
1514
|
|
|
1515
1515
|
let mut f_stmt = conn.prepare_cached(
|
|
@@ -1521,7 +1521,7 @@ fn read_model_element(conn: &Connection, base: DucElementBase) -> ParseResult<Du
|
|
|
1521
1521
|
let viewer_state = read_model_viewer_state(conn, &id)?;
|
|
1522
1522
|
|
|
1523
1523
|
Ok(DucElementEnum::DucModelElement(DucModelElement {
|
|
1524
|
-
base, model_type, code,
|
|
1524
|
+
base, model_type, code, thumbnail, file_ids, viewer_state,
|
|
1525
1525
|
}))
|
|
1526
1526
|
}
|
|
1527
1527
|
|
|
@@ -829,9 +829,9 @@ fn write_document_grid_config(
|
|
|
829
829
|
|
|
830
830
|
fn write_model_element(tx: &Transaction, e: &DucModelElement) -> SerializeResult<()> {
|
|
831
831
|
tx.execute(
|
|
832
|
-
"INSERT INTO element_model (element_id, model_type, code,
|
|
832
|
+
"INSERT INTO element_model (element_id, model_type, code, thumbnail)
|
|
833
833
|
VALUES (?1, ?2, ?3, ?4)",
|
|
834
|
-
params![e.base.id, e.model_type, e.code, e.
|
|
834
|
+
params![e.base.id, e.model_type, e.code, e.thumbnail],
|
|
835
835
|
)?;
|
|
836
836
|
|
|
837
837
|
{
|
|
@@ -1185,8 +1185,9 @@ pub struct DucModelElement {
|
|
|
1185
1185
|
pub model_type: Option<String>,
|
|
1186
1186
|
/** Defines the source code of the model using build123d python code */
|
|
1187
1187
|
pub code: Option<String>,
|
|
1188
|
-
/** The last known
|
|
1189
|
-
|
|
1188
|
+
/** The last known image thumbnail of the 3D model for quick rendering on the canvas */
|
|
1189
|
+
#[serde(with = "serde_bytes", default, skip_serializing_if = "Option::is_none")]
|
|
1190
|
+
pub thumbnail: Option<Vec<u8>>,
|
|
1190
1191
|
/** Possibly connected external files, such as STEP, STL, DXF, etc. */
|
|
1191
1192
|
pub file_ids: Vec<String>,
|
|
1192
1193
|
/** The last known 3D viewer state for the model */
|