altium-toolkit 1.4.1 → 1.4.3
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.
- package/README.md +7 -0
- package/docs/release-notes-v1.4.2.md +27 -0
- package/docs/release-notes-v1.4.3.md +20 -0
- package/package.json +2 -2
- package/src/convergence/AltiumProjectDocumentResolver.mjs +2 -2
- package/src/convergence/PcbSideResolvedRenderModel.mjs +132 -0
- package/src/legacy-renderers.mjs +1 -1
package/README.md
CHANGED
|
@@ -51,6 +51,12 @@ traces across input edits without changing parser, document, renderer, or
|
|
|
51
51
|
native-extension contracts. See the
|
|
52
52
|
[1.4.1 release notes](docs/release-notes-v1.4.1.md).
|
|
53
53
|
|
|
54
|
+
Version 1.4.2 rebuilds project-resolved canonical documents through the
|
|
55
|
+
toolkit-owned validation path and CircuitJSON Toolkit 1.4.2. Large native
|
|
56
|
+
extension graphs retain their proven ownership instead of repeating defensive
|
|
57
|
+
binary classification. See the
|
|
58
|
+
[1.4.2 release notes](docs/release-notes-v1.4.2.md).
|
|
59
|
+
|
|
54
60
|
Default `extensions: 'canonical'` keeps compact Altium summary metadata.
|
|
55
61
|
Request the complete native read model with `extensions: 'full'`,
|
|
56
62
|
`preserveRaw: true`, or `extensions: ['altium.native-model']`. Project batches
|
|
@@ -218,6 +224,7 @@ const legacyCircuitJson = AltiumParser.parseArrayBuffer(file.name, arrayBuffer)
|
|
|
218
224
|
- [API](docs/api.md)
|
|
219
225
|
- [Capabilities](docs/capabilities.md)
|
|
220
226
|
- [Migration from 1.1.41](docs/migration.md)
|
|
227
|
+
- [1.4.2 release notes](docs/release-notes-v1.4.2.md)
|
|
221
228
|
- [1.4.1 release notes](docs/release-notes-v1.4.1.md)
|
|
222
229
|
- [1.4.0 release notes](docs/release-notes-v1.4.0.md)
|
|
223
230
|
- [1.3.0 release notes](docs/release-notes-v1.3.0.md)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# altium-toolkit 1.4.2
|
|
2
|
+
|
|
3
|
+
Version 1.4.2 removes redundant immutable-extension validation from canonical
|
|
4
|
+
project document rebuilding. Parser output, project resolution, extension
|
|
5
|
+
selection, and renderer contracts remain unchanged.
|
|
6
|
+
|
|
7
|
+
## Faster project resolution
|
|
8
|
+
|
|
9
|
+
- `AltiumProjectDocumentResolver` rebuilds changed canonical documents through
|
|
10
|
+
the shared toolkit-owned `DocumentResult` boundary.
|
|
11
|
+
- Already proven and frozen native extension graphs retain their identity when
|
|
12
|
+
project parameters update canonical or retained-native schematic text.
|
|
13
|
+
- Defensive binary classification is no longer repeated across every record of
|
|
14
|
+
a large owned extension graph.
|
|
15
|
+
|
|
16
|
+
## Dependency
|
|
17
|
+
|
|
18
|
+
- `circuitjson-toolkit` 1.4.2 supplies the owned-extension reuse and atomic
|
|
19
|
+
cooperative structured-clone finalization behavior.
|
|
20
|
+
- Arbitrary caller data still uses the defensive shared validation path.
|
|
21
|
+
|
|
22
|
+
## Verification
|
|
23
|
+
|
|
24
|
+
- An inspector-backed regression bounds exception-driven binary brand probes
|
|
25
|
+
during a project rebuild.
|
|
26
|
+
- The complete package suite, formatting, performance, feature-preservation,
|
|
27
|
+
and npm dry-run gates verify the release.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# altium-toolkit 1.4.3
|
|
2
|
+
|
|
3
|
+
Version 1.4.3 keeps PCB fabrication details on their authored board side when
|
|
4
|
+
preparing side-resolved render models.
|
|
5
|
+
|
|
6
|
+
## Side-correct PCB fabrication details
|
|
7
|
+
|
|
8
|
+
- Front-side views retain top overlay, paste, and solder-mask primitives while
|
|
9
|
+
excluding their bottom-side counterparts.
|
|
10
|
+
- Back-side views retain bottom overlay, paste, and solder-mask primitives while
|
|
11
|
+
excluding their top-side counterparts.
|
|
12
|
+
- Shared mechanical and documentation layers remain visible on both sides.
|
|
13
|
+
- Copper projection continues to use the established native Altium behavior.
|
|
14
|
+
|
|
15
|
+
## Verification
|
|
16
|
+
|
|
17
|
+
- A side-resolution regression covers fills, tracks, arcs, regions,
|
|
18
|
+
shape-based regions, and board regions with neutral-layer preservation.
|
|
19
|
+
- The complete package suite, formatting, and npm dry-run gates verify the
|
|
20
|
+
release.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "altium-toolkit",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"description": "Altium document parsing and non-interactive rendering utilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"altium",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"check:features": "node scripts/check-feature-preservation.mjs"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"circuitjson-toolkit": "^1.4.
|
|
70
|
+
"circuitjson-toolkit": "^1.4.2",
|
|
71
71
|
"fflate": "^0.8.2"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
@@ -239,13 +239,13 @@ export class AltiumProjectDocumentResolver {
|
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
/**
|
|
242
|
-
* Rebuilds one canonical document through the
|
|
242
|
+
* Rebuilds one canonical document through the toolkit-owned shared boundary.
|
|
243
243
|
* @param {object} document Existing canonical document.
|
|
244
244
|
* @param {{ model?: object[], extensions?: object, statistics?: object }} fields Replacements.
|
|
245
245
|
* @returns {object} Proven immutable document.
|
|
246
246
|
*/
|
|
247
247
|
static #rebuild(document, fields) {
|
|
248
|
-
return DocumentResult.
|
|
248
|
+
return DocumentResult.createValidatedOwned(
|
|
249
249
|
{
|
|
250
250
|
id: document.id,
|
|
251
251
|
model: fields.model || document.model,
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2026 André Fiedler
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
4
|
+
|
|
5
|
+
import { PcbLayerGroups } from '../core/altium/PcbLayerGroups.mjs'
|
|
6
|
+
import { PcbSideResolvedRenderModel as HistoricalPcbSideResolvedRenderModel } from '../ui/PcbSideResolvedRenderModel.mjs'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Adds side-correct fabrication detail filtering around the preserved native
|
|
10
|
+
* Altium side projection.
|
|
11
|
+
*/
|
|
12
|
+
export class PcbSideResolvedRenderModel {
|
|
13
|
+
/**
|
|
14
|
+
* Resolves a normalized PCB model for the requested board side.
|
|
15
|
+
* @param {object | null} board
|
|
16
|
+
* @param {'front' | 'back' | { side?: 'front' | 'back' }} [options]
|
|
17
|
+
* @returns {object | null}
|
|
18
|
+
*/
|
|
19
|
+
static resolve(board, options = {}) {
|
|
20
|
+
const side = PcbSideResolvedRenderModel.#normalizeSide(options)
|
|
21
|
+
const resolved = HistoricalPcbSideResolvedRenderModel.resolve(
|
|
22
|
+
board,
|
|
23
|
+
options
|
|
24
|
+
)
|
|
25
|
+
if (!resolved?.pcb) return resolved
|
|
26
|
+
|
|
27
|
+
const pcb = resolved.pcb
|
|
28
|
+
return {
|
|
29
|
+
...resolved,
|
|
30
|
+
pcb: {
|
|
31
|
+
...pcb,
|
|
32
|
+
fills: PcbSideResolvedRenderModel.#filterPrimitives(
|
|
33
|
+
pcb.fills,
|
|
34
|
+
side
|
|
35
|
+
),
|
|
36
|
+
tracks: PcbSideResolvedRenderModel.#filterPrimitives(
|
|
37
|
+
pcb.tracks,
|
|
38
|
+
side
|
|
39
|
+
),
|
|
40
|
+
arcs: PcbSideResolvedRenderModel.#filterPrimitives(
|
|
41
|
+
pcb.arcs,
|
|
42
|
+
side
|
|
43
|
+
),
|
|
44
|
+
regions: PcbSideResolvedRenderModel.#filterPrimitives(
|
|
45
|
+
pcb.regions,
|
|
46
|
+
side
|
|
47
|
+
),
|
|
48
|
+
shapeBasedRegions: PcbSideResolvedRenderModel.#filterPrimitives(
|
|
49
|
+
pcb.shapeBasedRegions,
|
|
50
|
+
side
|
|
51
|
+
),
|
|
52
|
+
boardRegions: PcbSideResolvedRenderModel.#filterPrimitives(
|
|
53
|
+
pcb.boardRegions,
|
|
54
|
+
side
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Checks whether a primitive belongs to an Altium copper signal layer.
|
|
62
|
+
* @param {object | null} primitive
|
|
63
|
+
* @returns {boolean}
|
|
64
|
+
*/
|
|
65
|
+
static isCopperPrimitive(primitive) {
|
|
66
|
+
return HistoricalPcbSideResolvedRenderModel.isCopperPrimitive(primitive)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Normalizes the caller side option.
|
|
71
|
+
* @param {'front' | 'back' | { side?: 'front' | 'back' }} options
|
|
72
|
+
* @returns {'front' | 'back'}
|
|
73
|
+
*/
|
|
74
|
+
static #normalizeSide(options) {
|
|
75
|
+
if (options === 'back') return 'back'
|
|
76
|
+
if (options && typeof options === 'object' && options.side === 'back') {
|
|
77
|
+
return 'back'
|
|
78
|
+
}
|
|
79
|
+
return 'front'
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Filters one primitive collection to the requested surface.
|
|
84
|
+
* @param {readonly object[] | undefined} primitives
|
|
85
|
+
* @param {'front' | 'back'} side
|
|
86
|
+
* @returns {object[]}
|
|
87
|
+
*/
|
|
88
|
+
static #filterPrimitives(primitives, side) {
|
|
89
|
+
return (primitives || []).filter((primitive) =>
|
|
90
|
+
PcbSideResolvedRenderModel.#isPrimitiveVisibleOnSide(
|
|
91
|
+
primitive,
|
|
92
|
+
side
|
|
93
|
+
)
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Checks whether a primitive belongs to the requested surface or a shared
|
|
99
|
+
* non-surface layer.
|
|
100
|
+
* @param {object | null} primitive
|
|
101
|
+
* @param {'front' | 'back'} side
|
|
102
|
+
* @returns {boolean}
|
|
103
|
+
*/
|
|
104
|
+
static #isPrimitiveVisibleOnSide(primitive, side) {
|
|
105
|
+
const layerId = primitive?.layerId ?? primitive?.layerCode
|
|
106
|
+
if (PcbLayerGroups.isCopper(layerId)) return true
|
|
107
|
+
|
|
108
|
+
const layerSide = PcbLayerGroups.describeLayer(layerId).side
|
|
109
|
+
if (layerSide === 'top') return side === 'front'
|
|
110
|
+
if (layerSide === 'bottom') return side === 'back'
|
|
111
|
+
return true
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Resolves a normalized PCB model for the requested board side.
|
|
117
|
+
* @param {object | null} board
|
|
118
|
+
* @param {'front' | 'back' | { side?: 'front' | 'back' }} [options]
|
|
119
|
+
* @returns {object | null}
|
|
120
|
+
*/
|
|
121
|
+
export function preparePcbSideResolvedRenderModel(board, options = {}) {
|
|
122
|
+
return PcbSideResolvedRenderModel.resolve(board, options)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Checks whether a primitive belongs to an Altium copper signal layer.
|
|
127
|
+
* @param {object | null} primitive
|
|
128
|
+
* @returns {boolean}
|
|
129
|
+
*/
|
|
130
|
+
export function isCopperPrimitive(primitive) {
|
|
131
|
+
return PcbSideResolvedRenderModel.isCopperPrimitive(primitive)
|
|
132
|
+
}
|
package/src/legacy-renderers.mjs
CHANGED
|
@@ -15,7 +15,7 @@ export {
|
|
|
15
15
|
PcbSideResolvedRenderModel,
|
|
16
16
|
isCopperPrimitive,
|
|
17
17
|
preparePcbSideResolvedRenderModel
|
|
18
|
-
} from './
|
|
18
|
+
} from './convergence/PcbSideResolvedRenderModel.mjs'
|
|
19
19
|
export { PcbSvgRenderer } from './ui/PcbSvgRenderer.mjs'
|
|
20
20
|
export { SchematicColorResolver } from './ui/SchematicColorResolver.mjs'
|
|
21
21
|
export { SchematicContentLayout } from './ui/SchematicContentLayout.mjs'
|