brep-io-kernel 1.0.267 → 1.0.268
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/dist/apiExamples/BREP_Booleans.html +2 -2
- package/dist/apiExamples/BREP_Export.html +2 -2
- package/dist/apiExamples/BREP_Primitives.html +2 -2
- package/dist/apiExamples/BREP_Transforms.html +2 -2
- package/dist/apiExamples/Embeded_2D_Sketcher.html +2 -2
- package/dist/apiExamples/Embeded_CAD.html +2 -2
- package/dist/apiExamples/Embeded_CAD_Integration_Test.html +2 -2
- package/dist/assets/{apiExample_BREP_Booleans-CTe2EMfJ.js → apiExample_BREP_Booleans-BQuhH0p9.js} +1 -1
- package/dist/assets/{apiExample_BREP_Export-drwwX-N0.js → apiExample_BREP_Export-DxoW5Siv.js} +1 -1
- package/dist/assets/{apiExample_BREP_Primitives-DmkRC9x9.js → apiExample_BREP_Primitives-DObxD2ky.js} +1 -1
- package/dist/assets/{apiExample_BREP_Transforms-BuSQlmou.js → apiExample_BREP_Transforms-B2hpG-YX.js} +1 -1
- package/dist/assets/{apiExample_Embeded_2D_Sketcher-uhVSKDmJ.js → apiExample_Embeded_2D_Sketcher-Dg9Zu_hE.js} +1 -1
- package/dist/assets/{apiExample_Embeded_CAD-DHa-5wYS.js → apiExample_Embeded_CAD-BpJVoWOu.js} +1 -1
- package/dist/assets/{apiExample_Embeded_CAD_Integration_Test-ChPFgcn1.js → apiExample_Embeded_CAD_Integration_Test-B_Rho3aP.js} +1 -1
- package/dist/assets/{brep-kernel-DJpirUxq.js → brep-kernel-Bj1tafeh.js} +1 -1
- package/dist/assets/{browserTests-Co7TxSP6.js → browserTests-DyAKA3LJ.js} +3 -3
- package/dist/assets/{index.es-f-EIT528.js → index.es-CV0V3j9t.js} +1 -1
- package/dist/assets/{javascript-kCxntZPl.js → javascript-CMfqYyeC.js} +1 -1
- package/dist/assets/{main-cad-BckkeW6Q.js → main-cad-B_iFo8MJ.js} +5 -5
- package/dist/assets/{test-CZQN4gj3.js → test-DTqZegA4.js} +3 -3
- package/dist/cad.html +1 -1
- package/dist/test.html +1 -1
- package/dist/viewer.html +1 -1
- package/dist-kernel/brep-kernel.js +24 -24
- package/package.json +1 -1
- package/src/UI/toolbarButtons/scriptRunnerButton.js +5 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/brep-kernel-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/brep-kernel-Bj1tafeh.js","assets/preload-helper-ZNr0Qq7Q.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var H=Object.defineProperty;var c=(e,t)=>H(e,"name",{value:t,configurable:!0});import"./modulepreload-polyfill-BdX5DvLD.js";import{_ as B}from"./preload-helper-ZNr0Qq7Q.js";const $=document.getElementById("status"),J=document.getElementById("log"),w=document.getElementById("btn-create"),V=document.getElementById("btn-destroy"),T=document.getElementById("btn-apply-css"),F=document.getElementById("btn-apply-theme"),L=document.getElementById("btn-export-svg"),G=document.getElementById("geometry-color"),_=document.getElementById("point-color"),N=document.getElementById("constraint-color"),A=document.getElementById("background-color"),P=document.getElementById("point-size-px"),O=document.getElementById("curve-thickness-px"),v=document.getElementById("sidebar-expanded"),g=document.getElementById("grid-visible"),R=document.getElementById("grid-spacing"),D=document.getElementById("css-input"),K=document.getElementById("sketch-status"),U=document.getElementById("sketch-host"),p=document.getElementById("event-output"),y=document.getElementById("svg-preview"),C=document.getElementById("path-output");let n=null,S=0,E=0,k=0;const W=5,a=c((...e)=>{const t=e.map(s=>{if(typeof s=="string")return s;try{return JSON.stringify(s)}catch{return String(s)}}).join(" ");J.textContent+=`${t}
|
|
3
3
|
`,console.log(...e)},"log"),u=c((e,t)=>{$.textContent=e,$.className=`status ${t}`},"setStatus"),o=c(e=>{K.textContent=e},"setSketchStatus"),x=c(e=>{w.disabled=e,V.disabled=!e,T.disabled=!e,F.disabled=!e,L.disabled=!e},"setSketchButtons"),h=c((e,t=null)=>{const s=new Date().toLocaleTimeString(),i=t==null?`[${s}] ${e}`:`[${s}] ${e} ${JSON.stringify(t)}`,l=p.textContent==="(No sketch events yet)"?[]:p.textContent.split(`
|
|
4
4
|
`).filter(Boolean),d=[i,...l].slice(0,W);p.textContent=d.length?d.join(`
|
|
5
|
-
`):"(No sketch events yet)"},"pushEvent"),M=c(()=>({geometryColor:G.value,pointColor:_.value,constraintColor:N.value,backgroundColor:A.value,pointSizePx:Math.max(1,Number(P.value)||10),curveThicknessPx:Math.max(.5,Number(O.value)||2)}),"currentTheme"),b=c(()=>{const e=Number(R.value);return Number.isFinite(e)&&e>0?e:1},"currentGridSpacing"),X=c(async()=>{if(n)return;const{Sketcher2DEmbed:e}=await B(async()=>{const{Sketcher2DEmbed:t}=await import("./brep-kernel-
|
|
6
|
-
`):"(No sketch geometry to export)",o(`Exported ${e.paths.length} SVG paths.`),y.scrollIntoView({behavior:"smooth",block:"start"})},"exportSvg");w.addEventListener("click",()=>{X().catch(e=>{console.error(e),o(`Failed to create sketcher: ${e?.message||String(e)}`)})});V.addEventListener("click",()=>{Y().catch(e=>{console.error(e),o(`Failed to destroy sketcher: ${e?.message||String(e)}`)})});T.addEventListener("click",()=>{q().catch(e=>{console.error(e),o(`Failed to apply CSS: ${e?.message||String(e)}`)})});L.addEventListener("click",()=>{j().catch(e=>{console.error(e),o(`Failed to export SVG: ${e?.message||String(e)}`)})});F.addEventListener("click",()=>{r().catch(e=>{console.error(e),o(`Failed to apply theme: ${e?.message||String(e)}`)})});[G,_,N,A,P,O].forEach(e=>{e.addEventListener("input",()=>{n&&r().catch(t=>{console.error(t),o(`Failed to apply theme: ${t?.message||String(t)}`)})})});v.addEventListener("change",()=>{n&&r().catch(e=>{console.error(e),o(`Failed to apply sidebar state: ${e?.message||String(e)}`)})});g.addEventListener("change",()=>{n&&r().catch(e=>{console.error(e),o(`Failed to apply grid visibility: ${e?.message||String(e)}`)})});R.addEventListener("input",()=>{n&&r().catch(e=>{console.error(e),o(`Failed to apply grid spacing: ${e?.message||String(e)}`)})});x(!1);C.textContent="(No SVG exported yet)";(async()=>{u("Importing bundle...","pending");const e=await B(()=>import("./brep-kernel-
|
|
5
|
+
`):"(No sketch events yet)"},"pushEvent"),M=c(()=>({geometryColor:G.value,pointColor:_.value,constraintColor:N.value,backgroundColor:A.value,pointSizePx:Math.max(1,Number(P.value)||10),curveThicknessPx:Math.max(.5,Number(O.value)||2)}),"currentTheme"),b=c(()=>{const e=Number(R.value);return Number.isFinite(e)&&e>0?e:1},"currentGridSpacing"),X=c(async()=>{if(n)return;const{Sketcher2DEmbed:e}=await B(async()=>{const{Sketcher2DEmbed:t}=await import("./brep-kernel-Bj1tafeh.js");return{Sketcher2DEmbed:t}},__vite__mapDeps([0,1]));n=new e({cssText:D.value,...M(),sidebarExpanded:v.checked,gridVisible:g.checked,gridSpacing:b(),onChange:c(t=>{S+=1;const s=Array.isArray(t?.geometries)?t.geometries.length:0;o(`Sketch updated (${S}). Geometries: ${s}`),h("onChange",{geometries:s})},"onChange"),onFinished:c(t=>{E+=1;const s=Array.isArray(t?.geometries)?t.geometries.length:0;o(`Sketch finished (${E}). Geometries: ${s}`),h("onFinished",{geometries:s}),j().catch(i=>{console.error(i),o(`Failed to export SVG after Finish: ${i?.message||String(i)}`)})},"onFinished"),onCancelled:c(()=>{k+=1,o(`Sketch cancelled (${k}).`),h("onCancelled")},"onCancelled")}),await n.mount(U),await n.getSketch(),x(!0),o("Sketcher iframe mounted. Draw geometry and click Export SVG Paths.")},"attachSketcher"),Y=c(async()=>{n&&(await n.destroy(),n=null,S=0,E=0,k=0,x(!1),o("Sketcher destroyed."),p.textContent="(No sketch events yet)",y.innerHTML="",C.textContent="")},"detachSketcher"),q=c(async()=>{n&&(await n.setCss(D.value),o("Custom CSS applied to iframe."))},"applySketchCss"),r=c(async()=>{n&&(await n.setTheme(M()),await n.setSidebarExpanded(v.checked),typeof n.setGrid=="function"?await n.setGrid({visible:g.checked,spacing:b()}):(typeof n.setGridVisible=="function"&&await n.setGridVisible(g.checked),typeof n.setGridSpacing=="function"&&await n.setGridSpacing(b())),o("Theme + sidebar + grid state applied to iframe."))},"applySketchTheme"),j=c(async()=>{if(!n)return;const e=await n.exportSVG({flipY:!0,precision:3,stroke:"#111111",strokeWidth:1.5,fill:"none",padding:12});await n.getSketch({preferCached:!0}),y.innerHTML=e.svg,C.textContent=e.paths.length?e.paths.map(t=>`id=${t.id} type=${t.type} d="${t.d}"`).join(`
|
|
6
|
+
`):"(No sketch geometry to export)",o(`Exported ${e.paths.length} SVG paths.`),y.scrollIntoView({behavior:"smooth",block:"start"})},"exportSvg");w.addEventListener("click",()=>{X().catch(e=>{console.error(e),o(`Failed to create sketcher: ${e?.message||String(e)}`)})});V.addEventListener("click",()=>{Y().catch(e=>{console.error(e),o(`Failed to destroy sketcher: ${e?.message||String(e)}`)})});T.addEventListener("click",()=>{q().catch(e=>{console.error(e),o(`Failed to apply CSS: ${e?.message||String(e)}`)})});L.addEventListener("click",()=>{j().catch(e=>{console.error(e),o(`Failed to export SVG: ${e?.message||String(e)}`)})});F.addEventListener("click",()=>{r().catch(e=>{console.error(e),o(`Failed to apply theme: ${e?.message||String(e)}`)})});[G,_,N,A,P,O].forEach(e=>{e.addEventListener("input",()=>{n&&r().catch(t=>{console.error(t),o(`Failed to apply theme: ${t?.message||String(t)}`)})})});v.addEventListener("change",()=>{n&&r().catch(e=>{console.error(e),o(`Failed to apply sidebar state: ${e?.message||String(e)}`)})});g.addEventListener("change",()=>{n&&r().catch(e=>{console.error(e),o(`Failed to apply grid visibility: ${e?.message||String(e)}`)})});R.addEventListener("input",()=>{n&&r().catch(e=>{console.error(e),o(`Failed to apply grid spacing: ${e?.message||String(e)}`)})});x(!1);C.textContent="(No SVG exported yet)";(async()=>{u("Importing bundle...","pending");const e=await B(()=>import("./brep-kernel-Bj1tafeh.js"),__vite__mapDeps([0,1]));a("Bundle exports:",Object.keys(e));const{BREP:t}=e;if(!t)throw new Error("BREP export missing from bundle");u("Running kernel checks...","pending");const s=new t.Cube({x:2,y:3,z:4,name:"Cube"}),i=s.volume();a("Cube volume:",i);const l=new t.Sphere({r:1,resolution:24,name:"Sphere"}),d=l.getTriangleCount();a("Sphere triangles:",d);const f=s.union(l),z=f.volume();a("Union volume:",z),a("Union triangles:",f.getTriangleCount());const m=24,I=Math.abs(i-m)<1e-6;if(a("Cube volume check:",I?"OK":"FAIL","(expected",m,")"),!I)throw new Error(`Cube volume mismatch: ${i} vs ${m}`);u("Success: bundle + WASM OK","ok")})().catch(e=>{console.error(e),a("ERROR:",e&&(e.stack||e.message||String(e))),u("Failed: see log","err")});
|
package/dist/cad.html
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<script type="module" crossorigin src="/assets/PartHistory-DJNowO8n.js"></script>
|
|
20
20
|
<script type="module" crossorigin src="/assets/droppedWorkspaceFiles-8o-ZYOrf.js"></script>
|
|
21
21
|
<script type="module" crossorigin src="/assets/AnnotationRegistry-PNrk9ZTv.js"></script>
|
|
22
|
-
<script type="module" crossorigin src="/assets/main-cad-
|
|
22
|
+
<script type="module" crossorigin src="/assets/main-cad-B_iFo8MJ.js"></script>
|
|
23
23
|
<link rel="stylesheet" crossorigin href="/assets/main-cad-C3E_anfF.css">
|
|
24
24
|
</head>
|
|
25
25
|
|
package/dist/test.html
CHANGED
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
font-size: 13px;
|
|
168
168
|
}
|
|
169
169
|
</style>
|
|
170
|
-
<script type="module" crossorigin src="/assets/test-
|
|
170
|
+
<script type="module" crossorigin src="/assets/test-DTqZegA4.js"></script>
|
|
171
171
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-BdX5DvLD.js">
|
|
172
172
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-ZNr0Qq7Q.js">
|
|
173
173
|
</head>
|
package/dist/viewer.html
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<script type="module" crossorigin src="/assets/PartHistory-DJNowO8n.js"></script>
|
|
20
20
|
<script type="module" crossorigin src="/assets/droppedWorkspaceFiles-8o-ZYOrf.js"></script>
|
|
21
21
|
<script type="module" crossorigin src="/assets/AnnotationRegistry-PNrk9ZTv.js"></script>
|
|
22
|
-
<script type="module" crossorigin src="/assets/main-cad-
|
|
22
|
+
<script type="module" crossorigin src="/assets/main-cad-B_iFo8MJ.js"></script>
|
|
23
23
|
<link rel="stylesheet" crossorigin href="/assets/main-cad-C3E_anfF.css">
|
|
24
24
|
</head>
|
|
25
25
|
|
|
@@ -310546,46 +310546,46 @@ console.log('active history', viewer?.partHistory);
|
|
|
310546
310546
|
}
|
|
310547
310547
|
_ensureWindow() {
|
|
310548
310548
|
if (this.root) return;
|
|
310549
|
-
const A = new zw({
|
|
310549
|
+
const A = Number(window?.innerHeight) || 520, e = Math.max(320, Math.round(A * 0.95)), t = new zw({
|
|
310550
310550
|
title: "Script Runner",
|
|
310551
310551
|
width: 760,
|
|
310552
|
-
height:
|
|
310552
|
+
height: e,
|
|
310553
310553
|
right: 16,
|
|
310554
310554
|
top: 56,
|
|
310555
310555
|
shaded: !1,
|
|
310556
310556
|
onClose: /* @__PURE__ */ B(() => this.close(), "onClose")
|
|
310557
|
-
}),
|
|
310558
|
-
|
|
310559
|
-
const
|
|
310560
|
-
|
|
310557
|
+
}), i = document.createElement("button");
|
|
310558
|
+
i.className = "fw-btn", i.textContent = "Run", i.addEventListener("click", () => this._runCode());
|
|
310559
|
+
const s = document.createElement("button");
|
|
310560
|
+
s.className = "fw-btn", s.textContent = "Refresh env autocomplete", s.addEventListener("click", () => {
|
|
310561
310561
|
try {
|
|
310562
310562
|
this.editorEl?.refreshEnvAutocomplete?.(), this._setStatus("env autocomplete refreshed from window.env");
|
|
310563
310563
|
} catch {
|
|
310564
310564
|
this._setStatus("Unable to refresh env autocomplete");
|
|
310565
310565
|
}
|
|
310566
|
-
}),
|
|
310567
|
-
const i = document.createElement("div");
|
|
310568
|
-
i.style.display = "flex", i.style.flexDirection = "column", i.style.gap = "8px", i.style.width = "100%", i.style.height = "100%", i.style.boxSizing = "border-box", i.style.minHeight = "0", this.contentRoot = i;
|
|
310569
|
-
const s = document.createElement("div");
|
|
310570
|
-
s.textContent = "Run ad-hoc JavaScript with Monaco highlighting and live window.env autocomplete.", s.style.color = "#aeb6c5", s.style.font = '12px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace', s.style.opacity = "0.9", this.introEl = s;
|
|
310566
|
+
}), alert("hello world"), t.addHeaderAction(i), t.addHeaderAction(s);
|
|
310571
310567
|
const o = document.createElement("div");
|
|
310572
|
-
o.style.display = "flex", o.style.flexDirection = "column", o.style.
|
|
310573
|
-
const n = document.createElement("
|
|
310574
|
-
n.
|
|
310568
|
+
o.style.display = "flex", o.style.flexDirection = "column", o.style.gap = "8px", o.style.width = "100%", o.style.height = "100%", o.style.boxSizing = "border-box", o.style.minHeight = "0", this.contentRoot = o;
|
|
310569
|
+
const n = document.createElement("div");
|
|
310570
|
+
n.textContent = "Run ad-hoc JavaScript with Monaco highlighting and live window.env autocomplete.", n.style.color = "#aeb6c5", n.style.font = '12px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace', n.style.opacity = "0.9", this.introEl = n;
|
|
310575
310571
|
const I = document.createElement("div");
|
|
310576
|
-
I.style.
|
|
310577
|
-
const r = document.createElement("
|
|
310578
|
-
r.style.
|
|
310572
|
+
I.style.display = "flex", I.style.flexDirection = "column", I.style.flex = "1 1 60%", I.style.minHeight = "200px", I.style.minWidth = "0", I.style.position = "relative";
|
|
310573
|
+
const r = document.createElement("env-monaco-editor");
|
|
310574
|
+
r.style.position = "absolute", r.style.inset = "0", r.setAttribute("language", "javascript"), this._initializedValue || (r.value = EKi, this._initializedValue = !0);
|
|
310579
310575
|
const C = document.createElement("div");
|
|
310580
|
-
C.style.flex = "
|
|
310576
|
+
C.style.flex = "0 0 10px", C.style.height = "10px", C.style.cursor = "row-resize", C.style.background = "linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03))", C.style.border = "1px solid #1f2530", C.style.borderRadius = "8px", C.style.margin = "6px 0", C.style.position = "relative", C.style.zIndex = "2", C.addEventListener("pointerdown", (h) => this._onSplitterPointerDown(h));
|
|
310581
310577
|
const a = document.createElement("div");
|
|
310582
|
-
a.style.display = "flex", a.style.
|
|
310578
|
+
a.style.display = "flex", a.style.flexDirection = "column", a.style.flex = "0 0 180px", a.style.minHeight = "120px", a.style.maxHeight = "70vh", a.style.gap = "6px", a.style.position = "relative";
|
|
310583
310579
|
const Q = document.createElement("div");
|
|
310584
|
-
Q.style.flex = "1", Q.style.
|
|
310585
|
-
const E = document.createElement("
|
|
310586
|
-
E.
|
|
310587
|
-
|
|
310588
|
-
|
|
310580
|
+
Q.style.flex = "1 1 auto", Q.style.background = "#0e1117", Q.style.border = "1px solid #1f2530", Q.style.borderRadius = "8px", Q.style.padding = "8px", Q.style.overflowY = "auto", Q.style.overflowX = "hidden", Q.style.font = '12px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace', Q.style.color = "#d1d5db";
|
|
310581
|
+
const E = document.createElement("div");
|
|
310582
|
+
E.style.display = "flex", E.style.alignItems = "center", E.style.gap = "8px";
|
|
310583
|
+
const c = document.createElement("div");
|
|
310584
|
+
c.style.flex = "1", c.style.color = "#9ca3af", c.style.font = '12px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace', c.textContent = "Idle";
|
|
310585
|
+
const l = document.createElement("button");
|
|
310586
|
+
l.className = "fw-btn", l.textContent = "Clear output", l.addEventListener("click", () => {
|
|
310587
|
+
Q.innerHTML = "";
|
|
310588
|
+
}), E.appendChild(c), E.appendChild(l), o.appendChild(n), I.appendChild(r), o.appendChild(I), o.appendChild(C), a.appendChild(E), a.appendChild(Q), o.appendChild(a), t.content.appendChild(o), this.window = t, this.root = t.root, this.editorEl = r, this.editorWrap = I, this.outputEl = Q, this.consoleWrap = a, this.splitterEl = C, this.statusEl = c;
|
|
310589
310589
|
try {
|
|
310590
310590
|
this.root.style.display = "none";
|
|
310591
310591
|
} catch {
|
package/package.json
CHANGED
|
@@ -52,10 +52,12 @@ class ScriptRunnerPanel {
|
|
|
52
52
|
|
|
53
53
|
_ensureWindow() {
|
|
54
54
|
if (this.root) return;
|
|
55
|
+
const pageHeight = Number(window?.innerHeight) || 520;
|
|
56
|
+
const initialHeight = Math.max(320, Math.round(pageHeight * 0.95));
|
|
55
57
|
const fw = new FloatingWindow({
|
|
56
58
|
title: 'Script Runner',
|
|
57
59
|
width: 760,
|
|
58
|
-
height:
|
|
60
|
+
height: initialHeight,
|
|
59
61
|
right: 16,
|
|
60
62
|
top: 56,
|
|
61
63
|
shaded: false,
|
|
@@ -79,6 +81,8 @@ class ScriptRunnerPanel {
|
|
|
79
81
|
}
|
|
80
82
|
});
|
|
81
83
|
|
|
84
|
+
alert('hello world');
|
|
85
|
+
|
|
82
86
|
fw.addHeaderAction(btnRun);
|
|
83
87
|
fw.addHeaderAction(btnRefresh);
|
|
84
88
|
|