brep-io-kernel 1.0.251 → 1.0.252
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/assembly-constraint-capture.html +5 -5
- package/dist/assets/{AnnotationRegistry-DxnuBVib.js → AnnotationRegistry-61-QTIl6.js} +1 -1
- package/dist/assets/{AssemblyConstraintRegistry-DHKMQSj6.js → AssemblyConstraintRegistry-DDhkhKoR.js} +1 -1
- package/dist/assets/{FeatureRegistry-C9h4q68e.js → FeatureRegistry-CyK8O2Ca.js} +3 -3
- package/dist/assets/{PartHistory-4fqTqe8m.js → PartHistory-CYHQ9__L.js} +1 -1
- package/dist/assets/{annUtils-C1gESzsQ.js → annUtils-B86URBT5.js} +1 -1
- package/dist/assets/{apiExample_BREP_Booleans-B1xVAOyX.js → apiExample_BREP_Booleans-DdWlLKsQ.js} +1 -1
- package/dist/assets/{apiExample_BREP_Export-CHD3cpsa.js → apiExample_BREP_Export-AUY7EeHW.js} +1 -1
- package/dist/assets/{apiExample_BREP_Primitives-Cxgt1-u1.js → apiExample_BREP_Primitives-g6bMwZLj.js} +1 -1
- package/dist/assets/{apiExample_BREP_Transforms-CZ-klSeH.js → apiExample_BREP_Transforms-DH3-Y9FI.js} +1 -1
- package/dist/assets/{apiExample_Embeded_2D_Sketcher-Bpi0fqAV.js → apiExample_Embeded_2D_Sketcher-B8EeF-Gj.js} +1 -1
- package/dist/assets/{apiExample_Embeded_CAD-B_SPpcLZ.js → apiExample_Embeded_CAD-7roRFtt7.js} +1 -1
- package/dist/assets/{apiExample_Embeded_CAD_Integration_Test-DjKBLQ49.js → apiExample_Embeded_CAD_Integration_Test-Pb0iBwIv.js} +1 -1
- package/dist/assets/{assemblyConstraintDialogs-8hg4PlL4.js → assemblyConstraintDialogs-BJX50LIF.js} +1 -1
- package/dist/assets/{brep-kernel-QpBwDdca.js → brep-kernel-BaJWJnmy.js} +1 -1
- package/dist/assets/{browserTests-CfVrmhte.js → browserTests-DxakKnoa.js} +1 -1
- package/dist/assets/{dialogCapturePageFactory-C9unVBhR.js → dialogCapturePageFactory-B5p-TYIP.js} +1 -1
- package/dist/assets/{featureDialogs-Cx7p1XpK.js → featureDialogs-CnBa1DyN.js} +1 -1
- package/dist/assets/{featureDialogs-D7xm3LIj.js → featureDialogs-DbmvJ-NA.js} +1 -1
- package/dist/assets/{index.es-Due8Wdrm.js → index.es-kd2D9M8K.js} +1 -1
- package/dist/assets/{javascript-CvgRKapH.js → javascript-CAvRMK4c.js} +1 -1
- package/dist/assets/{main-cad-DtMN0iSg.js → main-cad-Dojzs8d6.js} +6 -6
- package/dist/assets/{pmiDialogs-Bxu3FGJy.js → pmiDialogs-DQBW7aoF.js} +1 -1
- package/dist/assets/{test-Ccoy9ITq.js → test-ByMinHh_.js} +3 -3
- package/dist/cad.html +7 -7
- package/dist/feature-dialog-capture.html +4 -4
- package/dist/pmi-dialog-capture.html +5 -5
- package/dist/test.html +1 -1
- package/dist/viewer.html +7 -7
- package/dist-kernel/brep-kernel.js +1 -1
- package/package.json +1 -1
- package/src/BREP/SolidMethods/manifoldOps.js +5 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ea=Object.defineProperty;var l=(e,t)=>ea(e,"name",{value:t,configurable:!0});import{b as ta,g as ur,D as ln,a as ra,r as fr,c as cn,d as so,e as Ar,f as pr,h as dn,i as un,j as na,k as oa,l as aa,m as _r,n as fn,o as sa,p as It,q as pn,s as ia,t as la,u as ca,v as da,w as ua,P as vt,x as fa,y as _n,z as pa,A as _a,B as ha,C as ma,E as ga,F as xa,G as hr,V as hn,H as mn}from"./main-cad-
|
|
1
|
+
var ea=Object.defineProperty;var l=(e,t)=>ea(e,"name",{value:t,configurable:!0});import{b as ta,g as ur,D as ln,a as ra,r as fr,c as cn,d as so,e as Ar,f as pr,h as dn,i as un,j as na,k as oa,l as aa,m as _r,n as fn,o as sa,p as It,q as pn,s as ia,t as la,u as ca,v as da,w as ua,P as vt,x as fa,y as _n,z as pa,A as _a,B as ha,C as ma,E as ga,F as xa,G as hr,V as hn,H as mn}from"./main-cad-Dojzs8d6.js";import{q as M}from"./browserStorage-CvgF8ovw.js";import{P as z,S as er,z as io}from"./PartHistory-CYHQ9__L.js";import{C as lo,B as C,o as Q,E as Ea,p as ya,q as gn,t as Wr,u as xn,v as Sa,w as jr,x as wa,y as Wt,z as ze,T as Te,_ as En,G as zr,H as va,I as yn,P as ba,K as Pa,L as co,M as uo,N as Re,O as Fa,Q as ot,R as Aa,U as Rt,J as Ta,j as Hr,i as Na,h as fo,V as Sn,W as Ca,X as Ia,Y as Ra}from"./FeatureRegistry-CyK8O2Ca.js";import{aD as R,aG as me,V as ae,aF as Tr,aC as T,b9 as Se,ba as Oa,bb as po,M as Da,aI as Ma,bc as $a,bd as _o,be as ka,bf as La,bg as Ba,bh as Va,bi as Ua,bj as Ga,aE as gt,bk as Wa,bl as ja,bm as za,bn as Yr,bo as Ha,bp as Ya,bq as Xr,br as ho,bs as mo,b4 as go,b3 as wn,B as xo,G as Xa,d as Ka,F as Ja,f as Za,s as qa,Y as vn,X as Be,O as Eo,b2 as Qa,q as bt,a$ as es,aO as yo,aV as ts,Q as rs,bt as bn}from"./featureDialogs-CnBa1DyN.js";import"./droppedWorkspaceFiles-8o-ZYOrf.js";import"./AnnotationRegistry-61-QTIl6.js";import"./ListEntityBase-DIaWtqmZ.js";import"./deepClone-Dj59xCHB.js";import"./annUtils-B86URBT5.js";import"./preload-helper-ZNr0Qq7Q.js";import"./AssemblyConstraintRegistry-DDhkhKoR.js";const rn=class rn{constructor(t={}){this.options={captureStack:!!t.captureStack,withTimestamp:t.withTimestamp!==!1,levels:t.levels||null,maxEntries:Number.isFinite(t.maxEntries)?t.maxEntries:1/0},this._orig=(typeof window<"u"?window.console:console)||{},this._installed=!1,this._capturing=!0,this._logs=[],this._nextId=1,this._proxy=this._buildProxy(),this.install()}install(){if(this._installed)return;const t=typeof window<"u"?window:globalThis;this._prevConsole=t.console,t.console=this._proxy,this._installed=!0}restore(){if(!this._installed)return;const t=typeof window<"u"?window:globalThis;t.console=this._prevConsole||this._orig,this._installed=!1}pause(){this._capturing=!1}resume(){this._capturing=!0}getLogs(t={}){const{level:r,since:n,until:o}=t;return this._logs.filter(a=>!(r&&a.level!==r||n&&a.time&&a.time<n||o&&a.time&&a.time>o)).slice()}clearLogs(){this._logs.length=0}get logs(){return this.getLogs()}getLogsAll(){return this.getLogs()}_buildProxy(){const t=this._orig,r={},n=new Set([...Object.getOwnPropertyNames(t),...Object.keys(t)]);["log","info","warn","error","debug","trace","group","groupCollapsed","groupEnd","table","time","timeEnd","timeLog","count","countReset","assert","clear","dir","dirxml"].forEach(a=>n.add(a));for(const a of n){const s=this._safeGetDescriptor(t,a);if(s)if(typeof s.value=="function")r[a]=this._wrapMethod(a,t[a]);else if(s.get||s.set)Object.defineProperty(r,a,{configurable:!0,enumerable:s.enumerable,get:s.get?s.get.bind(t):void 0,set:s.set?s.set.bind(t):void 0});else try{r[a]=t[a]}catch{}}return Object.defineProperty(r,"__capturing__",{value:!0,enumerable:!1}),r}_safeGetDescriptor(t,r){try{return Object.getOwnPropertyDescriptor(t,r)}catch{return null}}_wrapMethod(t,r){const n=this,o=!n.options.levels||n.options.levels.includes(t);function a(...s){const c=t==="assert"?!s[0]:!0;if(n._capturing&&o&&c){const d={id:n._nextId++,level:t,args:s};if(n.options.withTimestamp&&(d.time=new Date),n.options.captureStack){const u=new Error().stack||"";d.stack=u.split(`
|
|
2
2
|
`).slice(2).join(`
|
|
3
3
|
`)}n.options.maxEntries!==1/0&&n._logs.length>=n.options.maxEntries&&n._logs.shift(),n._logs.push(d)}try{if(typeof r=="function")return r.apply(n._orig,s)}catch(d){try{return n._orig&&typeof n._orig.log=="function"?n._orig.log("ConsoleCapture forwarding error:",d):void 0}catch{}}}l(a,"wrapped");try{Object.defineProperty(a,"name",{value:`capture_${t}`})}catch{}return a}};l(rn,"ConsoleCapture");let Nr=rn;const te=!!globalThis?.process?.versions?.node&&typeof window>"u";function ne(){if(!te)return H;if(typeof require=="function"){const t=require("node:path");return(t.default??t).posix}const e=globalThis?.module;if(e&&typeof e.createRequire=="function"){const r=e.createRequire(globalThis.__filename||globalThis.process.cwd())("node:path");return(r.default??r).posix}return H}l(ne,"getNodePosixSync");const So="/",ns=":";function Ne(e){if(typeof e!="string")throw new TypeError("Path must be a string")}l(Ne,"_assertString");function tr(e){return e.startsWith(So)}l(tr,"_isAbsolute");function wo(e,t){const r=e.split("/"),n=[];for(let o=0;o<r.length;o++){const a=r[o];!a||a==="."||(a===".."?n.length&&n[n.length-1]!==".."?n.pop():t&&n.push(".."):n.push(a))}return n.join("/")}l(wo,"_normalizeString");function vo(e){if(Ne(e),e==="")return".";const t=tr(e),r=e.endsWith("/");let n=wo(e,!t);return n===""&&!t&&(n="."),n!==""&&r&&(n+="/"),(t?"/":"")+n}l(vo,"_normalize");function os(...e){let t="";for(let r=0;r<e.length;r++){const n=e[r];Ne(n),n!==""&&(t===""?t=n:t+="/"+n)}return vo(t)}l(os,"_join");function Cr(...e){let t="",r=!1;for(let o=e.length-1;o>=0;o--){const a=e[o];if(a!==void 0&&(Ne(a),a!==""&&(t=a+"/"+t,a.startsWith("/")))){r=!0;break}}r||(t="/"+t,r=!0);const n=wo(t,!1);return(r?"/":"")+n||(r?"/":".")}l(Cr,"_resolve");function as(e,t){if(Ne(e),Ne(t),e===t||(e=Cr(e),t=Cr(t),e===t))return"";const r=e.slice(1).split("/").filter(Boolean),n=t.slice(1).split("/").filter(Boolean);let o=0;const a=Math.min(r.length,n.length);for(;o<a&&r[o]===n[o];o++);const s=r.slice(o).map(()=>".."),i=n.slice(o);return s.concat(i).join("/")||""}l(as,"_relative");function bo(e){if(Ne(e),e.length===0)return".";const t=tr(e),r=e.endsWith("/")?e.length-1:e.length;let n=-1;for(let o=r-1;o>=0;--o)if(e.charCodeAt(o)===47){n=o;break}return n===-1?t?"/":".":t&&n===0?"/":e.slice(0,n)}l(bo,"_dirname");function Po(e,t=""){if(Ne(e),t!==void 0&&typeof t!="string")throw new TypeError("ext must be a string");let r=e.length;if(r===0)return"";for(;r>0&&e.charCodeAt(r-1)===47;)r--;if(r===0)return"/";let n=0;for(let a=r-1;a>=0;--a)if(e.charCodeAt(a)===47){n=a+1;break}let o=e.slice(n,r);return t&&o.endsWith(t)&&t!==""&&t!==o&&(o=o.slice(0,o.length-t.length)),o}l(Po,"_basename");function Fo(e){Ne(e);let t=-1,r=0,n=-1,o=0;for(let a=e.length-1;a>=0;--a){const s=e.charCodeAt(a);if(s===47){if(n!==-1){r=a+1;break}continue}n===-1&&(n=a+1),s===46?t===-1?t=a:o!==1&&(o=1):t!==-1&&(o=-1)}return t===-1||n===-1||o===0||t===r?"":e.slice(t,n)}l(Fo,"_extname");function ss(e){Ne(e);const t=tr(e)?"/":"",r=bo(e),n=Po(e),o=Fo(n),a=o?n.slice(0,n.length-o.length):n;return{root:t,dir:r,base:n,ext:o,name:a}}l(ss,"_parse");function is(e){const t=e.dir||e.root||"",r=e.base||(e.name||"")+(e.ext||"");return t?t.endsWith("/")?t+r:t+"/"+r:r||"."}l(is,"_format");function ls(e){return e}l(ls,"_toNamespacedPath");const H={sep:So,delimiter:ns,normalize:vo,join:os,resolve:Cr,isAbsolute:tr,relative:as,dirname:bo,basename:Po,extname:Fo,parse:ss,format:is,toNamespacedPath:ls,posix:null,win32:null};H.posix=H;const jt={get sep(){return te?ne().sep:H.sep},get delimiter(){return te?ne().delimiter:H.delimiter},normalize:l((...e)=>te?ne().normalize(...e):H.normalize(...e),"normalize"),join:l((...e)=>te?ne().join(...e):H.join(...e),"join"),resolve:l((...e)=>te?ne().resolve(...e):H.resolve(...e),"resolve"),isAbsolute:l((...e)=>te?ne().isAbsolute(...e):H.isAbsolute(...e),"isAbsolute"),relative:l((...e)=>te?ne().relative(...e):H.relative(...e),"relative"),dirname:l((...e)=>te?ne().dirname(...e):H.dirname(...e),"dirname"),basename:l((...e)=>te?ne().basename(...e):H.basename(...e),"basename"),extname:l((...e)=>te?ne().extname(...e):H.extname(...e),"extname"),parse:l((...e)=>te?ne().parse(...e):H.parse(...e),"parse"),format:l((...e)=>te?ne().format(...e):H.format(...e),"format"),toNamespacedPath:l((...e)=>te?ne().toNamespacedPath(...e):H.toNamespacedPath(...e),"toNamespacedPath"),posix:null,win32:null};jt.posix=jt;const cs=new Proxy({},{get(){throw new Error("POSIX-only path module: use the named export `posix` with your VFS.")}});jt.win32=cs;const ye=jt,mr=.01,Pn="src/tests/fixtures/sketchSolverTopology";function fe(e,t){if(!e)throw new Error(t)}l(fe,"assert$u");function zt(e,t){const r=e.points.find(n=>Number(n.id)===Number(t));if(!r)throw new Error(`Point ${t} not found`);return r}l(zt,"getPoint$1");function ds(e,t){const r=e.constraints.find(n=>Number(n.id)===Number(t));if(!r)throw new Error(`Constraint ${t} not found`);return r}l(ds,"getConstraint$1");function Fn(e,t,r){const n=zt(e,t),o=zt(e,r);return Math.hypot(o.x-n.x,o.y-n.y)}l(Fn,"dist$1");function An(e,t){const r=t.map(o=>zt(e,o));let n=0;for(let o=0;o<r.length;o++){const a=r[o],s=r[(o+1)%r.length];n+=a.x*s.y-s.x*a.y}return n*.5}l(An,"signedArea$1");function Tn(e){const t=(e.points||[]).map(o=>Number(o.id)).sort((o,a)=>o-a),r=(e.geometries||[]).map(o=>({id:Number(o.id),type:String(o.type),construction:!!o.construction,points:(o.points||[]).map(a=>Number(a))})).sort((o,a)=>o.id-a.id),n=(e.constraints||[]).map(o=>({id:Number(o.id),type:String(o.type),points:(o.points||[]).map(a=>Number(a))})).sort((o,a)=>o.id-a.id);return{pointIds:t,geometries:r,constraints:n}}l(Tn,"topologySnapshot$1");function us(e,t){const r=new Set((e.points||[]).map(n=>Number(n.id)));for(const n of e.geometries||[])for(const o of n.points||[])fe(r.has(Number(o)),`${t}: geometry ${n.id} references missing point ${o}`);for(const n of e.constraints||[])for(const o of n.points||[])fe(r.has(Number(o)),`${t}: constraint ${n.id} references missing point ${o}`)}l(us,"assertTopologyIntegrity$1");function fs(e,t="fixture"){const r=String(e||"").trim();return r&&r.toLowerCase().replace(/[^a-z0-9._-]+/g,"_").replace(/^_+|_+$/g,"").slice(0,120)||t}l(fs,"sanitizeName");function gr(e,t,r,n){if(!Number.isFinite(e)||!Number.isFinite(t)||Math.abs(e-t)>r)throw new Error(`${n}. Expected ${t}, got ${e}`)}l(gr,"assertNear$1");function ps(e,t={}){if(typeof e!="string"||!e.trim())return null;const r=Object.keys(t||{}),n=r.map(o=>Number(t[o]));if(!n.every(o=>Number.isFinite(o)))return null;try{const a=Function(...r,`"use strict"; return (${e});`)(...n),s=Number(a);return Number.isFinite(s)?s:null}catch{return null}}l(ps,"evaluateExpressionWithVars");function Ao(e,{maxPasses:t=8,stopWhenConstraintsClear:r=!0}={}){const n=Math.max(1,Number(t)||1);let o=null;for(let a=0;a<n;a++){e.solveSketch("full");const s=e.sketchObject,i=JSON.stringify(s?.points||[]),c=Array.isArray(s?.constraints)?s.constraints.some(d=>typeof d?.error=="string"&&d.error.length>0):!1;if(r&&!c||i===o)break;o=i}}l(Ao,"solveWithSettle");function _s(e,t,r){const n=t&&typeof t=="object"?t:null;if(!n)throw new Error(`${r}: expressionValues edit requires an object`);for(const o of e.sketchObject?.constraints||[]){if(typeof o?.valueExpr!="string"||!o.valueExpr.length)continue;const a=ps(o.valueExpr,n);if(!Number.isFinite(a))continue;const s=o?.type==="⟺"&&o?.displayStyle==="diameter"&&o?.valueExprMode==="diameter";o.value=s?Number(a)*.5:Number(a)}}l(_s,"applyExpressionValuesToConstraints");function hs(e,t,r){for(const n of t||[])if(!(!n||typeof n!="object")){if(Object.prototype.hasOwnProperty.call(n,"expressionValues"))_s(e,n.expressionValues,r);else{const o=Number(n.constraintId),a=Number(n.value);if(!Number.isFinite(o))throw new Error(`${r}: edit has invalid constraintId`);if(!Number.isFinite(a))throw new Error(`${r}: edit for constraint ${o} has invalid value`);const s=ds(e.sketchObject,o);s.value=a}Ao(e,{maxPasses:Number.isFinite(Number(n.maxPasses))?Number(n.maxPasses):8,stopWhenConstraintsClear:n.stopWhenConstraintsClear!==!1})}}l(hs,"applyEdits");function ms({before:e,after:t,expect:r,contextLabel:n}){if(us(t,n),r?.topologyUnchanged!==!1){const a=JSON.stringify(Tn(e)),s=JSON.stringify(Tn(t));fe(a===s,`${n}: topology changed`)}for(const a of r?.distances||[]){const s=Number(a.a),i=Number(a.b),c=Number(a.value),d=Number.isFinite(Number(a.tol))?Number(a.tol):mr;fe(Number.isFinite(s)&&Number.isFinite(i),`${n}: invalid distance pair`),gr(Fn(t,s,i),c,d,`${n}: distance [${s},${i}] mismatch`)}for(const a of r?.anchors||[]){const s=Number(a.pointId),i=Number.isFinite(Number(a.tol))?Number(a.tol):mr,c=zt(t,s);Number.isFinite(Number(a.x))&&gr(c.x,Number(a.x),i,`${n}: anchor ${s} x drift`),Number.isFinite(Number(a.y))&&gr(c.y,Number(a.y),i,`${n}: anchor ${s} y drift`)}for(const a of r?.coincidentPairs||[]){const s=Number(a.a),i=Number(a.b),c=Number.isFinite(Number(a.tol))?Number(a.tol):mr;fe(Number.isFinite(s)&&Number.isFinite(i),`${n}: invalid coincident pair`),fe(Fn(t,s,i)<=c,`${n}: coincident pair [${s},${i}] broke`)}for(const a of r?.orientationLoops||[]){const s=Array.isArray(a?.pointIds)?a.pointIds.map(u=>Number(u)):[];fe(s.length>=3,`${n}: orientation loop needs at least 3 points`);const i=Number.isFinite(Number(a.minAbsArea))?Number(a.minAbsArea):1,c=An(e,s),d=An(t,s);fe(Math.abs(d)>i,`${n}: loop collapsed`),a.preserveSign!==!1&&fe(Math.sign(d)===Math.sign(c),`${n}: loop orientation flipped`)}}l(ms,"runExpectations");async function gs(e,t){const n=`sketch fixture ${e?.name||ye.basename(t)}`;fe(e&&typeof e=="object",`${n}: fixture is not an object`),fe(Array.isArray(e.edits),`${n}: missing edits array`);let o=null;if(e.sketch&&typeof e.sketch=="object")o=e.sketch;else if(typeof e.sourcePartFile=="string"&&e.sourcePartFile.trim().length){const c=e.sourcePartFile.trim(),d=await M.promises.readFile(c,"utf8"),u=JSON.parse(d),f=Array.isArray(u?.features)?u.features:[];let p=null;if(e.sourceFeatureId!=null){const _=String(e.sourceFeatureId);p=f.find(m=>m?.type==="S"&&(String(m?.inputParams?.id??"")===_||String(m?.inputParams?.featureID??"")===_))||null}p||(p=f.find(_=>_?.type==="S"&&_?.persistentData?.sketch)||null),o=p?.persistentData?.sketch||null}fe(o&&typeof o=="object",`${n}: missing sketch or sourcePartFile sketch`);const a=new lo({sketch:JSON.parse(JSON.stringify(o))});Ao(a,{maxPasses:Number.isFinite(Number(e.initialSolvePasses))?Number(e.initialSolvePasses):4,stopWhenConstraintsClear:!0});const s=JSON.parse(JSON.stringify(a.sketchObject));hs(a,e.edits,n);const i=a.sketchObject;ms({before:s,after:i,expect:e.expect||{},contextLabel:n})}l(gs,"runFixture");async function xs(e){if(!(typeof process<"u"&&process.versions&&process.versions.node))return 0;const t=new Set((e||[]).map(a=>a?._sourceFile).filter(a=>typeof a=="string"&&a.length>0));let r=[];try{r=await M.promises.readdir(Pn)}catch{return 0}const n=r.filter(a=>typeof a=="string"&&a.toLowerCase().endsWith(".json")).sort((a,s)=>a.localeCompare(s));let o=0;for(const a of n){const s=ye.join(Pn,a);if(t.has(s))continue;let i=null;try{const p=await M.promises.readFile(s,"utf8");i=JSON.parse(p)}catch(p){const _=p?.message||String(p);throw new Error(`Failed to read sketch fixture ${s}: ${_}`)}const c=String(a).replace(/\.[^.]+$/,""),u=`test_sketch_solver_fixture_${fs(i?.name||c,`fixture_${o}`)}`,f=l(async function(){await gs(i,s)},"sketchSolverFixtureTest");try{Object.defineProperty(f,"name",{value:u,configurable:!0})}catch{}e.push({test:f,printArtifacts:!1,exportFaces:!1,exportSolids:!1,resetHistory:!0,_sourceFile:s}),t.add(s),o+=1}return o}l(xs,"registerSketchSolverTopologyFixtureTests");async function Es(e){const t=await e.newFeature("P.CO");t.inputParams.radiusTop=3,t.inputParams.radiusBottom=.5,t.inputParams.height=5.2,t.inputParams.resolution=20;const r=await e.newFeature("P.CU");r.inputParams.sizeX=2,r.inputParams.sizeY=2,r.inputParams.sizeZ=20;const n=await e.newFeature("B");return n.inputParams.targetSolid=r.inputParams.featureID,n.inputParams.boolean={targets:[t.inputParams.featureID],operation:"SUBTRACT"},e}l(Es,"test_boolean_subtract");async function ys(e){const t=await e.newFeature("P.CU");t.inputParams.sizeX=10,t.inputParams.sizeY=10,t.inputParams.sizeZ=10;const r=await e.newFeature("P.CU");return r.inputParams.sizeX=10,r.inputParams.sizeY=10,r.inputParams.sizeZ=10,r.inputParams.transform={position:[5,0,0],rotationEuler:[0,0,0],scale:[1,1,1]},r.inputParams.boolean={operation:"UNION",targets:[t.inputParams.featureID]},e}l(ys,"test_boolean_operation_target_name_preserved");async function Ss(e){const t=(e?.features||[]).filter(i=>i?.type==="P.CU");if(t.length<2)throw new Error("[boolean target name] Expected at least two primitive cube features.");const r=t[0]?.inputParams?.featureID,n=t[1]?.inputParams?.featureID;if(!r||!n)throw new Error("[boolean target name] Missing feature IDs for cube setup.");const o=(e?.scene?.children||[]).filter(i=>i?.type==="SOLID");if(o.length!==1)throw new Error(`[boolean target name] Expected exactly one solid after union, got ${o.length}.`);const a=o[0];if(String(a?.name||"")!==String(r))throw new Error(`[boolean target name] Expected result name "${r}", got "${String(a?.name||"")}".`);if(e?.scene?.getObjectByName?.(n))throw new Error(`[boolean target name] Tool-named solid "${n}" should have been replaced.`)}l(Ss,"afterRun_boolean_operation_target_name_preserved");function at(e,t){if(!e)throw new Error(t||"Assertion failed.")}l(at,"assert$t");async function ws(){const e=new C.Cube({x:10,y:10,z:10,name:"BASE"}),t=new C.Cube({x:6,y:6,z:6,name:"TOOL"});e.setFaceMetadata("BASE_NX",{sourceFeatureId:"BASE_FEATURE",marker:"base-nx"}),t.setFaceMetadata("TOOL_PX",{sourceFeatureId:"TOOL_FEATURE",marker:"tool-px"}),e.addCenterline([-5,0,0],[5,0,0],"BASE_AXIS"),t.addCenterline([0,-3,0],[0,3,0],"TOOL_AXIS"),t.bakeTRS({position:[7,2,2],rotationEuler:[0,0,0],scale:[1,1,1]}),e.union=()=>{throw new Error("forced union failure for metadata fallback test")};const r={scene:{getObjectByName(){return null}}},n=await C.applyBooleanOperation(r,e,{operation:"UNION",targets:[t]},"BOOL_META"),o=Array.isArray(n?.added)?n.added[0]:null;at(o,"Expected boolean to return a result solid.");const a=o.getFaceMetadata("BASE_NX");at(a&&a.sourceFeatureId==="BASE_FEATURE","Base face provenance should survive union fallback."),at(a&&a.marker==="base-nx","Base face custom metadata should survive union fallback.");const s=Array.isArray(o._auxEdges)?o._auxEdges:[];at(s.some(i=>i?.name==="BASE_AXIS"&&i?.centerline),"Base centerline should survive union fallback."),at(s.some(i=>i?.name==="TOOL_AXIS"&&i?.centerline),"Tool centerline should survive union fallback.")}l(ws,"test_boolean_face_metadata_preserved");function X(e,t){if(!e)throw new Error(t||"Assertion failed.")}l(X,"assert$s");function rr(e,t,r=0){const n=typeof e?.getFace=="function"?e.getFace(t):[];let o=Number.POSITIVE_INFINITY;for(const a of n)for(const s of[a?.p1,a?.p2,a?.p3])!Array.isArray(s)||s.length<3||(o=Math.min(o,Number(s[r])));return o}l(rr,"faceAxisMin");function nr(e,t,r=0){const n=typeof e?.getFace=="function"?e.getFace(t):[];let o=Number.NEGATIVE_INFINITY;for(const a of n)for(const s of[a?.p1,a?.p2,a?.p3])!Array.isArray(s)||s.length<3||(o=Math.max(o,Number(s[r])));return o}l(nr,"faceAxisMax");function or(e,t){const r=new C.Cube({x:1,y:1,z:1,name:e}),n=new C.Cube({x:1,y:1,z:1,name:t});return n.bakeTRS({position:[1,0,0],rotationEuler:[0,0,0],scale:[1,1,1]}),{base:r,tool:n}}l(or,"makeTouchingCubePair");function Kr(){return{scene:{getObjectByName(){return null}}}}l(Kr,"makeFakePartHistory");async function To(e){const{base:t,tool:r}=or("BASE","TOOL"),n=Object.getPrototypeOf(t),o=n.union;let a=null,s=null;n.union=l(function(c){return a===null&&(a=nr(this,"BASE_PX",0),s=rr(c,"TOOL_NX",0)),o.call(this,c)},"patchedUnion");try{await C.applyBooleanOperation(Kr(),t,{operation:"UNION",targets:[r],...e},"BOOL_OVERLAP_UNION")}finally{n.union=o}return{observedBasePXMax:a,observedToolNXMin:s}}l(To,"captureUnionConditionedFaces");async function No(e){const{base:t,tool:r}=or("TARGET","CUTTER"),n=Object.getPrototypeOf(t),o=n.subtract;let a=null;n.subtract=l(function(i){return a===null&&(a=rr(i,"CUTTER_NX",0)),o.call(this,i)},"patchedSubtract");try{await C.applyBooleanOperation(Kr(),r,{operation:"SUBTRACT",targets:[t],...e},"BOOL_OVERLAP_SUBTRACT")}finally{n.subtract=o}return a}l(No,"captureSubtractOperandMinX");async function vs(e){const t=new C.Cube({x:1,y:1,z:1,name:"TARGET_Z"}),r=new C.Cube({x:1,y:1,z:2,name:"CUTTER_Z"}),n=Object.getPrototypeOf(t),o=n.subtract;let a=null,s=null;n.subtract=l(function(c){return a===null&&(a=rr(c,"CUTTER_Z_NZ",2),s=nr(c,"CUTTER_Z_NZ",2)),o.call(this,c)},"patchedSubtract");try{await C.applyBooleanOperation(Kr(),r,{operation:"SUBTRACT",targets:[t],...e},"BOOL_OVERLAP_SUBTRACT_CAP")}finally{n.subtract=o}return{observedMinZ:a,observedMaxZ:s}}l(vs,"captureSubtractOperandMinZForEntryCap");async function bs(){const{observedBasePXMax:e}=await To({});X(Number.isFinite(e),"Expected union test to observe the conditioned base face."),X(e>1+1e-7,`Expected default union edge-point conditioning to push BASE_PX into the target solid, got maxX=${e}`)}l(bs,"test_boolean_overlap_conditioning_union_enabled_by_default");async function Ps(){const{observedBasePXMax:e,observedToolNXMin:t}=await To({overlapConditioningEnabled:!1});X(Number.isFinite(e)&&Number.isFinite(t),"Expected disabled union test to observe the faces."),X(Math.abs(e-1)<=1e-12,`Expected disabled union conditioning to leave BASE_PX at x=1, got maxX=${e}`),X(Math.abs(t-1)<=1e-12,`Expected disabled union conditioning to leave TOOL_NX at x=1, got minX=${t}`)}l(Ps,"test_boolean_overlap_conditioning_union_can_be_disabled");async function Fs(){const e=await No({});X(Number.isFinite(e),"Expected subtract test to observe the conditioned cutter face."),X(e>1+1e-7,`Expected default subtract edge-point conditioning to push CUTTER_NX outside the target solid, got minX=${e}`)}l(Fs,"test_boolean_overlap_conditioning_subtract_enabled_by_default");async function As(){const{observedMinZ:e,observedMaxZ:t}=await vs({});X(Number.isFinite(e)&&Number.isFinite(t),"Expected subtract cap test to observe the conditioned cutter cap face."),X(e<0-1e-7,`Expected subtract conditioning to expand CUTTER_Z_NZ outward beyond z=0, got minZ=${e}`),X(Math.abs(t-e)<=1e-12,`Expected CUTTER_Z_NZ to remain planar after conditioning, got minZ=${e}, maxZ=${t}`)}l(As,"test_boolean_overlap_conditioning_subtract_expands_tool_entry_cap_outward");async function Ts(){const e=await No({overlapConditioningEnabled:!1});X(Number.isFinite(e),"Expected disabled subtract test to observe the cutter face."),X(Math.abs(e-1)<=1e-12,`Expected disabled subtract conditioning to leave CUTTER_NX at x=1, got minX=${e}`)}l(Ts,"test_boolean_overlap_conditioning_subtract_can_be_disabled");async function Ns(){const{base:e,tool:t}=or("BASE_API","TOOL_API"),r=e.union(t);X(r,"Expected direct union to return a result solid."),X(nr(e,"BASE_API_PX",0)===1,"Direct union should not mutate the source solid.");const n=new C.Cube({x:1,y:1,z:1,name:"TARGET_API"}),o=new C.Cube({x:1,y:1,z:1,name:"CUTTER_API"});o.bakeTRS({position:[1,0,0],rotationEuler:[0,0,0],scale:[1,1,1]});const a=n.subtract(o);X(a,"Expected direct subtract to return a result solid."),X(rr(o,"CUTTER_API_NX",0)===1,"Direct subtract should not mutate the cutter solid.")}l(Ns,"test_boolean_overlap_conditioning_direct_api_enabled_by_default");async function Cs(){const{base:e,tool:t}=or("BASE_API_OFF","TOOL_API_OFF"),r=Object.getPrototypeOf(e),n=r.union;let o=null;r.union=l(function(s,i){return o=nr(this,"BASE_API_OFF_PX",0),n.call(this,s,i)},"patchedUnion");try{e.union(t,{overlapConditioningEnabled:!1})}finally{r.union=n}X(Math.abs(o-1)<=1e-12,`Expected disabled direct union conditioning to leave BASE_API_OFF_PX at x=1, got ${o}`)}l(Cs,"test_boolean_overlap_conditioning_direct_api_can_be_disabled");async function Is(e){const t=await e.newFeature("P.CU");t.inputParams.sizeX=20,t.inputParams.sizeY=20,t.inputParams.sizeZ=20;const r=await e.newFeature("CHAMFER");return r.inputParams.edges=[`${t.inputParams.featureID}_PZ`],r.inputParams.distance=3,r.inputParams.inflate=5e-4,r.inputParams.direction="INSET",e}l(Is,"test_Chamfer");function b(e,t){if(!e)throw new Error(t||"Assertion failed.")}l(b,"assert$r");const Rs={points:[{id:0,x:0,y:0,fixed:!0,construction:!0,externalReference:!1},{id:1,x:-2.504334,y:-3.287135,fixed:!1,construction:!1,externalReference:!1},{id:2,x:6.391665,y:6.452413,fixed:!1,construction:!1,externalReference:!1},{id:3,x:-2.504334,y:-3.287135,fixed:!1,construction:!1,externalReference:!1},{id:6,x:6.391665,y:6.452413,fixed:!1,construction:!1,externalReference:!1},{id:7,x:-2.504333,y:6.452412,fixed:!1,construction:!1,externalReference:!1},{id:8,x:-2.504333,y:6.452412,fixed:!1,construction:!1,externalReference:!1},{id:15,x:1.803917,y:3.614373,fixed:!1,construction:!1,externalReference:!1},{id:16,x:1.803917,y:3.614373,fixed:!1,construction:!1,externalReference:!1},{id:17,x:1.764345,y:-4.025491,fixed:!1,construction:!1,externalReference:!1},{id:18,x:6.391665,y:4.346518,fixed:!1,construction:!1,externalReference:!1}],geometries:[{id:3,type:"line",points:[6,7],construction:!1},{id:4,type:"line",points:[8,3],construction:!1},{id:9,type:"line",points:[1,17],construction:!1},{id:10,type:"line",points:[16,17],construction:!1},{id:11,type:"line",points:[18,15],construction:!1},{id:12,type:"line",points:[18,2],construction:!1}],constraints:[{id:0,type:"⏚",points:[0],status:"solved",error:null,_previousSolveValue:null,previousPointValues:"0:0,0,1;"},{id:1,type:"≡",points:[1,3],status:"",error:null,_previousSolveValue:null,previousPointValues:"1:-2.504334,-3.287135,0;3:-2.504334,-3.287135,0;"},{id:3,type:"≡",points:[2,6],status:"solved",error:null,_previousSolveValue:null,previousPointValues:"2:6.391665,6.452413,0;6:6.391665,6.452413,0;"},{id:4,type:"≡",points:[7,8],status:"",error:null,_previousSolveValue:null,previousPointValues:"7:-2.504333,6.452412,0;8:-2.504333,6.452412,0;"},{id:7,type:"⟂",points:[6,7,8,3],status:"",error:null,value:270,_previousSolveValue:270,previousPointValues:"6:5.357399948061701,6.756693642653996,0;7:-2.8534559480617006,6.093104357346005,0;8:-2.853456,6.093105,0;3:-2.150647,-2.603049,0;"},{id:8,type:"│",points:[8,3],labelX:0,labelY:0,displayStyle:"",value:null,valueNeedsSetup:!0,status:"",error:null,_previousSolveValue:null,previousPointValues:"8:-2.504327,6.4524,0;3:-2.504327,-3.27361,0;"},{id:12,type:"≡",points:[15,16],status:"solved",error:null,_previousSolveValue:null,previousPointValues:"15:1.803917,3.614373,0;16:1.803917,3.614373,0;"}]},Os=["E3:S2:PROFILE_START|F4_FILLET_E3_S2_G10_SW_E3_S2_G11_SW_e44b5ee8_3_TUBE_Outer[0]","E3:S2:G11_SW|E3:S2:PROFILE_START[0]","E3:S2:G10_SW|E3:S2:PROFILE_START[0]","E3:S2:PROFILE_START|F4_FILLET_E3_S2_G11_SW_E3_S2_G12_SW_78da4f1c_5_TUBE_Outer[0]","E3:S2:G12_SW|E3:S2:PROFILE_START[0]","E3:S2:PROFILE_START|F4_FILLET_E3_S2_G12_SW_E3_S2_G3_SW_90d5733b_1_TUBE_Outer[0]","E3:S2:G3_SW|E3:S2:PROFILE_START[0]","E3:S2:PROFILE_START|F4_FILLET_E3_S2_G3_SW_E3_S2_G4_SW_6a443286_2_TUBE_Outer[0]","E3:S2:G4_SW|E3:S2:PROFILE_START[0]","E3:S2:PROFILE_START|F4_FILLET_E3_S2_G4_SW_E3_S2_G9_SW_6e866edc_4_TUBE_Outer[0]","E3:S2:G9_SW|E3:S2:PROFILE_START[0]","E3:S2:PROFILE_START|F4_FILLET_E3_S2_G10_SW_E3_S2_G9_SW_478767db_0_TUBE_Outer[0]"],Jr="E3:S2:PROFILE_START|F4_FILLET_E3_S2_G11_SW_E3_S2_G12_SW_78da4f1c_5_TUBE_Outer[0]";function We(e,t){return Math.hypot(Number(e[0])-Number(t[0]),Number(e[1])-Number(t[1]),Number(e[2])-Number(t[2]))}l(We,"pointDistance$1");function St(e,t){return[Number(e[0])-Number(t[0]),Number(e[1])-Number(t[1]),Number(e[2])-Number(t[2])]}l(St,"subtractPoints");function Co(e,t){return Number(e[0])*Number(t[0])+Number(e[1])*Number(t[1])+Number(e[2])*Number(t[2])}l(Co,"dotPoints");function Nn(e){const t=Math.hypot(Number(e[0]),Number(e[1]),Number(e[2]));return t>1e-12?[Number(e[0])/t,Number(e[1])/t,Number(e[2])/t]:[0,0,0]}l(Nn,"normalizePoint");function Ds(e,t=!1){if(!Array.isArray(e)||e.length<2)return 1e-6;const r=t?e.length:e.length-1;let n=0,o=0,a=0;for(let i=0;i<r;i+=1){const c=e[i],d=e[(i+1)%e.length],u=We(c,d);u>1e-12&&(n+=u,o=Math.max(o,u),a+=1)}if(a===0)return 1e-6;const s=n/a;return Math.max(1e-6,s*.5,o*.1)}l(Ds,"computeChamferTangentSampleDistance");function Ms(e,t,r){const n=St(t,e),o=St(r,e),a=[n[1]*o[2]-n[2]*o[1],n[2]*o[0]-n[0]*o[2],n[0]*o[1]-n[1]*o[0]];return .5*Math.hypot(a[0],a[1],a[2])}l(Ms,"triangleArea3");function $s(e,t,r,n=!1){if(!Array.isArray(e)||e.length<2||t>=e.length)return[0,0,0];const o=e.length,a=Number.isFinite(r)?Math.max(1e-6,r):1e-6;let s=t,i=t;if(n){let f=0,p=0;for(;p+1<o&&f<a;){const x=(s+o-1)%o;f+=We(e[s],e[x]),s=x,p+=1}let _=0,m=0;for(;m+1<o&&_<a;){const x=(i+1)%o;_+=We(e[x],e[i]),i=x,m+=1}}else{let f=0;for(;s>0&&f<a;)f+=We(e[s],e[s-1]),s-=1;let p=0;for(;i+1<o&&p<a;)p+=We(e[i+1],e[i]),i+=1}const c=St(e[i],e[s]);if(Co(c,c)>1e-14)return Nn(c);const d=n?(t+o-1)%o:t>0?t-1:0,u=n?(t+1)%o:Math.min(o-1,t+1);return Nn(St(e[u],e[d]))}l($s,"computeChamferStableTangent");function ks(e,t,r){const n=[e?.a,e?.b,e?.c].map(u=>[Number(u?.[0]),Number(u?.[1]),Number(u?.[2])]),o=Array.isArray(t?.userData?.polylineLocal)?t.userData.polylineLocal:[];b(n.length===3,"Expected chamfer section debug entry to expose exactly three points."),b(n.every(u=>u.every(f=>Number.isFinite(f))),"Expected chamfer section debug entry to expose finite point coordinates."),b(o.length>=2,"Expected chamfer regression edge to expose a polyline.");const a=o.length-1,s=o[a],i=Ds(o,!1),c=$s(o,a,i,!1);b(Math.hypot(...c)>1e-9,"Expected endpoint tangent for chamfer section entry to be finite.");const d=n.reduce((u,f)=>We(f,s)<We(u,s)?f:u,n[0]);return Math.max(...n.map(u=>Math.abs(Co(St(u,d),c))))}l(ks,"maxSectionEntryDistanceFromEndpointPlane");function Zr(e,t,{distance:r,inflate:n=0,direction:o="INSET",name:a="CPP_CHAMFER_NATIVE_TOOL",debugCrossSections:s=!1}={}){const i=me(e);b(i,"Expected solid to expose an authoring snapshot for native chamfer testing.");const c=String(t?.faces?.[0]?.name||""),d=String(t?.faces?.[1]?.name||"");b(c&&d,"Expected chamfer test edge to expose two adjacent face names.");const u=Array.isArray(t?.userData?.polylineLocal)?t.userData.polylineLocal:Array.isArray(t?.points)?t.points:[];return b(u.length>=2,"Expected chamfer test edge to expose a polyline."),R.buildChamferAuthoringState({snapshot:i,faceAName:c,faceBName:d,polyline:u,distance:r,inflate:n,direction:o,name:a,debugCrossSections:s})}l(Zr,"buildNativeChamferToolSnapshot");function Io(e){return Array.isArray(e?.faceNameToID)?e.faceNameToID.map(t=>String(Array.isArray(t)?t[0]:"")):[]}l(Io,"snapshotFaceNames");async function Pt(e=new z){e.expressions=`resolution = 32;
|
|
4
4
|
`,e.configurator={fields:[],values:{}};const t=await e.newFeature("D");Object.assign(t.inputParams,{id:"D1",transform:{position:[.2565036028836988,5.286649371275551,-3.590228990331272],rotationEuler:[-32.818971321018715,30.63210260878807,-2.671532847188412],scale:[1,1,1]}});const r=await e.newFeature("S");Object.assign(r.inputParams,{id:"S2",sketchPlane:"D1:XY",editSketch:null,dumpSketchDiagnostics:null,curveResolution:"resolution"}),r.persistentData={sketch:Rs};const n=await e.newFeature("E");Object.assign(n.inputParams,{id:"E3",profile:"S2:PROFILE",consumeProfileSketch:!0,distance:10,distanceBack:10,boolean:{targets:[],operation:"NONE",overlapConditioningEnabled:!0}});const o=await e.newFeature("F");Object.assign(o.inputParams,{id:"F4",edges:["E3:S2:G10_SW|E3:S2:G9_SW[0]","E3:S2:G12_SW|E3:S2:G3_SW[0]","E3:S2:G3_SW|E3:S2:G4_SW[0]","E3:S2:G10_SW|E3:S2:G11_SW[0]","E3:S2:G4_SW|E3:S2:G9_SW[0]","E3:S2:G11_SW|E3:S2:G12_SW[0]"],radius:1,resolution:"resolution",inflate:"0.2",nudgeFaceDistance:".0001",direction:"AUTO",debug:"NONE",simplifyResult:!0,cleanupNativeTinyFaceIslands:!0,reverseEndCapNudge:!1,mergeCoplanarEndCaps:!0,reassignSliverTriangles:!0,collapseTinyTriangles:!0,cleanupPostCollapseTinyFaceIslands:!0}),await e.runHistory();const a=(e.scene?.children||[]).find(i=>i?.type==="SOLID"&&i?.name==="E3");b(a,"Expected foldback fixture to produce solid E3.");const s=(a.children||[]).find(i=>i?.type==="EDGE"&&i?.name==="E3:S2:PROFILE_START|F4_FILLET_E3_S2_G10_SW_E3_S2_G11_SW_e44b5ee8_3_TUBE_Outer[0]");return b(s,"Expected foldback fixture to expose the fillet outer edge for chamfer testing."),{solid:a,edge:s}}l(Pt,"buildFoldbackFixture");function ar(e,t){const r=Array.isArray(e?.children)?e.children:[];return t.map(n=>r.find(o=>o?.type==="EDGE"&&String(o?.name||"")===String(n)))}l(ar,"resolveFixtureEdgesByName");async function Ls(){if(typeof R?.buildChamferWorkflowAuthoringState!="function"||typeof R?.buildChamferAuthoringState!="function")return;const e=new Q({x:20,y:20,z:20,name:"CPP_CHAMFER_CUBE"});e.visualize();const t=(e.children||[]).find(d=>d?.type==="EDGE"&&d?.faces?.length===2);b(t,"Expected visualized cube to expose a boundary edge for chamfer testing.");const r=Zr(e,t,{distance:3,inflate:5e-4,direction:"INSET",name:"CPP_CHAMFER_SINGLE_EDGE_TOOL"});b(r?.chamferBuildMode==="CHAIN_HULL","Expected native chamfer tool to be built from chained hull segments.");const n=Io(r);b(n.length>0,"Expected native chained-hull chamfer tool to expose faces.");const o=String(t.faces[0]?.name||""),a=String(t.faces[1]?.name||""),s=`CHAMFER_${o}|${a}`;b(n.includes(`${s}_SIDE_A`)&&n.includes(`${s}_SIDE_B`)&&n.includes(`${s}_BEVEL`)&&n.includes(`${s}_CAP0`)&&n.includes(`${s}_CAP1`),"Expected native chained-hull chamfer tool to restore the legacy semantic chamfer face names.");const i=await e.chamfer({distance:3,edges:[t],direction:"INSET",inflate:5e-4,debug:!0,featureID:"CPP_CHAMFER"});b(i&&i.getTriangleCount()>0,"Expected native chamfer result to contain triangles.");const c=Array.isArray(i.__debugChamferSolids)?i.__debugChamferSolids[0]:null;b(c,"Expected native chamfer path to retain the built chamfer tool solid for debug inspection."),b(c.getTriangleCount()>0,"Expected debug chamfer tool solid to contain triangles.")}l(Ls,"test_cppChamfer_single_edge_builds_native_named_tool_and_result");async function Bs(){if(typeof R?.buildChamferWorkflowAuthoringState!="function")return;const e=new Q({x:20,y:20,z:20,name:"CPP_CHAMFER_AUTO_CUBE"});e.visualize();const t=(e.children||[]).find(o=>o?.type==="EDGE"&&o?.faces?.length===2);b(t,"Expected visualized cube to expose a boundary edge for AUTO chamfer testing.");const r=await e.chamfer({distance:2,edges:[t],direction:"AUTO",inflate:5e-4,debug:!0,featureID:"CPP_CHAMFER_AUTO"});b(r&&r.getTriangleCount()>0,"Expected AUTO native chamfer result to contain triangles.");const n=Array.isArray(r.__debugChamferSolids)?r.__debugChamferSolids[0]:null;b(n,"Expected AUTO native chamfer path to retain the built chamfer tool."),b(n.getTriangleCount()>0,"Expected AUTO native chamfer tool to contain triangles.")}l(Bs,"test_cppChamfer_auto_direction_uses_native_classifier");async function Vs(e=new z){if(typeof R?.buildChamferWorkflowAuthoringState!="function"||typeof R?.buildChamferAuthoringState!="function")return;const{solid:t,edge:r}=await Pt(e),n=Zr(t,r,{distance:.5,inflate:.1,direction:"INSET",name:"CPP_CHAMFER_FOLDBACK_TOOL",debugCrossSections:!0});b(n?.chamferBuildMode==="CHAIN_HULL","Expected foldback regression tool to use chained hull construction.");const o=Io(n),a=`CHAMFER_${String(r.faces[0]?.name||"")}|${String(r.faces[1]?.name||"")}`;b(o.includes(`${a}_SIDE_A`)&&o.includes(`${a}_SIDE_B`)&&o.includes(`${a}_BEVEL`)&&o.includes(`${a}_CAP0`)&&o.includes(`${a}_CAP1`),"Expected foldback regression tool to restore the legacy semantic chamfer face names.");const s=Array.isArray(n?.debugCrossSectionSnapshots)?n.debugCrossSectionSnapshots:[];b(s.length>=4,`Expected foldback regression tool to emit several cross sections; received ${s.length}.`);for(const i of s){const c=i?.a||[],d=i?.b||[],u=i?.c||[];b(Ms(c,d,u)>1e-8,`Expected foldback regression cross section ${i?.name||"<unknown>"} to remain a valid triangle.`)}}l(Vs,"test_cppChamfer_stabilizes_tiny_terminal_segments_before_offsetting");async function Us(e=new z){if(typeof R?.buildChamferWorkflowAuthoringState!="function")return;const{solid:t}=await Pt(e),r=ar(t,Os);b(r.every(i=>i),"Expected tangent-cap regression fixture to expose all requested chamfer edges.");const n=await t.chamfer({distance:.5,edges:r,direction:"AUTO",inflate:.1,debug:!0,featureID:"CPP_CHAMFER_TANGENT_CAPS"});b(n&&n.getTriangleCount()>0,"Expected tangent-cap chamfer regression to produce geometry.");const o=n.__chamferDirectionDecision||{};b(Number(o.tangentCapBridges)>=1,`Expected native chamfer workflow to add at least one tangent cap bridge; received ${o.tangentCapBridges}.`);const s=(Array.isArray(n.__debugChamferSolids)?n.__debugChamferSolids:[]).filter(i=>String(i?.name||"").includes("TANGENT_CAP_BRIDGE"));b(s.length>=1,"Expected tangent-cap regression to emit a debug bridge solid."),b(s.every(i=>typeof i?.getTriangleCount=="function"&&i.getTriangleCount()>0),"Expected each tangent cap bridge debug solid to contain triangles."),b(s.some(i=>{const c=new Set(typeof i?.getFaceNames=="function"?i.getFaceNames():[]);return Array.from(c).some(d=>String(d||"").includes("_SOURCE_CAP"))&&Array.from(c).some(d=>String(d||"").includes("_TARGET_CAP"))}),"Expected tangent cap bridge debug geometry to expose source/target cap faces from the extension prism.")}l(Us,"test_cppChamfer_bridges_nearly_tangent_adjacent_end_caps");async function Gs(e=new z){if(typeof R?.buildChamferWorkflowAuthoringState!="function"||typeof R?.buildChamferAuthoringState!="function")return;const{solid:t}=await Pt(e),r=ar(t,[Jr])[0];b(r,"Expected end-cap plane regression fixture to expose the target chamfer edge.");for(const n of[.101,-.101]){const o=Zr(t,r,{distance:.5,inflate:n,direction:"INSET",name:`CPP_CHAMFER_CAP_PLANE_${n>0?"POS":"NEG"}`,debugCrossSections:!0}),a=Array.isArray(o?.debugCrossSectionSnapshots)?o.debugCrossSectionSnapshots:[],s=a[a.length-1];b(s,"Expected chamfer debug snapshot to expose the terminal cross section.");const i=ks(s,r);b(Number.isFinite(i)&&i<=1e-4,`Expected terminal chamfer cross section to stay on the endpoint tangent plane after inflate=${n}; max deviation=${i}.`)}}l(Gs,"test_cppChamfer_projects_open_end_caps_back_to_endpoint_plane");async function Ws(e=new z){if(typeof R?.buildChamferWorkflowAuthoringState!="function")return;const{solid:t}=await Pt(e),r=ar(t,[Jr])[0];b(r,"Expected cross-section debug fixture to expose the target chamfer edge.");const n=Array.isArray(r?.userData?.polylineLocal)?r.userData.polylineLocal.length:0;b(n>=2,"Expected cross-section debug fixture edge to expose sampled polyline points.");const o=await t.chamfer({distance:.5,edges:[r],direction:"AUTO",inflate:.101,debug:!0,featureID:"CPP_CHAMFER_DEBUG_SECTIONS"}),s=(Array.isArray(o.__debugChamferSolids)?o.__debugChamferSolids:[]).filter(g=>/_SECTION_\d+$/.test(String(g?.name||"")));b(s.length>=Math.max(2,n-1),`Expected debug cross-section faces for nearly every edge sample; expected about ${n}, received ${s.length}.`),b(s.every(g=>Array.isArray(g?._triVerts)&&g._triVerts.length===3),"Expected every chamfer cross-section debug solid to contain exactly one triangle."),b(s.every(g=>{const v=typeof g?.getFaceNames=="function"?g.getFaceNames():[];return Array.isArray(v)&&v.length===1&&/_SECTION_\d+$/.test(String(v[0]||""))}),"Expected each chamfer cross-section debug solid to expose a single named section face.");const i=s[0];b(i,"Expected at least one chamfer cross-section debug solid.");const c=[];for(const g of i._triVerts||[]){const v=Number(g);c.push([Number(i._vertProperties[v*3+0]),Number(i._vertProperties[v*3+1]),Number(i._vertProperties[v*3+2])])}for(const g of i._auxEdges||[])for(const v of g?.points||[]){const A=c.some(O=>Math.abs(Number(v[0])-O[0])<=1e-12&&Math.abs(Number(v[1])-O[1])<=1e-12&&Math.abs(Number(v[2])-O[2])<=1e-12);b(A,"Expected every cross-section edge endpoint to use the exact stored triangle vertex.")}i.visualize({showEdges:!0,authoringOnly:!0});const d=(i.children||[]).filter(g=>g?.type==="FACE"),u=(i.children||[]).filter(g=>g?.type==="EDGE"),f=(i.children||[]).filter(g=>g?.type==="VERTEX");b(d.length===1,`Expected the first cross-section to visualize one face, received ${d.length}.`),b(u.length===3,`Expected the first cross-section to visualize three edges, received ${u.length}.`),b(f.length===3,`Expected the first cross-section to visualize three vertices, received ${f.length}.`);const p=d[0];b(p,"Expected the first cross-section visualization to expose its section face.");const _=String(p.name||""),m=typeof i.getFaceMetadata=="function"?i.getFaceMetadata(_)||{}:{};b(m?.debugSketchFace===!0,"Expected the cross-section face to carry sketch-face metadata."),b(u.every(g=>g?.faces?.length===1&&String(g.faces[0]?.name||"")===_),"Expected each chamfer cross-section edge to be attached to the single section face.");const x=u.map(g=>String(g?.name||""));b(x.some(g=>/_EDGE_A_B$/.test(g)),"Expected the cross-section to include edge A-B."),b(x.some(g=>/_EDGE_B_C$/.test(g)),"Expected the cross-section to include edge B-C."),b(x.some(g=>/_EDGE_C_A$/.test(g)),"Expected the cross-section to include edge C-A."),b(u.every(g=>g?.userData?.auxEdge!==!0),"Expected cross-section edges to behave like normal boundary edges, not aux helpers."),b(u.every(g=>g?.material?.dashed===!1),"Expected cross-section edges to render as full triangle sides, not dashed helper segments.");const E=Array.isArray(p?.userData?.boundaryLoopsWorld)?p.userData.boundaryLoopsWorld:[];b(E.length===1,`Expected one boundary loop on the cross-section face, received ${E.length}.`),b(Array.isArray(E[0]?.pts)&&E[0].pts.length===3,"Expected the cross-section boundary loop to contain exactly the triangle vertices.");try{i.updateMatrixWorld(!0),p.updateMatrixWorld(!0)}catch{}const h=new Ea;h.inputParams={featureID:"CPP_CHAMFER_SECTION_EXTRUDE",profile:p,distance:.5,distanceBack:0,boolean:{targets:[],operation:"NONE"}};const y=await h.run(e),w=Array.isArray(y?.added)?y.added[0]:null;b(w&&typeof w.getTriangleCount=="function"&&w.getTriangleCount()>0,"Expected a chamfer cross-section face to extrude directly like a sketch face.")}l(Ws,"test_cppChamfer_debug_emits_cross_section_face_per_sample");async function js(e=new z){if(typeof R?.buildChamferWorkflowAuthoringState!="function")return;const{solid:t}=await Pt(e),r=ar(t,[Jr])[0];b(r,"Expected sketch-profile debug fixture to expose the target chamfer edge.");const n=new ya;n.inputParams={featureID:"CPP_CHAMFER_DEBUG_PROFILE",edges:[r],distance:.5,inflate:.101,direction:"AUTO",debug:!0};const o=await n.run(e),s=(Array.isArray(o?.added)?o.added:[]).find(d=>d?.type==="SKETCH"&&/_SECTION_\d+$/.test(String(d?.name||"")));b(s,"Expected chamfer debug cross sections to be added to the scene as sketch-style groups.");const i=(s.children||[]).find(d=>d?.type==="FACE"&&/:PROFILE$/.test(String(d?.name||"")));b(i,"Expected the sketch-style chamfer section to expose a :PROFILE face child."),b(Array.isArray(i?.edges)&&i.edges.length===3,`Expected the chamfer debug sketch profile to expose three boundary edges, received ${i?.edges?.length||0}.`),b(i.edges.every(d=>d?.userData?.auxEdge!==!0),"Expected chamfer debug sketch profile edges to behave like normal sketch boundaries.");const c=s?.userData?.sketchBasis;b(Array.isArray(c?.origin)&&Array.isArray(c?.x)&&Array.isArray(c?.y),"Expected chamfer debug sketch sections to expose a sketch basis.")}l(js,"test_cppChamfer_debug_sections_materialize_as_sketch_profiles");function Ft(e,t){const r=e[0]-t[0],n=e[1]-t[1],o=e[2]-t[2];return r*r+n*n+o*o}l(Ft,"pointDistanceSq");function Le(e,t,r=1e-12){if(Ft(e,t)>r*r)throw new Error(`Expected point ${JSON.stringify(e)} near ${JSON.stringify(t)} (eps=${r})`)}l(Le,"assertPointNear");async function zs(){const e=[[0,0,0],[1,.35,0],[2,-.5,0],[3,.45,0],[4,0,0]],t=gn(e,{fitStrength:1});if(!Array.isArray(t)||t.length!==e.length)throw new Error("Curve fit should return one output point per input point.");if(Le(t[0],e[0],1e-12),Le(t[t.length-1],e[e.length-1],1e-12),Wr(e,t))throw new Error("Fitted polyline should not locally reverse direction against the source edge.");let r=0;for(let o=1;o<e.length-1;o++)Ft(e[o],t[o])>1e-12&&r++;if(r<=0)throw new Error("At least one interior point should be snapped to the fitted curve.");const n=gn(e,{fitStrength:0});for(let o=0;o<e.length;o++)Le(n[o],e[o],1e-12)}l(zs,"test_edge_smooth_curve_fit");function Ro(e,t){const r=Array.isArray(e)?e:[],n=Array.isArray(t)?t:[],o=r.length;if(o!==n.length||o<3)return!0;for(let a=0;a<o;a++){const s=(a+1)%o,i=r[a],c=r[s],d=n[a],u=n[s],f=[c[0]-i[0],c[1]-i[1],c[2]-i[2]],p=[u[0]-d[0],u[1]-d[1],u[2]-d[2]],_=Math.hypot(f[0],f[1],f[2]),m=Math.hypot(p[0],p[1],p[2]);if(!(_>1e-12)||!(m>1e-12))continue;if((f[0]*p[0]+f[1]*p[1]+f[2]*p[2])/(_*m)<-1e-6)return!0}return!1}l(Ro,"hasLocalBacktrackingAgainstSourceClosed");async function Hs(){const e=[[1,0,0],[.45,.95,.02],[-.55,.8,-.03],[-1,0,0],[-.45,-.85,.03],[.55,-.75,-.02]],t=xn(e,{fitStrength:1});if(!Array.isArray(t)||t.length!==e.length)throw new Error("Closed-loop curve fit should return one output point per input point.");if(Ro(e,t))throw new Error("Closed-loop fitted polyline should not locally reverse direction.");let r=0;for(let o=0;o<e.length;o++)Ft(e[o],t[o])>1e-12&&r++;if(r<=0)throw new Error("Closed-loop fit should move at least one loop point.");const n=xn(e,{fitStrength:0});for(let o=0;o<e.length;o++)Le(n[o],e[o],1e-12)}l(Hs,"test_edge_smooth_curve_fit_closed_loop");async function Ys(){const e=[0,0,0,1,0,0,1,1,0,0,1,0],t=[0,1,2,0,2,3],r=new Map;r.set(1,{x:.2,y:.8,z:0,count:1});const n=Sa(e,t,r,{minArea2Ratio:.04,minNormalDot:.1,minArea2Abs:1e-24});if((Number(n?.movedVertices)||0)!==1)throw new Error("Constrained edge smoothing should move the target vertex.");if((Number(n?.constrainedVertices)||0)<=0)throw new Error("Constrained edge smoothing should scale back fold-causing targets.");const o=e[3],a=e[4];if(!Number.isFinite(o)||!Number.isFinite(a))throw new Error("Constrained edge smoothing produced invalid coordinates.");if(Math.abs(o-.2)<1e-9&&Math.abs(a-.8)<1e-9)throw new Error("Constrained smoothing should not apply a fold-causing target at full displacement.");const s=l((i,c,d)=>{const u=i*3,f=c*3,p=d*3,_=e[f+0]-e[u+0],m=e[f+1]-e[u+1],x=e[p+0]-e[u+0],E=e[p+1]-e[u+1];return _*E-m*x},"triNormalZ");if(!(s(0,1,2)>0))throw new Error("Primary triangle normal flipped after constrained smoothing.");if(!(s(0,2,3)>0))throw new Error("Adjacent triangle normal flipped after constrained smoothing.")}l(Ys,"test_edge_smooth_constraints_prevent_triangle_foldback");function qr(e,t={}){const r=!!t.closedLoop,n=Array.isArray(e)?e.map(s=>[s[0],s[1],s[2]]):[],o=[];for(const s of n)o.push(s[0],s[1],s[2]);const a=l((s,i)=>{const c=s.slice(),d=i.map(_=>[_[0],_[1],_[2]]),u={type:"EDGE",name:"MOCK_EDGE_0",userData:{faceA:"FACE_A",faceB:"FACE_B",polylineLocal:d.map(_=>[_[0],_[1],_[2]]),closedLoop:r},closedLoop:r,parent:null,parentSolid:null},f={type:"SOLID",name:"MOCK_SOLID",_vertProperties:c,_triVerts:[0,1,2,0,2,3,0,3,4],_triIDs:[0,0,0],_vertKeyToIndex:new Map,_dirty:!1,_faceIndex:null,_manifold:null,traverse(_){typeof _=="function"&&_(u)},visualize(){},_manifoldize(){},getBoundaryEdgePolylines(){return[{name:u.name,faceA:u.userData.faceA,faceB:u.userData.faceB,indices:d.map((_,m)=>m),positions:d.map(_=>[_[0],_[1],_[2]]),closedLoop:r}]},clone(){return a(c,d)}},p={type:"FACE",name:"MOCK_FACE_0",edges:[u],parent:f,parentSolid:f,userData:{faceName:"MOCK_FACE_0"}};return u.parent=f,u.parentSolid=f,f.__testFace=p,f},"createSolid");return a(o,n)}l(qr,"makeMockSolidFromPolyline");async function Xs(){const e=[[1,0,0],[.45,.95,.02],[-.55,.8,-.03],[-1,0,0],[-.45,-.85,.03],[.55,-.75,-.02]],t=qr(e,{closedLoop:!0}),r=new jr;r.inputParams={edges:[t],fitStrength:1,id:"EDGE_SMOOTH_CLOSED_LOOP_TEST"};const n=await r.run();if(!n||!Array.isArray(n.added)||n.added.length!==1)throw new Error("EdgeSmoothFeature should add one smoothed solid when selecting a closed-loop edge set.");if(!Array.isArray(n.removed)||n.removed.length!==1||n.removed[0]!==t)throw new Error("Closed-loop smoothing should replace exactly the selected source solid.");const o=n.added[0],a=Array.isArray(o?._vertProperties)?o._vertProperties:[];if(a.length<e.length*3)throw new Error("Closed-loop smoothing output is missing expected vertex properties.");const s=[];for(let c=0;c<e.length;c++){const d=c*3;s.push([a[d+0],a[d+1],a[d+2]])}if(Ro(e,s))throw new Error("Closed-loop feature smoothing should not create local edge backtracking.");let i=0;for(let c=0;c<e.length;c++)Ft(e[c],s[c])>1e-12&&i++;if(i<=0)throw new Error("Closed-loop feature smoothing should move at least one edge point.");if(!r.persistentData||r.persistentData.totalFittedEdges<1)throw new Error("Feature metadata should record the closed-loop edge as fitted.")}l(Xs,"test_edge_smooth_closed_loop_feature_selection");async function Ks(){const e=[[0,0,0],[1,.4,0],[2,-.45,0],[3,.35,0],[4,0,0]],t=qr(e),r=new jr;r.inputParams={edges:[t],fitStrength:1,id:"EDGE_SMOOTH_SOLID_TEST"};const n=await r.run();if(!n||!Array.isArray(n.added)||n.added.length!==1)throw new Error("EdgeSmoothFeature should add one smoothed solid when selecting a whole solid.");if(!Array.isArray(n.removed)||n.removed.length!==1||n.removed[0]!==t)throw new Error("EdgeSmoothFeature should remove exactly the selected source solid.");const o=n.added[0],a=Array.isArray(o?._vertProperties)?o._vertProperties:[];if(a.length<15)throw new Error("Smoothed solid is missing expected vertex properties.");const s=[];for(let c=0;c<5;c++){const d=c*3;s.push([a[d+0],a[d+1],a[d+2]])}if(Le(s[0],e[0],1e-12),Le(s[s.length-1],e[e.length-1],1e-12),Wr(e,s))throw new Error("Whole-solid smoothing should not create local edge backtracking.");let i=0;for(let c=1;c<e.length-1;c++)Ft(e[c],s[c])>1e-12&&i++;if(i<=0)throw new Error("Whole-solid smoothing should move at least one interior edge point.");if(!r.persistentData||r.persistentData.selectedSolidCount<1)throw new Error("Feature metadata should record at least one selected solid.")}l(Ks,"test_edge_smooth_whole_solid_selection");async function Js(){const e=[[0,0,0],[1,.3,0],[2,-.35,0],[3,.25,0],[4,0,0]],t=qr(e),r=t.__testFace;if(!r||r.type!=="FACE")throw new Error("Mock setup should provide a face selection target.");const n=new jr;n.inputParams={edges:[r],fitStrength:1,id:"EDGE_SMOOTH_FACE_TEST"};const o=await n.run();if(!o||!Array.isArray(o.added)||o.added.length!==1)throw new Error("EdgeSmoothFeature should add one smoothed solid when selecting a face.");if(!Array.isArray(o.removed)||o.removed.length!==1||o.removed[0]!==t)throw new Error("EdgeSmoothFeature should remove exactly the source solid for face selection.");const a=o.added[0],s=Array.isArray(a?._vertProperties)?a._vertProperties:[];if(s.length<15)throw new Error("Face-selected smoothing output is missing expected vertex properties.");const i=[];for(let c=0;c<5;c++){const d=c*3;i.push([s[d+0],s[d+1],s[d+2]])}if(Le(i[0],e[0],1e-12),Le(i[i.length-1],e[e.length-1],1e-12),Wr(e,i))throw new Error("Face-selected smoothing should not create local edge backtracking.");if(!n.persistentData||n.persistentData.selectedFaceCount<1)throw new Error("Feature metadata should record at least one selected face.")}l(Js,"test_edge_smooth_face_selection");const Ir=-4,Rr=15.7,Ot=1e-4,Zs=l(()=>({points:[{id:0,x:-2,y:-2,fixed:!0},{id:1,x:2,y:-2,fixed:!1},{id:2,x:2,y:2,fixed:!1},{id:3,x:-2,y:2,fixed:!1}],geometries:[{id:100,type:"line",points:[0,1],construction:!1},{id:101,type:"line",points:[1,2],construction:!1},{id:102,type:"line",points:[2,3],construction:!1},{id:103,type:"line",points:[3,0],construction:!1}],constraints:[{id:0,type:"⏚",points:[0]}]}),"makeRectSketch$3");function qs(e){const r=e?.geometry?.getAttribute?.("position");if(!r)return[];const n=[],o=new ae;for(let a=0;a<r.count;a++)o.set(r.getX(a),r.getY(a),r.getZ(a)).applyMatrix4(e.matrixWorld),n.push([o.x,o.y,o.z]);return n}l(qs,"collectWorldVerticesFromFaceObject");function Cn(e){const t=[];for(const r of Array.isArray(e)?e:[])Array.isArray(r?.p1)&&t.push(r.p1),Array.isArray(r?.p2)&&t.push(r.p2),Array.isArray(r?.p3)&&t.push(r.p3);return t}l(Cn,"collectTriangleVertices");function In(e,t,r){let n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,a=0,s=0;for(const i of e){const d=i[0]*t.x+i[1]*t.y+i[2]*t.z-r;d<n&&(n=d),d>o&&(o=d),a+=d,s+=1}return{mean:s?a/s:0,spread:s?o-n:0,count:s}}l(In,"analyzeProjectedOffsets");async function Qs(e){const t=await e.newFeature("P");t.inputParams.orientation="XY";const r=await e.newFeature("S");r.inputParams.sketchPlane=t.inputParams.featureID,r.persistentData.sketch=Zs();const n=await e.newFeature("E");return n.inputParams.profile=r.inputParams.featureID,n.inputParams.consumeProfileSketch=!1,n.inputParams.distance=Ir,n.inputParams.distanceBack=Rr,e}l(Qs,"test_extrude_negative_distance_cap_alignment");async function ei(e){const t=e.features.find(m=>m?.type==="E"),r=e.features.find(m=>m?.type==="S");if(!t?.inputParams?.featureID)throw new Error("[extrude-negative] missing extrude feature id");if(!r?.inputParams?.featureID)throw new Error("[extrude-negative] missing sketch feature id");const n=e.scene.getObjectByName(t.inputParams.featureID);if(!n||typeof n.getFaces!="function")throw new Error("[extrude-negative] extrude solid missing from scene");const o=e.scene.getObjectByName(r.inputParams.featureID),a=o?.children?.find?.(m=>m?.type==="FACE")||o?.children?.find?.(m=>m?.userData?.faceName);if(!a||typeof a.getAverageNormal!="function")throw new Error("[extrude-negative] profile face missing from sketch");const s=a.getAverageNormal().clone();if(s.lengthSq()<1e-20)throw new Error("[extrude-negative] profile normal is degenerate");s.normalize();const i=qs(a);if(!i.length)throw new Error("[extrude-negative] profile face has no vertices");const c=i.reduce((m,x)=>m+x[0]*s.x+x[1]*s.y+x[2]*s.z,0)/i.length,d=n.getFaces(!1),u=d.find(m=>String(m?.faceName||"").endsWith("_START")),f=d.find(m=>String(m?.faceName||"").endsWith("_END"));if(!u||!f){const m=d.map(x=>String(x?.faceName||""));throw new Error(`[extrude-negative] missing start/end caps. Faces: ${m.join(", ")}`)}const p=In(Cn(u.triangles),s,c),_=In(Cn(f.triangles),s,c);if(p.count===0||_.count===0)throw new Error("[extrude-negative] cap triangles are empty");if(p.spread>Ot)throw new Error(`[extrude-negative] start cap not planar on expected axis (spread=${p.spread})`);if(_.spread>Ot)throw new Error(`[extrude-negative] end cap not planar on expected axis (spread=${_.spread})`);if(Math.abs(p.mean- -Rr)>Ot)throw new Error(`[extrude-negative] start cap offset mismatch: got ${p.mean}, expected ${-Rr}`);if(Math.abs(_.mean-Ir)>Ot)throw new Error(`[extrude-negative] end cap offset mismatch: got ${_.mean}, expected ${Ir}`)}l(ei,"afterRun_extrude_negative_distance_cap_alignment");const ti="src/tests/partFiles/slowsketch.json";async function ri(e){const t=await M.promises.readFile(ti,"utf8");return await e.reset(),await e.fromJSON(t),e.currentHistoryStepId="E4",e}l(ri,"test_extrude_intersect_coplanar_face_merge");async function ni(e){const t=e.getObjectByName("E2");if(!t||typeof t.getFaceNames!="function")throw new Error("Expected intersect result solid E2 to exist after E4.");const r=new Set(t.getFaceNames()||[]);if(!r.has("E2:S1:PROFILE_START"))throw new Error("Expected E2:S1:PROFILE_START to survive the intersect result.");if(r.has("E4:S3:G9_SW"))throw new Error("Expected coplanar sidewall E4:S3:G9_SW to merge into E2:S1:PROFILE_START.");const n=t.getFaceMetadata?.("E2:S1:PROFILE_START")||{};if(n.faceType!=="STARTCAP"||n.sourceFeatureId!=="E2")throw new Error("Expected merged host face metadata on E2:S1:PROFILE_START to be preserved.");const o=t.getFace?.("E2:S1:PROFILE_START")||[];if(o.length<=42)throw new Error(`Expected merged host face to gain triangles from the coplanar fragment, got ${o.length}.`);console.log(`✓ E4 intersect merged coplanar sidewall into PROFILE_START (${o.length} triangles)`)}l(ni,"afterRun_extrude_intersect_coplanar_face_merge");function st(e,t){if(!e)throw new Error(t||"Assertion failed.")}l(st,"assert$q");async function oi(e){const t=await e.newFeature("P.CY"),r=String(t?.inputParams?.featureID||"");st(r,"Cylinder feature should have a featureID."),await e.runHistory();const n=e?.scene?.getObjectByName?.(r)||null;st(n,"Expected cylinder solid in the scene."),st(typeof n.getFaceMetadata=="function","Expected solid face metadata API.");const o=n.getFaceMetadata(`${r}_S`),a=n.getFaceMetadata(`${r}_T`);st(o?.sourceFeatureId===r,"Cylinder side face should be seeded with sourceFeatureId."),st(a?.sourceFeatureId===r,"Cylinder top face should be seeded with sourceFeatureId.")}l(oi,"test_face_source_feature_seed");async function ai(e){const t=await e.newFeature("P.CO");t.inputParams.radiusTop=3,t.inputParams.radiusBottom=.5,t.inputParams.height=5.2,t.inputParams.resolution=20;const r=await e.newFeature("E");return r.inputParams.profile=`${t.inputParams.featureID}_T`,r.inputParams.distance=0,r.inputParams.distanceBack=5,r.inputParams.boolean={targets:[t.inputParams.featureID],operation:"UNION"},e}l(ai,"test_ExtrudeFace");function xr(e,t){if(!e)throw new Error(t||"Assertion failed.")}l(xr,"assert$p");async function si(e){const t=await e.newFeature("P.CU");t.inputParams.id="FACE_EDGE_SRC",t.inputParams.sizeX=12,t.inputParams.sizeY=8,t.inputParams.sizeZ=10;const r=await e.newFeature("E");return r.inputParams.id="FACE_EDGE_EXTRUDE",r.inputParams.profile="FACE_EDGE_SRC_PY",r.inputParams.consumeProfileSketch=!0,r.inputParams.distance=4,r.inputParams.distanceBack=0,r.inputParams.boolean={targets:[],operation:"NONE"},e}l(si,"test_extrude_solid_face_uses_boundary_edge_sidewalls");async function ii(e){const t=(e?.scene?.children||[]).find(o=>o?.type==="SOLID"&&o.name==="FACE_EDGE_EXTRUDE");xr(t&&typeof t.getFaceNames=="function","[extrude-face-sidewalls] Expected extrude result solid.");const r=t.getFaceNames().map(o=>String(o||"")),n=r.filter(o=>o.startsWith("FACE_EDGE_EXTRUDE:")&&o.endsWith("_SW"));xr(n.length===4,`[extrude-face-sidewalls] Expected 4 boundary-edge sidewalls, found ${n.length}: ${n.join(", ")}`),xr(!r.includes("FACE_EDGE_EXTRUDE:FACE_EDGE_SRC_PY_SW"),"[extrude-face-sidewalls] Solid face extrusion should not collapse all boundary edges into the default sidewall.")}l(ii,"afterRun_extrude_solid_face_uses_boundary_edge_sidewalls");async function li(e){const t=await e.newFeature("P.CY");t.inputParams.radius=5,t.inputParams.height=10,t.inputParams.resolution=48;const r=await e.newFeature("F");return r.inputParams.edges=[`${t.inputParams.featureID}_T`],r.inputParams.radius=1,r.inputParams.direction="INSET",e}l(li,"test_Fillet");const ci="src/tests/partFiles/fillet_angle_test.BREP.json";async function di(e){const t=await M.promises.readFile(ci,"utf8");return await e.reset(),await e.fromJSON(t),e.expressions=`//Examples:
|
package/dist/assets/{dialogCapturePageFactory-C9unVBhR.js → dialogCapturePageFactory-B5p-TYIP.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var z=Object.defineProperty;var o=(e,t)=>z(e,"name",{value:t,configurable:!0});import{J as D}from"./featureDialogs-
|
|
1
|
+
var z=Object.defineProperty;var o=(e,t)=>z(e,"name",{value:t,configurable:!0});import{J as D}from"./featureDialogs-CnBa1DyN.js";let y=!1;const N="Dialogs are rendered live using SchemaForm. Use the automated capture script to export PNGs.";function O({title:e="Dialog Reference",description:t=N,entries:r=[]}={}){M();const l=document.getElementById("app")||document.body;l.classList.add("dialog-capture-page"),l.innerHTML="";const p=document.createElement("header");p.className="dialog-capture-header",p.innerHTML=`
|
|
2
2
|
<h1>${w(e)}</h1>
|
|
3
3
|
<p>${w(t||N)}</p>
|
|
4
4
|
`;const m=document.createElement("section");m.className="dialog-capture-grid",r.forEach(a=>{const c=h(a?.displayName,"Dialog"),b=h(a?.shortName,c||"Dialog"),C=a?.captureName?h(a.captureName,c):c,S=x(a?.initialParams)||{},j=F(a?.schema),k=a?.formOptions&&typeof a.formOptions=="object"?a.formOptions:void 0;let n=null;try{const s=new D(j,S,k);try{s.refreshFromParams?.()}catch{}n=s.uiElement;try{n&&(n.style.width="100%",n.style.maxWidth="100%")}catch{}}catch(s){n=E(s)}const i=document.createElement("article");i.className="dialog-card",i.dataset.featureName=C,i.dataset.featureShortName=b;const g=document.createElement("div");g.className="dialog-card-head";const f=document.createElement("span");f.className="dialog-short",f.textContent=b;const u=document.createElement("h2");u.className="dialog-title",u.textContent=c,g.append(f,u);const d=document.createElement("div");d.className="dialog-form",n?d.appendChild(n):d.appendChild(E(new Error("Form host missing"))),i.append(g,d),m.appendChild(i)}),l.append(p,m)}o(O,"renderDialogCapturePage");function F(e){return!e||typeof e!="object"?{}:e}o(F,"sanitizeSchema");function h(e,t=""){if(e==null&&e!==0)return t;const r=String(e).trim();return r.length?r:t}o(h,"formatName");function x(e){if(Array.isArray(e))return e.map(t=>x(t));if(e&&typeof e=="object"){const t={};for(const r of Object.keys(e))t[r]=x(e[r]);return t}return e}o(x,"clone");function E(e){const t=document.createElement("div");return t.className="dialog-error",t.textContent=`Failed to render: ${e?.message||e||"Unknown error"}`,t}o(E,"buildErrorState");function w(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}o(w,"escapeHtml");function M(){if(y)return;y=!0;const e=document.createElement("style");e.textContent=`
|