brep-io-kernel 1.0.124 → 1.0.125
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 +1 -0
- package/dist/about.html +1 -1
- 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-BdT113vr.js → apiExample_BREP_Booleans-CaQQgy2H.js} +1 -1
- package/dist/assets/{apiExample_BREP_Export-C7chlGmY.js → apiExample_BREP_Export-Cs8D0VUH.js} +1 -1
- package/dist/assets/{apiExample_BREP_Primitives-CtePkA3u.js → apiExample_BREP_Primitives-C6-e6HKF.js} +1 -1
- package/dist/assets/{apiExample_BREP_Transforms-1VByHLjg.js → apiExample_BREP_Transforms-Cam0Qma0.js} +1 -1
- package/dist/assets/{apiExample_Embeded_2D_Sketcher-BT79BpH3.js → apiExample_Embeded_2D_Sketcher-DhVNYCKA.js} +1 -1
- package/dist/assets/{apiExample_Embeded_CAD-BAIRn9Id.js → apiExample_Embeded_CAD-BmHAG6me.js} +2 -2
- package/dist/assets/{apiExample_Embeded_CAD_Integration_Test-DVzFfNxS.js → apiExample_Embeded_CAD_Integration_Test-BJXRpq4P.js} +1 -1
- package/dist/assets/{brep-kernel-C3aFegbl.js → brep-kernel-DmxeJi1G.js} +254 -253
- package/dist/assets/{browserTests-Ds-9QJmw.js → browserTests-BxC7NcgY.js} +1 -1
- package/dist/assets/{main-cad-CYqR2QeN.js → main-cad-D1IieGGy.js} +47 -46
- package/dist/assets/{test-VE_wuSZc.js → test-SRpWnlbu.js} +3 -3
- package/dist/cad.html +1 -1
- package/dist/help/CONTRIBUTING.html +1 -1
- package/dist/help/bug-reporting.html +611 -0
- package/dist/help/developer-index.html +1 -1
- package/dist/help/index.html +2 -1
- package/dist/help/search-index.json +12 -6
- package/dist/help/table-of-contents.html +1 -0
- package/dist/test.html +1 -1
- package/dist/viewer.html +1 -1
- package/dist-kernel/brep-kernel.js +6616 -6602
- package/dist-kernel/help/CONTRIBUTING.html +1 -1
- package/dist-kernel/help/bug-reporting.html +611 -0
- package/dist-kernel/help/developer-index.html +1 -1
- package/dist-kernel/help/index.html +2 -1
- package/dist-kernel/help/search-index.json +12 -6
- package/dist-kernel/help/table-of-contents.html +1 -0
- package/package.json +1 -1
- package/src/UI/toolbarButtons/historyTestSnippetButton.js +25 -1
- package/src/UI/toolbarButtons/registerDefaultButtons.js +1 -1
package/README.md
CHANGED
|
@@ -24,6 +24,7 @@ This project is in active development and APIs may continue to evolve.
|
|
|
24
24
|
General:
|
|
25
25
|
- [Getting Started](docs/getting-started.md)
|
|
26
26
|
- [Developer Docs Index](docs/developer-index.md)
|
|
27
|
+
- [Bug Reporting and Repro Test Cases](docs/bug-reporting.md)
|
|
27
28
|
- [Highlights](docs/highlights.md)
|
|
28
29
|
- [What's New](docs/whats-new.md)
|
|
29
30
|
- [API Examples](docs/api-examples.md)
|
package/dist/about.html
CHANGED
|
@@ -125,7 +125,7 @@ a{color:var(--accent);text-decoration:none} a:hover{text-decoration:underline}
|
|
|
125
125
|
<main>
|
|
126
126
|
<section class="card readme">
|
|
127
127
|
<div class="header"><h1>Project Overview</h1></div>
|
|
128
|
-
<div class="content prose"><h1><a href="https://BREP.io">BREP.io</a></h1><h1><a href="https://github.com/mmiscool/BREP">Source <a href="https://github.com/mmiscool/BREP" target="_blank" rel="noopener noreferrer">https://github.com/mmiscool/BREP</a></a></h1><ul><li><a href="https://www.npmjs.com/package/brep-io-kernel">NPM package: <code>brep-io-kernel</code> <a href="https://www.npmjs.com/package/brep-io-kernel" target="_blank" rel="noopener noreferrer">https://www.npmjs.com/package/brep-io-kernel</a></a></li><li><a href="https://BREP.io/apiExamples/index.html">Live API examples <a href="https://BREP.io/apiExamples/index.html" target="_blank" rel="noopener noreferrer">https://BREP.io/apiExamples/index.html</a></a></li></ul><p>BREP.io is a browser-based CAD application and JavaScript kernel for feature-based solid modeling. At its core is a BREP-style modeler with explicit geometry/topology objects such as <code>Solid</code>, <code>Face</code>, <code>Edge</code>, and <code>Vertex</code>, paired with an editable feature-history pipeline. It also includes sketch workflows powered by a standalone 2D constraint solver, plus robust manifold booleans (<a href="https://github.com/elalish/manifold">manifold-3d</a>), mesh repair/import tooling, assembly constraints, PMI annotations, and embeddable CAD/sketcher APIs.</p><p>This project is in active development and APIs may continue to evolve.</p><h2>Screenshots</h2><p><img src="docs__HOME.png" alt="Home" width="280" loading="lazy" /> <a href="docs__modes__modeling.html"><img src="docs__MODELING.png" alt="Modeling Mode" width="280" loading="lazy" /></a> <a href="docs__modes__sketch.html"><img src="docs__SKETCH.png" alt="Sketch Mode" width="280" loading="lazy" /></a> <a href="docs__modes__pmi.html"><img src="docs__PMI.png" alt="PMI Mode" width="280" loading="lazy" /></a> <a href="docs__features__image-to-face.html"><img src="docs__features__image-to-face-2D_dialog.png" alt="Image to Face 2D" width="280" loading="lazy" /></a> <a href="docs__features__image-to-face.html"><img src="docs__features__image-to-face-3D_dialog.png" alt="Image to Face 3D" width="280" loading="lazy" /></a></p><h2>Documentation Index</h2><p>General:</p><ul><li><a href="docs__getting-started.html">Getting Started</a></li><li><a href="docs__developer-index.html">Developer Docs Index</a></li><li><a href="docs__highlights.html">Highlights</a></li><li><a href="docs__whats-new.html">What's New</a></li><li><a href="docs__api-examples.html">API Examples</a></li></ul><p>Core APIs:</p><ul><li><a href="docs__brep-api.html">BREP API Export Map</a></li><li><a href="docs__brep-kernel.html">BREP Kernel Reference</a></li><li><a href="docs__solid-methods.html">Solid Methods</a></li><li><a href="docs__part-history.html">Part History</a></li><li><a href="docs__sketch-solver-2d.html">2D Sketch Solver</a></li><li><a href="docs__cad-embed.html">Embeddable CAD (<code>CadEmbed</code>)</a></li><li><a href="docs__sketcher2d-embed.html">Embeddable Sketcher (<code>Sketcher2DEmbed</code>)</a></li></ul><p>System docs:</p><ul><li><a href="docs__history-systems.html">History Systems</a></li><li><a href="docs__input-params-schema.html">Input Params Schema</a></li><li><a href="docs__file-formats.html">File Formats: Import and Export</a></li><li><a href="docs__plugins.html">Plugins and Examples</a></li><li><a href="docs__inspector.html">Inspector</a></li><li><a href="docs__inspector-improvements.html">Inspector Improvements</a></li></ul><p>Mode guides:</p><ul><li><a href="docs__modes__modeling.html">Modeling Mode</a></li><li><a href="docs__modes__sketch.html">Sketch Mode</a></li><li><a href="docs__modes__pmi.html">PMI Mode</a></li></ul><h2>Modeling Feature Docs</h2><p>Feature index:</p><ul><li><a href="docs__features__index.html">All Feature Docs</a></li></ul><p>Primitives and setup:</p><ul><li><a href="docs__features__primitive-cube.html">Primitive Cube</a></li><li><a href="docs__features__primitive-cylinder.html">Primitive Cylinder</a></li><li><a href="docs__features__primitive-cone.html">Primitive Cone</a></li><li><a href="docs__features__primitive-sphere.html">Primitive Sphere</a></li><li><a href="docs__features__primitive-torus.html">Primitive Torus</a></li><li><a href="docs__features__primitive-pyramid.html">Primitive Pyramid</a></li><li><a href="docs__features__plane.html">Plane</a></li><li><a href="docs__features__datum.html">Datum</a></li><li><a href="docs__features__datium.html">Datium</a></li><li><a href="docs__features__sketch.html">Sketch</a></li><li><a href="docs__features__spline.html">Spline</a></li><li><a href="docs__features__helix.html">Helix</a></li></ul><p>Solid operations:</p><ul><li><a href="docs__features__extrude.html">Extrude</a></li><li><a href="docs__features__sweep.html">Sweep</a></li><li><a href="docs__features__tube.html">Tube</a></li><li><a href="docs__features__loft.html">Loft</a></li><li><a href="docs__features__revolve.html">Revolve</a></li><li><a href="docs__features__mirror.html">Mirror</a></li><li><a href="docs__features__boolean.html">Boolean</a></li><li><a href="docs__features__fillet.html">Fillet</a></li><li><a href="docs__features__chamfer.html">Chamfer</a></li><li><a href="docs__features__hole.html">Hole</a></li><li><a href="docs__features__offset-shell.html">Offset Shell</a></li><li><a href="docs__features__remesh.html">Remesh</a></li><li><a href="docs__features__transform.html">Transform</a></li></ul><p>Pattern, import, and generation:</p><ul><li><a href="docs__features__pattern.html">Pattern (Legacy Combined)</a></li><li><a href="docs__features__pattern-linear.html">Pattern Linear</a></li><li><a href="docs__features__pattern-radial.html">Pattern Radial</a></li><li><a href="docs__features__import-3d-model.html">Import 3D Model</a></li><li><a href="docs__features__image-heightmap-solid.html">Image Heightmap Solid</a></li><li><a href="docs__features__image-to-face.html">Image to Face</a></li><li><a href="docs__features__text-to-face.html">Text to Face</a></li></ul><p>Assembly and sheet metal:</p><ul><li><a href="docs__features__assembly-component.html">Assembly Component</a></li><li><a href="docs__features__sheet-metal-tab.html">Sheet Metal Tab</a></li><li><a href="docs__features__sheet-metal-contour-flange.html">Sheet Metal Contour Flange</a></li><li><a href="docs__features__sheet-metal-flange.html">Sheet Metal Flange</a></li></ul><p>Additional implemented features in the codebase include collapse edge, edge smooth, offset face, overlap cleanup, sheet metal hem, and sheet metal cutout.</p><h2>Assembly Constraints</h2><ul><li><a href="docs__assembly-constraints__solver.html">Assembly Constraint Solver</a></li><li><a href="docs__assembly-constraints__coincident-constraint.html">Coincident</a></li><li><a href="docs__assembly-constraints__distance-constraint.html">Distance</a></li><li><a href="docs__assembly-constraints__angle-constraint.html">Angle</a></li><li><a href="docs__assembly-constraints__parallel-constraint.html">Parallel</a></li><li><a href="docs__assembly-constraints__touch-align-constraint.html">Touch Align</a></li><li><a href="docs__assembly-constraints__fixed-constraint.html">Fixed</a></li></ul><h2>PMI Annotation Docs</h2><ul><li><a href="docs__pmi-annotations__index.html">PMI Annotations Index</a></li><li><a href="docs__pmi-annotations__linear-dimension.html">Linear Dimension</a></li><li><a href="docs__pmi-annotations__radial-dimension.html">Radial Dimension</a></li><li><a href="docs__pmi-annotations__angle-dimension.html">Angle Dimension</a></li><li><a href="docs__pmi-annotations__leader.html">Leader</a></li><li><a href="docs__pmi-annotations__note.html">Note</a></li><li><a href="docs__pmi-annotations__hole-callout.html">Hole Callout</a></li><li><a href="docs__pmi-annotations__explode-body.html">Explode Body</a></li></ul><h2>Quick Start</h2><p>Prerequisites:</p><ul><li>Node.js 18+</li><li><code>pnpm</code></li></ul><p>Install and run locally:</p><div class="doc-codeblock" data-code-language="bash">
|
|
128
|
+
<div class="content prose"><h1><a href="https://BREP.io">BREP.io</a></h1><h1><a href="https://github.com/mmiscool/BREP">Source <a href="https://github.com/mmiscool/BREP" target="_blank" rel="noopener noreferrer">https://github.com/mmiscool/BREP</a></a></h1><ul><li><a href="https://www.npmjs.com/package/brep-io-kernel">NPM package: <code>brep-io-kernel</code> <a href="https://www.npmjs.com/package/brep-io-kernel" target="_blank" rel="noopener noreferrer">https://www.npmjs.com/package/brep-io-kernel</a></a></li><li><a href="https://BREP.io/apiExamples/index.html">Live API examples <a href="https://BREP.io/apiExamples/index.html" target="_blank" rel="noopener noreferrer">https://BREP.io/apiExamples/index.html</a></a></li></ul><p>BREP.io is a browser-based CAD application and JavaScript kernel for feature-based solid modeling. At its core is a BREP-style modeler with explicit geometry/topology objects such as <code>Solid</code>, <code>Face</code>, <code>Edge</code>, and <code>Vertex</code>, paired with an editable feature-history pipeline. It also includes sketch workflows powered by a standalone 2D constraint solver, plus robust manifold booleans (<a href="https://github.com/elalish/manifold">manifold-3d</a>), mesh repair/import tooling, assembly constraints, PMI annotations, and embeddable CAD/sketcher APIs.</p><p>This project is in active development and APIs may continue to evolve.</p><h2>Screenshots</h2><p><img src="docs__HOME.png" alt="Home" width="280" loading="lazy" /> <a href="docs__modes__modeling.html"><img src="docs__MODELING.png" alt="Modeling Mode" width="280" loading="lazy" /></a> <a href="docs__modes__sketch.html"><img src="docs__SKETCH.png" alt="Sketch Mode" width="280" loading="lazy" /></a> <a href="docs__modes__pmi.html"><img src="docs__PMI.png" alt="PMI Mode" width="280" loading="lazy" /></a> <a href="docs__features__image-to-face.html"><img src="docs__features__image-to-face-2D_dialog.png" alt="Image to Face 2D" width="280" loading="lazy" /></a> <a href="docs__features__image-to-face.html"><img src="docs__features__image-to-face-3D_dialog.png" alt="Image to Face 3D" width="280" loading="lazy" /></a></p><h2>Documentation Index</h2><p>General:</p><ul><li><a href="docs__getting-started.html">Getting Started</a></li><li><a href="docs__developer-index.html">Developer Docs Index</a></li><li><a href="docs__bug-reporting.html">Bug Reporting and Repro Test Cases</a></li><li><a href="docs__highlights.html">Highlights</a></li><li><a href="docs__whats-new.html">What's New</a></li><li><a href="docs__api-examples.html">API Examples</a></li></ul><p>Core APIs:</p><ul><li><a href="docs__brep-api.html">BREP API Export Map</a></li><li><a href="docs__brep-kernel.html">BREP Kernel Reference</a></li><li><a href="docs__solid-methods.html">Solid Methods</a></li><li><a href="docs__part-history.html">Part History</a></li><li><a href="docs__sketch-solver-2d.html">2D Sketch Solver</a></li><li><a href="docs__cad-embed.html">Embeddable CAD (<code>CadEmbed</code>)</a></li><li><a href="docs__sketcher2d-embed.html">Embeddable Sketcher (<code>Sketcher2DEmbed</code>)</a></li></ul><p>System docs:</p><ul><li><a href="docs__history-systems.html">History Systems</a></li><li><a href="docs__input-params-schema.html">Input Params Schema</a></li><li><a href="docs__file-formats.html">File Formats: Import and Export</a></li><li><a href="docs__plugins.html">Plugins and Examples</a></li><li><a href="docs__inspector.html">Inspector</a></li><li><a href="docs__inspector-improvements.html">Inspector Improvements</a></li></ul><p>Mode guides:</p><ul><li><a href="docs__modes__modeling.html">Modeling Mode</a></li><li><a href="docs__modes__sketch.html">Sketch Mode</a></li><li><a href="docs__modes__pmi.html">PMI Mode</a></li></ul><h2>Modeling Feature Docs</h2><p>Feature index:</p><ul><li><a href="docs__features__index.html">All Feature Docs</a></li></ul><p>Primitives and setup:</p><ul><li><a href="docs__features__primitive-cube.html">Primitive Cube</a></li><li><a href="docs__features__primitive-cylinder.html">Primitive Cylinder</a></li><li><a href="docs__features__primitive-cone.html">Primitive Cone</a></li><li><a href="docs__features__primitive-sphere.html">Primitive Sphere</a></li><li><a href="docs__features__primitive-torus.html">Primitive Torus</a></li><li><a href="docs__features__primitive-pyramid.html">Primitive Pyramid</a></li><li><a href="docs__features__plane.html">Plane</a></li><li><a href="docs__features__datum.html">Datum</a></li><li><a href="docs__features__datium.html">Datium</a></li><li><a href="docs__features__sketch.html">Sketch</a></li><li><a href="docs__features__spline.html">Spline</a></li><li><a href="docs__features__helix.html">Helix</a></li></ul><p>Solid operations:</p><ul><li><a href="docs__features__extrude.html">Extrude</a></li><li><a href="docs__features__sweep.html">Sweep</a></li><li><a href="docs__features__tube.html">Tube</a></li><li><a href="docs__features__loft.html">Loft</a></li><li><a href="docs__features__revolve.html">Revolve</a></li><li><a href="docs__features__mirror.html">Mirror</a></li><li><a href="docs__features__boolean.html">Boolean</a></li><li><a href="docs__features__fillet.html">Fillet</a></li><li><a href="docs__features__chamfer.html">Chamfer</a></li><li><a href="docs__features__hole.html">Hole</a></li><li><a href="docs__features__offset-shell.html">Offset Shell</a></li><li><a href="docs__features__remesh.html">Remesh</a></li><li><a href="docs__features__transform.html">Transform</a></li></ul><p>Pattern, import, and generation:</p><ul><li><a href="docs__features__pattern.html">Pattern (Legacy Combined)</a></li><li><a href="docs__features__pattern-linear.html">Pattern Linear</a></li><li><a href="docs__features__pattern-radial.html">Pattern Radial</a></li><li><a href="docs__features__import-3d-model.html">Import 3D Model</a></li><li><a href="docs__features__image-heightmap-solid.html">Image Heightmap Solid</a></li><li><a href="docs__features__image-to-face.html">Image to Face</a></li><li><a href="docs__features__text-to-face.html">Text to Face</a></li></ul><p>Assembly and sheet metal:</p><ul><li><a href="docs__features__assembly-component.html">Assembly Component</a></li><li><a href="docs__features__sheet-metal-tab.html">Sheet Metal Tab</a></li><li><a href="docs__features__sheet-metal-contour-flange.html">Sheet Metal Contour Flange</a></li><li><a href="docs__features__sheet-metal-flange.html">Sheet Metal Flange</a></li></ul><p>Additional implemented features in the codebase include collapse edge, edge smooth, offset face, overlap cleanup, sheet metal hem, and sheet metal cutout.</p><h2>Assembly Constraints</h2><ul><li><a href="docs__assembly-constraints__solver.html">Assembly Constraint Solver</a></li><li><a href="docs__assembly-constraints__coincident-constraint.html">Coincident</a></li><li><a href="docs__assembly-constraints__distance-constraint.html">Distance</a></li><li><a href="docs__assembly-constraints__angle-constraint.html">Angle</a></li><li><a href="docs__assembly-constraints__parallel-constraint.html">Parallel</a></li><li><a href="docs__assembly-constraints__touch-align-constraint.html">Touch Align</a></li><li><a href="docs__assembly-constraints__fixed-constraint.html">Fixed</a></li></ul><h2>PMI Annotation Docs</h2><ul><li><a href="docs__pmi-annotations__index.html">PMI Annotations Index</a></li><li><a href="docs__pmi-annotations__linear-dimension.html">Linear Dimension</a></li><li><a href="docs__pmi-annotations__radial-dimension.html">Radial Dimension</a></li><li><a href="docs__pmi-annotations__angle-dimension.html">Angle Dimension</a></li><li><a href="docs__pmi-annotations__leader.html">Leader</a></li><li><a href="docs__pmi-annotations__note.html">Note</a></li><li><a href="docs__pmi-annotations__hole-callout.html">Hole Callout</a></li><li><a href="docs__pmi-annotations__explode-body.html">Explode Body</a></li></ul><h2>Quick Start</h2><p>Prerequisites:</p><ul><li>Node.js 18+</li><li><code>pnpm</code></li></ul><p>Install and run locally:</p><div class="doc-codeblock" data-code-language="bash">
|
|
129
129
|
<div class="doc-codeblock-header">
|
|
130
130
|
<span class="doc-codeblock-lang">bash</span>
|
|
131
131
|
<button type="button" class="doc-codeblock-copy" data-copy-code aria-label="Copy code" title="Copy code">
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
7
7
|
<title>BREP API Example: Booleans</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/apiExample_BREP_Booleans-
|
|
8
|
+
<script type="module" crossorigin src="/assets/apiExample_BREP_Booleans-CaQQgy2H.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-BdX5DvLD.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-ZNr0Qq7Q.js">
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/brep-kernel-
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/brep-kernel-DmxeJi1G.js">
|
|
12
12
|
<link rel="stylesheet" crossorigin href="/assets/example-CoxINuWK.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
7
7
|
<title>BREP API Example: Export</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/apiExample_BREP_Export-
|
|
8
|
+
<script type="module" crossorigin src="/assets/apiExample_BREP_Export-Cs8D0VUH.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-BdX5DvLD.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-ZNr0Qq7Q.js">
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/brep-kernel-
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/brep-kernel-DmxeJi1G.js">
|
|
12
12
|
<link rel="stylesheet" crossorigin href="/assets/example-CoxINuWK.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
7
7
|
<title>BREP API Example: Primitives</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/apiExample_BREP_Primitives-
|
|
8
|
+
<script type="module" crossorigin src="/assets/apiExample_BREP_Primitives-C6-e6HKF.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-BdX5DvLD.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-ZNr0Qq7Q.js">
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/brep-kernel-
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/brep-kernel-DmxeJi1G.js">
|
|
12
12
|
<link rel="stylesheet" crossorigin href="/assets/example-CoxINuWK.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
7
7
|
<title>BREP API Example: Transforms</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/apiExample_BREP_Transforms-
|
|
8
|
+
<script type="module" crossorigin src="/assets/apiExample_BREP_Transforms-Cam0Qma0.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-BdX5DvLD.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-ZNr0Qq7Q.js">
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/brep-kernel-
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/brep-kernel-DmxeJi1G.js">
|
|
12
12
|
<link rel="stylesheet" crossorigin href="/assets/example-CoxINuWK.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
7
7
|
<title>BREP API Example: Embeded 2D Sketcher</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/apiExample_Embeded_2D_Sketcher-
|
|
8
|
+
<script type="module" crossorigin src="/assets/apiExample_Embeded_2D_Sketcher-DhVNYCKA.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-BdX5DvLD.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-ZNr0Qq7Q.js">
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/brep-kernel-
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/brep-kernel-DmxeJi1G.js">
|
|
12
12
|
<link rel="stylesheet" crossorigin href="/assets/example-CoxINuWK.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
background: #fff;
|
|
32
32
|
}
|
|
33
33
|
</style>
|
|
34
|
-
<script type="module" crossorigin src="/assets/apiExample_Embeded_CAD-
|
|
34
|
+
<script type="module" crossorigin src="/assets/apiExample_Embeded_CAD-BmHAG6me.js"></script>
|
|
35
35
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-BdX5DvLD.js">
|
|
36
36
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-ZNr0Qq7Q.js">
|
|
37
|
-
<link rel="modulepreload" crossorigin href="/assets/brep-kernel-
|
|
37
|
+
<link rel="modulepreload" crossorigin href="/assets/brep-kernel-DmxeJi1G.js">
|
|
38
38
|
<link rel="stylesheet" crossorigin href="/assets/example-CoxINuWK.css">
|
|
39
39
|
</head>
|
|
40
40
|
<body>
|
|
@@ -92,10 +92,10 @@
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
</style>
|
|
95
|
-
<script type="module" crossorigin src="/assets/apiExample_Embeded_CAD_Integration_Test-
|
|
95
|
+
<script type="module" crossorigin src="/assets/apiExample_Embeded_CAD_Integration_Test-BJXRpq4P.js"></script>
|
|
96
96
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-BdX5DvLD.js">
|
|
97
97
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-ZNr0Qq7Q.js">
|
|
98
|
-
<link rel="modulepreload" crossorigin href="/assets/brep-kernel-
|
|
98
|
+
<link rel="modulepreload" crossorigin href="/assets/brep-kernel-DmxeJi1G.js">
|
|
99
99
|
<link rel="stylesheet" crossorigin href="/assets/example-CoxINuWK.css">
|
|
100
100
|
</head>
|
|
101
101
|
<body>
|
package/dist/assets/{apiExample_BREP_Booleans-BdT113vr.js → apiExample_BREP_Booleans-CaQQgy2H.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var E=Object.defineProperty;var o=(e,t)=>E(e,"name",{value:t,configurable:!0});import"./modulepreload-polyfill-BdX5DvLD.js";/* empty css */import{BREP as i}from"./brep-kernel-
|
|
1
|
+
var E=Object.defineProperty;var o=(e,t)=>E(e,"name",{value:t,configurable:!0});import"./modulepreload-polyfill-BdX5DvLD.js";/* empty css */import{BREP as i}from"./brep-kernel-DmxeJi1G.js";import"./preload-helper-ZNr0Qq7Q.js";const m=document.getElementById("status"),b=document.getElementById("log"),f=document.getElementById("btn-run"),c=o((e,t)=>{m.textContent=e,m.className=`status ${t}`},"setStatus"),g=o(e=>Number(e).toFixed(6),"fmt"),u=o((...e)=>{const t=e.map(r=>typeof r=="string"?r:JSON.stringify(r)).join(" ");b.textContent+=`${t}
|
|
2
2
|
`,console.log(...e)},"write"),s=o(e=>({volume:e.volume(),surfaceArea:e.surfaceArea(),triangles:e.getTriangleCount()}),"summarize"),d=o(()=>{b.textContent="",c("Running...","pending");const e=new i.Cube({x:2.2,y:2.2,z:2.2,name:"Cube"}),t=new i.Sphere({r:1.35,resolution:40,name:"Sphere"}),r=e.union(t),h=e.subtract(t),p=e.intersect(t),n={cube:s(e),sphere:s(t),union:s(r),subtract:s(h),intersect:s(p)};u("--- Boolean Results ---");for(const[v,l]of Object.entries(n))u(`${v.padEnd(10)} volume=${g(l.volume)} area=${g(l.surfaceArea)} triangles=${l.triangles}`);const a=1e-6;if(n.union.volume+a<Math.max(n.cube.volume,n.sphere.volume))throw new Error("Union volume is unexpectedly smaller than both source solids.");if(n.intersect.volume-a>Math.min(n.cube.volume,n.sphere.volume))throw new Error("Intersection volume is unexpectedly larger than a source solid.");if(n.subtract.volume-a>n.cube.volume)throw new Error("Subtract volume is unexpectedly larger than the original cube.");c("Completed","ok")},"runExample");f.addEventListener("click",()=>{try{d()}catch(e){console.error(e),u("ERROR:",e?.stack||e?.message||String(e)),c("Failed","err")}});try{d()}catch(e){console.error(e),u("ERROR:",e?.stack||e?.message||String(e)),c("Failed","err")}
|
package/dist/assets/{apiExample_BREP_Export-C7chlGmY.js → apiExample_BREP_Export-Cs8D0VUH.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var g=Object.defineProperty;var r=(t,n)=>g(t,"name",{value:n,configurable:!0});import"./modulepreload-polyfill-BdX5DvLD.js";/* empty css */import{BREP as c}from"./brep-kernel-
|
|
1
|
+
var g=Object.defineProperty;var r=(t,n)=>g(t,"name",{value:n,configurable:!0});import"./modulepreload-polyfill-BdX5DvLD.js";/* empty css */import{BREP as c}from"./brep-kernel-DmxeJi1G.js";import"./preload-helper-ZNr0Qq7Q.js";const l=document.getElementById("status"),d=document.getElementById("log"),p=document.getElementById("btn-run"),s=r((t,n)=>{l.textContent=t,l.className=`status ${n}`},"setStatus"),e=r((...t)=>{const n=t.map(o=>typeof o=="string"?o:JSON.stringify(o)).join(" ");d.textContent+=`${n}
|
|
2
2
|
`,console.log(...t)},"write"),u=r((t,n=8)=>t.split(`
|
|
3
3
|
`).slice(0,n).join(`
|
|
4
4
|
`),"firstLines"),m=r(()=>{d.textContent="",s("Running...","pending");const t=new c.Cylinder({radius:1,height:3,resolution:48,name:"Shaft"}).bakeTRS({position:[0,0,.6],rotationEuler:[90,0,0],scale:[1,1,1]}),n=new c.Cone({radius:1.55,height:1.6,resolution:48,name:"Head"}).bakeTRS({position:[0,1.65,.6],rotationEuler:[-90,0,0],scale:[1,1,1]}),o=t.union(n),i=o.toSTL("api_example_part",4),a=o.toSTEP("api_example_part",{precision:4});if(e("--- Export Summary ---"),e("Volume:",o.volume()),e("Surface area:",o.surfaceArea()),e("Triangles:",o.getTriangleCount()),e("STL characters:",i.length),e("STEP characters:",a.length),e(""),e("--- STL Preview ---"),e(u(i)),e(""),e("--- STEP Preview ---"),e(u(a)),!i.startsWith("solid"))throw new Error('STL output did not start with "solid".');if(!a.includes("ISO-10303-21"))throw new Error("STEP output did not contain expected ISO header.");s("Completed","ok")},"runExample");p.addEventListener("click",()=>{try{m()}catch(t){console.error(t),e("ERROR:",t?.stack||t?.message||String(t)),s("Failed","err")}});try{m()}catch(t){console.error(t),e("ERROR:",t?.stack||t?.message||String(t)),s("Failed","err")}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var g=Object.defineProperty;var n=(e,t)=>g(e,"name",{value:t,configurable:!0});import"./modulepreload-polyfill-BdX5DvLD.js";/* empty css */import{BREP as o}from"./brep-kernel-
|
|
1
|
+
var g=Object.defineProperty;var n=(e,t)=>g(e,"name",{value:t,configurable:!0});import"./modulepreload-polyfill-BdX5DvLD.js";/* empty css */import{BREP as o}from"./brep-kernel-DmxeJi1G.js";import"./preload-helper-ZNr0Qq7Q.js";const m=document.getElementById("status"),u=document.getElementById("log"),y=document.getElementById("btn-run"),s=n((e,t)=>{m.textContent=e,m.className=`status ${t}`},"setStatus"),l=n(e=>Number(e).toFixed(6),"fmt"),a=n((...e)=>{const t=e.map(r=>typeof r=="string"?r:JSON.stringify(r)).join(" ");u.textContent+=`${t}
|
|
2
2
|
`,console.log(...e)},"write"),C=n(e=>({volume:e.volume(),area:e.surfaceArea(),triangles:e.getTriangleCount()}),"summarize"),c=n(()=>{u.textContent="",s("Running...","pending");const e=[["Cube",()=>new o.Cube({x:2,y:3,z:4,name:"Cube"})],["Sphere",()=>new o.Sphere({r:1.2,resolution:32,name:"Sphere"})],["Cylinder",()=>new o.Cylinder({radius:1,height:2.4,resolution:48,name:"Cylinder"})],["Cone",()=>new o.Cone({radius:1.1,height:2.1,resolution:48,name:"Cone"})],["Torus",()=>new o.Torus({mR:2,tR:.55,resolution:64,name:"Torus"})],["Pyramid",()=>new o.Pyramid({bL:2,s:4,h:2.7,name:"Pyramid"})]];a("--- Primitive Summary ---");for(const[t,r]of e){const d=r(),i=C(d);a(`${t.padEnd(10)} volume=${l(i.volume)} area=${l(i.area)} triangles=${i.triangles}`)}s("Completed","ok")},"runExample");y.addEventListener("click",()=>{try{c()}catch(e){console.error(e),a("ERROR:",e?.stack||e?.message||String(e)),s("Failed","err")}});try{c()}catch(e){console.error(e),a("ERROR:",e?.stack||e?.message||String(e)),s("Failed","err")}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var u=Object.defineProperty;var n=(e,t)=>u(e,"name",{value:t,configurable:!0});import"./modulepreload-polyfill-BdX5DvLD.js";/* empty css */import{BREP as g}from"./brep-kernel-
|
|
1
|
+
var u=Object.defineProperty;var n=(e,t)=>u(e,"name",{value:t,configurable:!0});import"./modulepreload-polyfill-BdX5DvLD.js";/* empty css */import{BREP as g}from"./brep-kernel-DmxeJi1G.js";import"./preload-helper-ZNr0Qq7Q.js";const c=document.getElementById("status"),l=document.getElementById("log"),b=document.getElementById("btn-run"),s=n((e,t)=>{c.textContent=e,c.className=`status ${t}`},"setStatus"),i=n(e=>Number(e).toFixed(6),"fmt"),m=n((...e)=>{const t=e.map(o=>typeof o=="string"?o:JSON.stringify(o)).join(" ");l.textContent+=`${t}
|
|
2
2
|
`,console.log(...e)},"write"),r=n((e,t)=>{m(`${e.padEnd(16)} volume=${i(t.volume())} area=${i(t.surfaceArea())} triangles=${t.getTriangleCount()}`)},"describe"),d=n(()=>{l.textContent="",s("Running...","pending");const e=new g.Cube({x:2.2,y:1.4,z:1,name:"BaseCube"}),t=e.clone().bakeTRS({position:[2,.4,.3],rotationEuler:[0,35,20],scale:[1.1,.85,1.25]}),o=t.mirrorAcrossPlane([0,0,0],[1,0,0]),a=t.union(o);if(m("--- Transform Summary ---"),r("base",e),r("moved",t),r("mirrored",o),r("combined",a),a.volume()<=t.volume())throw new Error("Combined solid volume should be greater than a single moved solid.");s("Completed","ok")},"runExample");b.addEventListener("click",()=>{try{d()}catch(e){console.error(e),m("ERROR:",e?.stack||e?.message||String(e)),s("Failed","err")}});try{d()}catch(e){console.error(e),m("ERROR:",e?.stack||e?.message||String(e)),s("Failed","err")}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var H=Object.defineProperty;var s=(e,o)=>H(e,"name",{value:o,configurable:!0});import"./modulepreload-polyfill-BdX5DvLD.js";/* empty css */import{Sketcher2DEmbed as J}from"./brep-kernel-
|
|
1
|
+
var H=Object.defineProperty;var s=(e,o)=>H(e,"name",{value:o,configurable:!0});import"./modulepreload-polyfill-BdX5DvLD.js";/* empty css */import{Sketcher2DEmbed as J}from"./brep-kernel-DmxeJi1G.js";import"./preload-helper-ZNr0Qq7Q.js";const k=document.getElementById("btn-create"),C=document.getElementById("btn-destroy"),I=document.getElementById("btn-apply-css"),w=document.getElementById("btn-apply-theme"),B=document.getElementById("btn-export-svg"),$=document.getElementById("btn-export-dxf"),r=document.getElementById("btn-download-dxf"),D=document.getElementById("btn-export-polylines"),F=document.getElementById("geometry-color"),L=document.getElementById("point-color"),N=document.getElementById("constraint-color"),G=document.getElementById("background-color"),T=document.getElementById("point-size-px"),A=document.getElementById("curve-thickness-px"),f=document.getElementById("sidebar-expanded"),u=document.getElementById("grid-visible"),V=document.getElementById("grid-spacing"),W=document.getElementById("curve-resolution"),R=document.getElementById("css-input"),Y=document.getElementById("sketch-status"),q=document.getElementById("sketch-host"),d=document.getElementById("event-output"),g=document.getElementById("svg-preview"),O=document.getElementById("path-output"),P=document.getElementById("dxf-output"),M=document.getElementById("polyline-output");let t=null,i=null,m=0,h=0,y=0,c=null;const K=6,n=s(e=>{Y.textContent=e},"setSketchStatus"),b=s(()=>{c&&(URL.revokeObjectURL(c),c=null)},"revokeDxfDownload"),Q=s(e=>{if(b(),typeof e!="string"||!e.length){r.disabled=!0;return}const o=new Blob([e],{type:"application/dxf"});c=URL.createObjectURL(o),r.disabled=!1},"setDxfDownload"),E=s(e=>{k.disabled=e,C.disabled=!e,I.disabled=!e,w.disabled=!e,B.disabled=!e,$.disabled=!e,D.disabled=!e,r.disabled=!e||!c},"setSketchButtons"),p=s((e,o=null)=>{const a=new Date().toLocaleTimeString(),j=o==null?`[${a}] ${e}`:`[${a}] ${e} ${JSON.stringify(o)}`,z=d.textContent==="(No sketch events yet)"?[]:d.textContent.split(`
|
|
2
2
|
`).filter(Boolean),S=[j,...z].slice(0,K);d.textContent=S.length?S.join(`
|
|
3
3
|
`):"(No sketch events yet)"},"pushEvent"),U=s(()=>({geometryColor:F.value,pointColor:L.value,constraintColor:N.value,backgroundColor:G.value,pointSizePx:Math.max(1,Number(T.value)||10),curveThicknessPx:Math.max(.5,Number(A.value)||2)}),"currentTheme"),x=s(()=>{const e=Number(V.value);return Number.isFinite(e)&&e>0?e:1},"currentGridSpacing"),v=s(()=>{const e=Number(W.value);return Number.isFinite(e)?Math.max(3,Math.min(2048,Math.floor(e))):64},"currentCurveResolution"),Z=s(async()=>{t||(t=new J({cssText:R.value,...U(),sidebarExpanded:f.checked,gridVisible:u.checked,gridSpacing:x(),onChange:s(e=>{i=e,m+=1;const o=Array.isArray(e?.geometries)?e.geometries.length:0;n(`Sketch updated (${m}). Geometries: ${o}`),p("onChange",{geometries:o})},"onChange"),onFinished:s(e=>{i=e,h+=1;const o=Array.isArray(e?.geometries)?e.geometries.length:0;n(`Sketch finished (${h}). Geometries: ${o}`),p("onFinished",{geometries:o}),X().catch(a=>{console.error(a),n(`Failed to export SVG after Finish: ${a?.message||String(a)}`)})},"onFinished"),onCancelled:s(()=>{y+=1,n(`Sketch cancelled (${y}).`),p("onCancelled")},"onCancelled")}),await t.mount(q),i=await t.getSketch(),E(!0),n("Sketcher iframe mounted. Draw geometry and run any export action."))},"attachSketcher"),_=s(async()=>{t&&(await t.destroy(),t=null,i=null,m=0,h=0,y=0,E(!1),n("Sketcher destroyed."),d.textContent="(No sketch events yet)",g.innerHTML="",O.textContent="(No SVG exported yet)",P.textContent="(No DXF exported yet)",M.textContent="(No 3D polylines exported yet)",b())},"detachSketcher"),ee=s(async()=>{t&&(await t.setCss(R.value),n("Custom CSS applied to iframe."))},"applySketchCss"),l=s(async()=>{t&&(await t.setTheme(U()),await t.setSidebarExpanded(f.checked),typeof t.setGrid=="function"?await t.setGrid({visible:u.checked,spacing:x()}):(typeof t.setGridVisible=="function"&&await t.setGridVisible(u.checked),typeof t.setGridSpacing=="function"&&await t.setGridSpacing(x())),n("Theme + sidebar + grid state applied to iframe."))},"applySketchTheme"),X=s(async()=>{if(!t)return;const e=await t.exportSVG({flipY:!0,precision:3,stroke:"#111111",strokeWidth:1.5,fill:"none",padding:12,curveResolution:v()});i=await t.getSketch({preferCached:!0}),g.innerHTML=e.svg,O.textContent=e.paths.length?e.paths.map(o=>`id=${o.id} type=${o.type} d="${o.d}"`).join(`
|
|
4
4
|
`):"(No sketch geometry to export)",n(`Exported ${e.paths.length} SVG paths.`),g.scrollIntoView({behavior:"smooth",block:"start"})},"exportSvg"),te=s(async()=>{if(!t)return;const e=await t.exportDXF({units:"mm",curveResolution:v(),includeConstruction:!1});P.textContent=e?.dxf||"(No DXF payload returned)",Q(e?.dxf||""),n(`Exported DXF with ${e?.polylines?.length||0} polylines.`)},"exportDxf"),ne=s(async()=>{if(!t)return;const e=await t.export3DPolylines({curveResolution:v(),includeConstruction:!1,origin:[0,0,0],xAxis:[1,0,0],yAxis:[0,1,0]});M.textContent=JSON.stringify(e,null,2),n(`Exported ${e?.polylines?.length||0} 3D polylines.`)},"export3DPolylines");k.addEventListener("click",()=>{Z().catch(e=>{console.error(e),n(`Failed to create sketcher: ${e?.message||String(e)}`)})});C.addEventListener("click",()=>{_().catch(e=>{console.error(e),n(`Failed to destroy sketcher: ${e?.message||String(e)}`)})});I.addEventListener("click",()=>{ee().catch(e=>{console.error(e),n(`Failed to apply CSS: ${e?.message||String(e)}`)})});w.addEventListener("click",()=>{l().catch(e=>{console.error(e),n(`Failed to apply theme: ${e?.message||String(e)}`)})});B.addEventListener("click",()=>{X().catch(e=>{console.error(e),n(`Failed to export SVG: ${e?.message||String(e)}`)})});$.addEventListener("click",()=>{te().catch(e=>{console.error(e),n(`Failed to export DXF: ${e?.message||String(e)}`)})});r.addEventListener("click",()=>{if(!c)return;const e=document.createElement("a");e.href=c,e.download="sketch-export.dxf",e.click()});D.addEventListener("click",()=>{ne().catch(e=>{console.error(e),n(`Failed to export 3D polylines: ${e?.message||String(e)}`)})});[F,L,N,G,T,A].forEach(e=>{e.addEventListener("input",()=>{t&&l().catch(o=>{console.error(o),n(`Failed to apply theme: ${o?.message||String(o)}`)})})});f.addEventListener("change",()=>{t&&l().catch(e=>{console.error(e),n(`Failed to apply sidebar state: ${e?.message||String(e)}`)})});u.addEventListener("change",()=>{t&&l().catch(e=>{console.error(e),n(`Failed to apply grid visibility: ${e?.message||String(e)}`)})});V.addEventListener("input",()=>{t&&l().catch(e=>{console.error(e),n(`Failed to apply grid spacing: ${e?.message||String(e)}`)})});window.addEventListener("beforeunload",()=>{t&&t.destroy().catch(()=>{}),b()});E(!1);i&&!Array.isArray(i?.geometries)&&console.warn("Unexpected sketch payload shape",i);
|
package/dist/assets/{apiExample_Embeded_CAD-BAIRn9Id.js → apiExample_Embeded_CAD-BmHAG6me.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var
|
|
1
|
+
var B=Object.defineProperty;var n=(t,o)=>B(t,"name",{value:o,configurable:!0});import"./modulepreload-polyfill-BdX5DvLD.js";/* empty css */import{CADEmbed as v}from"./brep-kernel-DmxeJi1G.js";import"./preload-helper-ZNr0Qq7Q.js";const u=document.getElementById("btn-create"),y=document.getElementById("btn-destroy"),p=document.getElementById("btn-state"),g=document.getElementById("btn-history"),b=document.getElementById("btn-sample"),E=document.getElementById("btn-reset"),h=document.getElementById("btn-css"),S=document.getElementById("viewer-only"),i=document.getElementById("sidebar-expanded"),x=document.getElementById("model-path"),w=document.getElementById("model-source"),$=document.getElementById("model-repo"),k=document.getElementById("model-branch"),C=document.getElementById("css-input"),F=document.getElementById("cad-status"),H=document.getElementById("cad-host"),I=document.getElementById("state-output"),f=document.getElementById("history-output");let e=null;const D={features:[{type:"Primitive Cube",inputParams:{id:"sample_cube_1",sizeX:24,sizeY:18,sizeZ:14,transform:{position:[0,0,0],rotationEuler:[0,0,0],scale:[1,1,1]},boolean:{targets:[],operation:"NONE"}},persistentData:{},timestamp:null}],idCounter:1,expressions:`//Examples:
|
|
2
2
|
x = 10 + 6;
|
|
3
|
-
y = x * 2;`,pmiViews:[],metadata:{},assemblyConstraints:[],assemblyConstraintIdCounter:0},s=n(t=>{F.textContent=t},"setStatus"),r=n(t=>{u.disabled=t,y.disabled=!t,p.disabled=!t,g.disabled=!t,b.disabled=!t,E.disabled=!t,h.disabled=!t,S.disabled=t},"setButtons"),L=n(()=>{const t=String(x.value||"").trim();if(!t)return null;const o=String(w.value||"local").trim()||"local",a=String($.value||"").trim(),d=String(k.value||"").trim(),l={modelPath:t,source:o};return a&&(l.repoFull=a),d&&(l.branch=d),l},"currentModelRequest"),c=n((t,o="State updated")=>{I.textContent=JSON.stringify(t||{},null,2);const a=Number(t?.featureCount||0),d=t?.model?.name||"(unsaved/new)";s(`${o}. Features: ${a}. Model: ${d}`)},"renderState"),N=n(async()=>{if(e)return;const t=L();e=new
|
|
3
|
+
y = x * 2;`,pmiViews:[],metadata:{},assemblyConstraints:[],assemblyConstraintIdCounter:0},s=n(t=>{F.textContent=t},"setStatus"),r=n(t=>{u.disabled=t,y.disabled=!t,p.disabled=!t,g.disabled=!t,b.disabled=!t,E.disabled=!t,h.disabled=!t,S.disabled=t},"setButtons"),L=n(()=>{const t=String(x.value||"").trim();if(!t)return null;const o=String(w.value||"local").trim()||"local",a=String($.value||"").trim(),d=String(k.value||"").trim(),l={modelPath:t,source:o};return a&&(l.repoFull=a),d&&(l.branch=d),l},"currentModelRequest"),c=n((t,o="State updated")=>{I.textContent=JSON.stringify(t||{},null,2);const a=Number(t?.featureCount||0),d=t?.model?.name||"(unsaved/new)";s(`${o}. Features: ${a}. Model: ${d}`)},"renderState"),N=n(async()=>{if(e)return;const t=L();e=new v({mountTo:H,viewerOnlyMode:S.checked,sidebarExpanded:i.checked,cssText:C.value,initialModel:t,onReady:n(a=>{c(a,"CAD ready")},"onReady"),onHistoryChanged:n(a=>{c(a,`History changed (${a?.reason||"update"})`)},"onHistoryChanged")}),await e.mount(),r(!0);const o=await e.getState();c(o,"CAD iframe mounted")},"createCad"),O=n(async()=>{e&&(await e.destroy(),e=null,r(!1),s("CAD iframe destroyed."),I.textContent="(No state yet)",f.textContent="(No history exported yet)")},"destroyCad"),m=n(async()=>{if(!e)return;const t=await e.getState();c(t,"State fetched")},"refreshState"),A=n(async()=>{if(!e)return;const t=await e.getPartHistoryJSON();f.textContent=t||"(History is empty)",s(`History exported (${t?t.length:0} chars).`)},"exportHistory"),M=n(async()=>{e&&(await e.setPartHistory(D),await m(),s("Sample cube history loaded."))},"loadSampleCube"),P=n(async()=>{e&&(await e.reset(),await m(),s("Model reset complete."))},"resetModel"),R=n(async()=>{e&&(await e.setCss(C.value),await e.setSidebarExpanded(i.checked),s("Custom CSS and sidebar state applied."))},"applyCss");u.addEventListener("click",()=>{N().catch(t=>{console.error(t),s(`Failed to create CAD iframe: ${t?.message||String(t)}`)})});y.addEventListener("click",()=>{O().catch(t=>{console.error(t),s(`Failed to destroy CAD iframe: ${t?.message||String(t)}`)})});p.addEventListener("click",()=>{m().catch(t=>{console.error(t),s(`Failed to get state: ${t?.message||String(t)}`)})});g.addEventListener("click",()=>{A().catch(t=>{console.error(t),s(`Failed to export history: ${t?.message||String(t)}`)})});b.addEventListener("click",()=>{M().catch(t=>{console.error(t),s(`Failed to load sample history: ${t?.message||String(t)}`)})});E.addEventListener("click",()=>{P().catch(t=>{console.error(t),s(`Failed to reset model: ${t?.message||String(t)}`)})});h.addEventListener("click",()=>{R().catch(t=>{console.error(t),s(`Failed to apply CSS: ${t?.message||String(t)}`)})});i.addEventListener("change",()=>{e&&e.setSidebarExpanded(i.checked).catch(t=>{console.error(t),s(`Failed to set sidebar state: ${t?.message||String(t)}`)})});r(!1);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var O=Object.defineProperty;var i=(t,s)=>O(t,"name",{value:s,configurable:!0});import"./modulepreload-polyfill-BdX5DvLD.js";/* empty css */import{CADEmbed as S}from"./brep-kernel-
|
|
1
|
+
var O=Object.defineProperty;var i=(t,s)=>O(t,"name",{value:s,configurable:!0});import"./modulepreload-polyfill-BdX5DvLD.js";/* empty css */import{CADEmbed as S}from"./brep-kernel-DmxeJi1G.js";import"./preload-helper-ZNr0Qq7Q.js";const h=document.getElementById("btn-run"),u=document.getElementById("btn-destroy"),P=document.getElementById("viewer-only"),H=document.getElementById("sidebar-expanded"),M=document.getElementById("model-path"),A=document.getElementById("model-source"),j=document.getElementById("model-repo"),B=document.getElementById("model-branch"),x=document.getElementById("css-input"),R=document.getElementById("run-status"),$=document.getElementById("cad-host"),C=document.getElementById("results"),g=document.getElementById("log-output");let n=null,w=!1;const v={features:[{type:"Primitive Cube",inputParams:{id:"integration_sample_cube_1",sizeX:16,sizeY:12,sizeZ:10,transform:{position:[0,0,0],rotationEuler:[0,0,0],scale:[1,1,1]},boolean:{targets:[],operation:"NONE"}},persistentData:{},timestamp:null}],idCounter:1,expressions:`//Examples:
|
|
2
2
|
x = 10 + 6;
|
|
3
3
|
y = x * 2;`,pmiViews:[],metadata:{},assemblyConstraints:[],assemblyConstraintIdCounter:0};function l(t){const a=`[${new Date().toLocaleTimeString()}] ${t}`,o=g.textContent==="(No logs yet)"?[]:g.textContent.split(`
|
|
4
4
|
`).filter(Boolean);o.unshift(a),g.textContent=o.slice(0,120).join(`
|