brep-io-kernel 1.0.165 → 1.0.166

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.
Files changed (47) hide show
  1. package/dist/apiExamples/BREP_Booleans.html +2 -2
  2. package/dist/apiExamples/BREP_Export.html +2 -2
  3. package/dist/apiExamples/BREP_Primitives.html +2 -2
  4. package/dist/apiExamples/BREP_Transforms.html +2 -2
  5. package/dist/apiExamples/Embeded_2D_Sketcher.html +2 -2
  6. package/dist/apiExamples/Embeded_CAD.html +2 -2
  7. package/dist/apiExamples/Embeded_CAD_Integration_Test.html +2 -2
  8. package/dist/assembly-constraint-capture.html +5 -5
  9. package/dist/assets/{AnnotationRegistry-CXzWv0O4.js → AnnotationRegistry-0p-JvbWc.js} +1 -1
  10. package/dist/assets/{AssemblyConstraintRegistry-B9zYtUPa.js → AssemblyConstraintRegistry-D_je-ie-.js} +1 -1
  11. package/dist/assets/{FeatureRegistry-C8QUptOR.js → FeatureRegistry-CbzxapvH.js} +3 -3
  12. package/dist/assets/{PartHistory-BT0SV2I5.js → PartHistory-CpTryl-X.js} +1 -1
  13. package/dist/assets/{Tube-OTYPNFqf.js → Tube-BXbVhwOj.js} +1 -1
  14. package/dist/assets/{annUtils-DooqNh7u.js → annUtils-DcxkV20w.js} +1 -1
  15. package/dist/assets/{apiExample_BREP_Booleans-DX0mDm5o.js → apiExample_BREP_Booleans-Bzu4TbBN.js} +1 -1
  16. package/dist/assets/{apiExample_BREP_Export-DbPRP7aB.js → apiExample_BREP_Export-CqSlAGR2.js} +1 -1
  17. package/dist/assets/{apiExample_BREP_Primitives-Ck5Bs5_N.js → apiExample_BREP_Primitives-BTFxPM-7.js} +1 -1
  18. package/dist/assets/{apiExample_BREP_Transforms-dRWUyTjs.js → apiExample_BREP_Transforms-OLb25wNp.js} +1 -1
  19. package/dist/assets/{apiExample_Embeded_2D_Sketcher-mq3UXNnH.js → apiExample_Embeded_2D_Sketcher-ioZryvFJ.js} +1 -1
  20. package/dist/assets/{apiExample_Embeded_CAD-DmG27xiK.js → apiExample_Embeded_CAD-enaf0P7w.js} +1 -1
  21. package/dist/assets/{apiExample_Embeded_CAD_Integration_Test-BkLtONsP.js → apiExample_Embeded_CAD_Integration_Test-qsIfYhe5.js} +1 -1
  22. package/dist/assets/{assemblyConstraintDialogs-Bp6JwQGM.js → assemblyConstraintDialogs-DOrF7vUw.js} +1 -1
  23. package/dist/assets/{brep-kernel-Cy1Y5Ou0.js → brep-kernel-CwgaO_st.js} +12 -12
  24. package/dist/assets/{browserTests-DyOFL-SK.js → browserTests-BUklfMO3.js} +12 -12
  25. package/dist/assets/{chamfer-CQEYwOuD.js → chamfer-DRqXmQEN.js} +1 -1
  26. package/dist/assets/{dialogCapturePageFactory-C8ZgGbz3.js → dialogCapturePageFactory-DHAJd9no.js} +1 -1
  27. package/dist/assets/{featureDialogs-CTxnmH67.js → featureDialogs-CDtV5J5B.js} +1 -1
  28. package/dist/assets/{featureDialogs-Dw07GP5f.js → featureDialogs-DEpvCr2m.js} +24 -24
  29. package/dist/assets/{fillet-C6-sxYCV.js → fillet-D-ZkRPFl.js} +1 -1
  30. package/dist/assets/{index.es-DgjLCvnw.js → index.es-Bj8hUP_M.js} +1 -1
  31. package/dist/assets/{javascript-CoXQsEOO.js → javascript-ClNCyVlO.js} +1 -1
  32. package/dist/assets/{main-cad-BxSaytVM.js → main-cad-IYyl4fag.js} +6 -6
  33. package/dist/assets/{pmiDialogs-BzGjz4Z4.js → pmiDialogs-CtAI9GYO.js} +1 -1
  34. package/dist/assets/{test-BubuSRs4.js → test-DDWa8W9C.js} +3 -3
  35. package/dist/cad.html +10 -10
  36. package/dist/feature-dialog-capture.html +7 -7
  37. package/dist/pmi-dialog-capture.html +5 -5
  38. package/dist/test.html +1 -1
  39. package/dist/viewer.html +10 -10
  40. package/dist-kernel/brep-kernel.js +4098 -4095
  41. package/package.json +1 -1
  42. package/src/BREP/SolidMethods/fillet.js +1 -1
  43. package/src/BREP/SolidMethods/transforms.js +8 -3
  44. package/src/BREP/fillets/fillet.js +4 -4
  45. package/src/tests/test_fillet_corner_bridge.js +16 -12
  46. package/src/tests/test_fillet_nonClosed.js +15 -14
  47. package/src/tests/test_sheetMetal_corner_fillet_compound_reference.js +11 -8
@@ -1 +1 @@
1
- var be=Object.defineProperty;var g=(e,c)=>be(e,"name",{value:c,configurable:!0});import{aD as Se,be as G,V as y,bh as B,d as Ae,L as pe,e as xe}from"./featureDialogs-Dw07GP5f.js";import"./browserStorage-CvgF8ovw.js";import"./preload-helper-ZNr0Qq7Q.js";const k=class k extends Se{constructor({edgeToChamfer:c,distance:n=1,sampleCount:o=50,snapSeamToEdge:t=!0,sideStripSubdiv:i=8,seamInsetScale:s=.001,direction:l="INSET",inflate:r=0,flipSide:h=!1,debug:f=!1,debugStride:a=12}){super(),this.edgeToChamfer=c,this.distance=Math.max(1e-9,n),this.sampleCount=Math.max(8,o|0),this.snapSeamToEdge=!!t,this.sideStripSubdiv=Math.max(1,i|0),this.seamInsetScale=Number.isFinite(s)?s:.001,this.direction=(l||"INSET").toUpperCase(),this.inflate=Number.isFinite(r)?r:0,this.flipSide=!!h,this.debug=!!f,this.debugStride=Math.max(1,a|0),this._debugObjects=[],this.operationTargetSolid=null,this.generate()}generate(){if(this.edgeToChamfer&&this.edgeToChamfer.parent)this.operationTargetSolid=this.edgeToChamfer.parent;else throw new Error("Edge must be part of a solid");if(this._debugObjects?.length){const m=this.operationTargetSolid?.parent;if(m)for(const b of this._debugObjects)m.remove(b);this._debugObjects.length=0}const c=this.operationTargetSolid,n=this.edgeToChamfer.faces?.[0],o=this.edgeToChamfer.faces?.[1];if(!n||!o)throw new Error("ChamferSolid: edge must have two adjacent faces.");const t=this.edgeToChamfer.userData?.polylineLocal;if(!Array.isArray(t)||t.length<2)throw new Error("ChamferSolid: edge polyline missing.");const i=G(c,n.name),s=G(c,o.name),l=!!(this.edgeToChamfer.closedLoop||this.edgeToChamfer.userData?.closedLoop);let r;if(this.snapSeamToEdge){const m=t.slice();if(l&&m.length>2){const b=m[0],M=m[m.length-1];b&&M&&b[0]===M[0]&&b[1]===M[1]&&b[2]===M[2]&&m.pop()}r=m}else r=we(t,this.sampleCount,l);const h=[],f=[],a=[],u=[],x=[],d=[],S=r.length/2|0,A=T(r[S]),p=T(r[Math.max(0,S-1)]),v=T(r[Math.min(r.length-1,S+1)]),V=new y().subVectors(v,p).normalize(),C=B(c,n.name,A)||i,L=B(c,o.name,A)||s,ce=C.clone().cross(V).normalize(),re=L.clone().cross(V).normalize(),E=C.clone().add(L);E.lengthSq()>0&&E.normalize();const D=this.direction==="OUTSET"?1:-1,le=ne(ce.dot(E)),ie=ne(re.dot(E)),ae=D*le,he=D*ie,N=this.flipSide?-1:1,R=ae*N,U=he*N;for(let m=0;m<r.length;m++){const b=T(r[m]),M=T(l?r[(m-1+r.length)%r.length]:r[Math.max(0,m-1)]),fe=T(l?r[(m+1)%r.length]:r[Math.min(r.length-1,m+1)]),z=new y().subVectors(fe,M);if(z.lengthSq()<1e-14)continue;z.normalize();const Z=(B(c,n.name,b)||i).clone(),J=(B(c,o.name,b)||s).clone();let q=Z.clone().cross(z),_=J.clone().cross(z);if(q.lengthSq()<1e-12||_.lengthSq()<1e-12)continue;q.normalize(),_.normalize();const K=b.clone().addScaledVector(q,R*this.distance),Q=b.clone().addScaledVector(_,U*this.distance);if(h.push(b.clone()),f.push(K),a.push(Q),u.push(Z.normalize()),x.push(J.normalize()),d.push(z.clone()),this.debug&&m%this.debugStride===0){const X=this.operationTargetSolid?.parent;if(X){const j=g((ue,de,ge)=>{const me=new Ae().setFromPoints([ue,de]),ye=new pe({color:ge}),$=new xe(me,ye);$.renderOrder=10,X.add($),this._debugObjects.push($)},"addLine"),Y=Math.max(.4*this.distance,.001);j(b,b.clone().addScaledVector(q,Y*R),65535),j(b,b.clone().addScaledVector(_,Y*U),16776960),j(K,Q,16711935)}}}ve({railP:h,railA:f,railB:a,normalsA:u,normalsB:x,tangents:d,isClosed:l});const H=!!l,P=`CHAMFER_${n.name}|${o.name}`;let I=h,F=f,O=a;if(Math.abs(this.inflate)>1e-12){const m=Be({railP:h,railA:f,railB:a,normalsA:u,normalsB:x,tangents:d,inflate:this.inflate});m&&(I=m.railP,F=m.railA,O=m.railB)}Te([I,F,O],H),Ie(this,P,I,F,O,H);const W=1e-4;this.pushFace(`${P}_CAP0`,W),this.pushFace(`${P}_CAP1`,W)}};g(k,"ChamferSolid");let ee=k;function T(e){return new y(e[0],e[1],e[2])}g(T,"arrToV");function w(e){return[e.x,e.y,e.z]}g(w,"vToArr");function we(e,c,n){if(!Array.isArray(e)||e.length<2)return e;const o=e.map(T);n&&o.push(o[0].clone());const t=se(o),i=[];for(let s=0;s<c;s++){const r=s/(c-1)*t,h=_e(o,r);i.push([h.x,h.y,h.z])}return i}g(we,"resamplePolyline3");function ne(e){return e>=0?1:-1}g(ne,"signNonZero");function se(e){let c=0;for(let n=1;n<e.length;n++)c+=e[n].distanceTo(e[n-1]);return c}g(se,"polylineLength");function Te(e,c){if(c||!Array.isArray(e)||e.length===0)return;const n=e[0]?.length||0;if(n<4)return;for(const t of e)if(!Array.isArray(t)||t.length!==n)return;const o=Math.min(4096,n*n*e.length);for(let t=0;t<o;t++){let i=null;for(let s=0;s<e.length;s++){const l=Ce(e[s]);l&&(!i||l.i<i.i||l.i===i.i&&l.j<i.j)&&(i={...l})}if(!i)break;Me(e,i)}}g(Te,"resolveChamferSelfIntersections");function Ce(e){const c=ze(e);if(!c)return null;const n=c.planar,o=n.length;if(o<4)return null;for(let t=0;t<o-3;t++){const i=n[t],s=n[t+1];for(let l=t+2;l<o-1;l++){if(l===t+1)continue;const r=n[l],h=n[l+1],f=Le(i,s,r,h);if(f)return{i:t,j:l,t:te(f.t),u:te(f.u)}}}return null}g(Ce,"nextRailSelfIntersection");function Me(e,{i:c,j:n,t:o,u:t}){if(!(n>c+1))return;const i=n-c;for(const s of e)if(!Array.isArray(s)||s.length<=n)return;for(const s of e){const l=Ve(s,c,o,n,t);s.splice(c+1,i,l)}}g(Me,"collapseRailsAtIntersection");function Ve(e,c,n,o,t){const i=e[c],s=e[c+1],l=e[o],r=e[o+1];if(!i||!s||!l||!r)return i?i.clone():new y;const h=i.clone().lerp(s,n),f=l.clone().lerp(r,t);return h.add(f).multiplyScalar(.5)}g(Ve,"averagePointOnSegments");function Le(e,c,n,o,t=1e-12){const i={x:c.x-e.x,y:c.y-e.y},s={x:o.x-n.x,y:o.y-n.y},l=i.x*s.y-i.y*s.x;if(Math.abs(l)<t)return null;const r=n.x-e.x,h=n.y-e.y,f=(r*s.y-h*s.x)/l,a=(r*i.y-h*i.x)/l;return f>=-t&&f<=1+t&&a>=-t&&a<=1+t?{t:f,u:a}:null}g(Le,"segmentIntersection2D");function te(e){return Math.max(0,Math.min(1,e))}g(te,"clamp01");function ze(e){if(!Array.isArray(e)||e.length<2)return null;const c=e[0].clone();let n=null;for(let r=1;r<e.length;r++){const h=e[r].clone().sub(c);if(h.lengthSq()>1e-12){n=h.normalize();break}}if(!n)return null;const o=new y,t=new y,i=new y;for(let r=0;r<e.length-2;r++){t.subVectors(e[r+1],e[r]),i.subVectors(e[r+2],e[r+1]);const h=new y().crossVectors(t,i);h.lengthSq()>1e-16&&o.add(h)}if(o.lengthSq()<1e-16){const r=Math.abs(n.x)<.9?new y(1,0,0):new y(0,1,0);o.crossVectors(n,r),o.lengthSq()<1e-16&&o.set(0,0,1)}o.normalize();const s=new y().crossVectors(o,n);if(s.lengthSq()<1e-16)return null;s.normalize();const l=e.map(r=>{const h=r.clone().sub(c);return{x:h.dot(n),y:h.dot(s)}});return{origin:c,axisU:n,axisV:s,planar:l}}g(ze,"projectPolylineToPlane");function ve({railP:e,railA:c,railB:n,normalsA:o,normalsB:t,tangents:i,isClosed:s}){const l=Ee(e,s);if(!l)return;const r=g(h=>{if(!Array.isArray(h)||h.length!==l.length)return;const f=new Array(l.length);for(let a=0;a<l.length;a++)f[a]=h[l[a]];h.length=0;for(const a of f)h.push(a)},"apply");r(e),r(c),r(n),r(o),r(t),r(i)}g(ve,"reorderChamferRailSamples");function Ee(e,c){if(c||!Array.isArray(e)||e.length<3)return null;const n=e[0],o=e[e.length-1];if(!n||!o||n.distanceTo(o)<1e-9)return null;const t=e.length,i=new Array(t).fill(!1),s=[],l=g(u=>{s.push(u),i[u]=!0},"pushIdx");for(l(0),i[t-1]=!0;s.length<t-1;){const u=e[s[s.length-1]];if(!u)break;let x=-1,d=1/0;for(let S=1;S<t-1;S++){if(i[S])continue;const A=e[S];if(!A)continue;const p=u.distanceTo(A);p<d&&(d=p,x=S)}if(x===-1)break;l(x)}if(s.push(t-1),s.length!==t)return null;let r=!1;for(let u=0;u<t;u++)if(s[u]!==u){r=!0;break}if(!r)return null;const h=se(e),f=qe(e,s),a=Math.max(1e-6,h*1e-4);return f+a<h?s:null}g(Ee,"computeChamferRailOrder");function qe(e,c){if(!Array.isArray(e)||!Array.isArray(c)||c.length<2)return 0;let n=0;for(let o=1;o<c.length;o++){const t=e[c[o-1]],i=e[c[o]];!t||!i||(n+=t.distanceTo(i))}return n}g(qe,"polylineLengthFromOrder");function _e(e,c){let n=0;for(let o=1;o<e.length;o++){const t=e[o].distanceTo(e[o-1]);if(n+t>=c){const i=(c-n)/t;return new y().lerpVectors(e[o-1],e[o],i)}n+=t}return e[e.length-1].clone()}g(_e,"pointAtArcLength");function Be({railP:e,railA:c,railB:n,normalsA:o,normalsB:t,tangents:i,inflate:s}){if(!Number.isFinite(s)||s===0)return null;const l=Math.min(e.length,c.length,n.length,o.length,t.length,i.length);if(l<2)return null;const r=new Array(l),h=new Array(l),f=new Array(l),a=new y,u=new y,x=new y;for(let d=0;d<l;d++){const S=e[d],A=c[d],p=n[d],v=o[d],V=t[d];if(r[d]=Pe(S,v,V,s),!A||!p){h[d]=A?A.clone():new y,f[d]=p?p.clone():new y;continue}const C=i[d];if(!C||C.lengthSq()<1e-14){h[d]=A.clone(),f[d]=p.clone();continue}if(x.copy(C).normalize(),a.copy(p).sub(A),a.lengthSq()<1e-18){h[d]=A.clone(),f[d]=p.clone();continue}u.crossVectors(a,x);const L=u.length();if(L<1e-18){h[d]=A.clone(),f[d]=p.clone();continue}u.multiplyScalar(1/L),h[d]=oe(A,v,u,s),f[d]=oe(p,V,u,s)}return{railP:r,railA:h,railB:f}}g(Be,"inflateChamferRails");function Pe(e,c,n,o){if(!e)return new y;if(!c||!n)return e.clone();const t=c.clone().normalize(),i=n.clone().normalize(),s=t.clone().add(i),l=1+t.dot(i);return Math.abs(l)<1e-9||s.lengthSq()<1e-18?e.clone():e.clone().addScaledVector(s,o/l)}g(Pe,"shiftEdgePoint");function oe(e,c,n,o){if(!e)return new y;if(!c||!n)return e.clone();const t=c.clone().normalize(),i=n.clone().normalize(),s=t.sub(i.clone().multiplyScalar(i.dot(t))),l=s.lengthSq();return l<1e-18?e.clone():e.clone().addScaledVector(s,o/l)}g(oe,"translatePointWithinPlane");function Ie(e,c,n,o,t,i){const s=Math.min(n.length,o.length,t.length);if(s<2)return;const l=`${c}_SIDE_A`,r=`${c}_SIDE_B`,h=`${c}_BEVEL`,f=g((a,u,x,d,S)=>{e.addTriangle(a,w(u),w(d),w(S)),e.addTriangle(a,w(u),w(S),w(x))},"link");for(let a=0;a<s-1;a++)f(l,n[a],n[a+1],o[a],o[a+1]),f(r,n[a],n[a+1],t[a],t[a+1]),f(h,o[a],o[a+1],t[a],t[a+1]);if(i){const a=s-1,u=0;f(l,n[a],n[u],o[a],o[u]),f(r,n[a],n[u],t[a],t[u]),f(h,o[a],o[u],t[a],t[u])}else e.addTriangle(`${c}_CAP0`,w(n[0]),w(o[0]),w(t[0])),e.addTriangle(`${c}_CAP1`,w(n[s-1]),w(t[s-1]),w(o[s-1]))}g(Ie,"buildChamferPrismNamed");export{ee as ChamferSolid};
1
+ var be=Object.defineProperty;var g=(e,c)=>be(e,"name",{value:c,configurable:!0});import{aD as Se,be as G,V as y,bh as B,d as Ae,L as pe,e as xe}from"./featureDialogs-DEpvCr2m.js";import"./browserStorage-CvgF8ovw.js";import"./preload-helper-ZNr0Qq7Q.js";const k=class k extends Se{constructor({edgeToChamfer:c,distance:n=1,sampleCount:o=50,snapSeamToEdge:t=!0,sideStripSubdiv:i=8,seamInsetScale:s=.001,direction:l="INSET",inflate:r=0,flipSide:h=!1,debug:f=!1,debugStride:a=12}){super(),this.edgeToChamfer=c,this.distance=Math.max(1e-9,n),this.sampleCount=Math.max(8,o|0),this.snapSeamToEdge=!!t,this.sideStripSubdiv=Math.max(1,i|0),this.seamInsetScale=Number.isFinite(s)?s:.001,this.direction=(l||"INSET").toUpperCase(),this.inflate=Number.isFinite(r)?r:0,this.flipSide=!!h,this.debug=!!f,this.debugStride=Math.max(1,a|0),this._debugObjects=[],this.operationTargetSolid=null,this.generate()}generate(){if(this.edgeToChamfer&&this.edgeToChamfer.parent)this.operationTargetSolid=this.edgeToChamfer.parent;else throw new Error("Edge must be part of a solid");if(this._debugObjects?.length){const m=this.operationTargetSolid?.parent;if(m)for(const b of this._debugObjects)m.remove(b);this._debugObjects.length=0}const c=this.operationTargetSolid,n=this.edgeToChamfer.faces?.[0],o=this.edgeToChamfer.faces?.[1];if(!n||!o)throw new Error("ChamferSolid: edge must have two adjacent faces.");const t=this.edgeToChamfer.userData?.polylineLocal;if(!Array.isArray(t)||t.length<2)throw new Error("ChamferSolid: edge polyline missing.");const i=G(c,n.name),s=G(c,o.name),l=!!(this.edgeToChamfer.closedLoop||this.edgeToChamfer.userData?.closedLoop);let r;if(this.snapSeamToEdge){const m=t.slice();if(l&&m.length>2){const b=m[0],M=m[m.length-1];b&&M&&b[0]===M[0]&&b[1]===M[1]&&b[2]===M[2]&&m.pop()}r=m}else r=we(t,this.sampleCount,l);const h=[],f=[],a=[],u=[],x=[],d=[],S=r.length/2|0,A=T(r[S]),p=T(r[Math.max(0,S-1)]),v=T(r[Math.min(r.length-1,S+1)]),V=new y().subVectors(v,p).normalize(),C=B(c,n.name,A)||i,L=B(c,o.name,A)||s,ce=C.clone().cross(V).normalize(),re=L.clone().cross(V).normalize(),E=C.clone().add(L);E.lengthSq()>0&&E.normalize();const D=this.direction==="OUTSET"?1:-1,le=ne(ce.dot(E)),ie=ne(re.dot(E)),ae=D*le,he=D*ie,N=this.flipSide?-1:1,R=ae*N,U=he*N;for(let m=0;m<r.length;m++){const b=T(r[m]),M=T(l?r[(m-1+r.length)%r.length]:r[Math.max(0,m-1)]),fe=T(l?r[(m+1)%r.length]:r[Math.min(r.length-1,m+1)]),z=new y().subVectors(fe,M);if(z.lengthSq()<1e-14)continue;z.normalize();const Z=(B(c,n.name,b)||i).clone(),J=(B(c,o.name,b)||s).clone();let q=Z.clone().cross(z),_=J.clone().cross(z);if(q.lengthSq()<1e-12||_.lengthSq()<1e-12)continue;q.normalize(),_.normalize();const K=b.clone().addScaledVector(q,R*this.distance),Q=b.clone().addScaledVector(_,U*this.distance);if(h.push(b.clone()),f.push(K),a.push(Q),u.push(Z.normalize()),x.push(J.normalize()),d.push(z.clone()),this.debug&&m%this.debugStride===0){const X=this.operationTargetSolid?.parent;if(X){const j=g((ue,de,ge)=>{const me=new Ae().setFromPoints([ue,de]),ye=new pe({color:ge}),$=new xe(me,ye);$.renderOrder=10,X.add($),this._debugObjects.push($)},"addLine"),Y=Math.max(.4*this.distance,.001);j(b,b.clone().addScaledVector(q,Y*R),65535),j(b,b.clone().addScaledVector(_,Y*U),16776960),j(K,Q,16711935)}}}ve({railP:h,railA:f,railB:a,normalsA:u,normalsB:x,tangents:d,isClosed:l});const H=!!l,P=`CHAMFER_${n.name}|${o.name}`;let I=h,F=f,O=a;if(Math.abs(this.inflate)>1e-12){const m=Be({railP:h,railA:f,railB:a,normalsA:u,normalsB:x,tangents:d,inflate:this.inflate});m&&(I=m.railP,F=m.railA,O=m.railB)}Te([I,F,O],H),Ie(this,P,I,F,O,H);const W=1e-4;this.pushFace(`${P}_CAP0`,W),this.pushFace(`${P}_CAP1`,W)}};g(k,"ChamferSolid");let ee=k;function T(e){return new y(e[0],e[1],e[2])}g(T,"arrToV");function w(e){return[e.x,e.y,e.z]}g(w,"vToArr");function we(e,c,n){if(!Array.isArray(e)||e.length<2)return e;const o=e.map(T);n&&o.push(o[0].clone());const t=se(o),i=[];for(let s=0;s<c;s++){const r=s/(c-1)*t,h=_e(o,r);i.push([h.x,h.y,h.z])}return i}g(we,"resamplePolyline3");function ne(e){return e>=0?1:-1}g(ne,"signNonZero");function se(e){let c=0;for(let n=1;n<e.length;n++)c+=e[n].distanceTo(e[n-1]);return c}g(se,"polylineLength");function Te(e,c){if(c||!Array.isArray(e)||e.length===0)return;const n=e[0]?.length||0;if(n<4)return;for(const t of e)if(!Array.isArray(t)||t.length!==n)return;const o=Math.min(4096,n*n*e.length);for(let t=0;t<o;t++){let i=null;for(let s=0;s<e.length;s++){const l=Ce(e[s]);l&&(!i||l.i<i.i||l.i===i.i&&l.j<i.j)&&(i={...l})}if(!i)break;Me(e,i)}}g(Te,"resolveChamferSelfIntersections");function Ce(e){const c=ze(e);if(!c)return null;const n=c.planar,o=n.length;if(o<4)return null;for(let t=0;t<o-3;t++){const i=n[t],s=n[t+1];for(let l=t+2;l<o-1;l++){if(l===t+1)continue;const r=n[l],h=n[l+1],f=Le(i,s,r,h);if(f)return{i:t,j:l,t:te(f.t),u:te(f.u)}}}return null}g(Ce,"nextRailSelfIntersection");function Me(e,{i:c,j:n,t:o,u:t}){if(!(n>c+1))return;const i=n-c;for(const s of e)if(!Array.isArray(s)||s.length<=n)return;for(const s of e){const l=Ve(s,c,o,n,t);s.splice(c+1,i,l)}}g(Me,"collapseRailsAtIntersection");function Ve(e,c,n,o,t){const i=e[c],s=e[c+1],l=e[o],r=e[o+1];if(!i||!s||!l||!r)return i?i.clone():new y;const h=i.clone().lerp(s,n),f=l.clone().lerp(r,t);return h.add(f).multiplyScalar(.5)}g(Ve,"averagePointOnSegments");function Le(e,c,n,o,t=1e-12){const i={x:c.x-e.x,y:c.y-e.y},s={x:o.x-n.x,y:o.y-n.y},l=i.x*s.y-i.y*s.x;if(Math.abs(l)<t)return null;const r=n.x-e.x,h=n.y-e.y,f=(r*s.y-h*s.x)/l,a=(r*i.y-h*i.x)/l;return f>=-t&&f<=1+t&&a>=-t&&a<=1+t?{t:f,u:a}:null}g(Le,"segmentIntersection2D");function te(e){return Math.max(0,Math.min(1,e))}g(te,"clamp01");function ze(e){if(!Array.isArray(e)||e.length<2)return null;const c=e[0].clone();let n=null;for(let r=1;r<e.length;r++){const h=e[r].clone().sub(c);if(h.lengthSq()>1e-12){n=h.normalize();break}}if(!n)return null;const o=new y,t=new y,i=new y;for(let r=0;r<e.length-2;r++){t.subVectors(e[r+1],e[r]),i.subVectors(e[r+2],e[r+1]);const h=new y().crossVectors(t,i);h.lengthSq()>1e-16&&o.add(h)}if(o.lengthSq()<1e-16){const r=Math.abs(n.x)<.9?new y(1,0,0):new y(0,1,0);o.crossVectors(n,r),o.lengthSq()<1e-16&&o.set(0,0,1)}o.normalize();const s=new y().crossVectors(o,n);if(s.lengthSq()<1e-16)return null;s.normalize();const l=e.map(r=>{const h=r.clone().sub(c);return{x:h.dot(n),y:h.dot(s)}});return{origin:c,axisU:n,axisV:s,planar:l}}g(ze,"projectPolylineToPlane");function ve({railP:e,railA:c,railB:n,normalsA:o,normalsB:t,tangents:i,isClosed:s}){const l=Ee(e,s);if(!l)return;const r=g(h=>{if(!Array.isArray(h)||h.length!==l.length)return;const f=new Array(l.length);for(let a=0;a<l.length;a++)f[a]=h[l[a]];h.length=0;for(const a of f)h.push(a)},"apply");r(e),r(c),r(n),r(o),r(t),r(i)}g(ve,"reorderChamferRailSamples");function Ee(e,c){if(c||!Array.isArray(e)||e.length<3)return null;const n=e[0],o=e[e.length-1];if(!n||!o||n.distanceTo(o)<1e-9)return null;const t=e.length,i=new Array(t).fill(!1),s=[],l=g(u=>{s.push(u),i[u]=!0},"pushIdx");for(l(0),i[t-1]=!0;s.length<t-1;){const u=e[s[s.length-1]];if(!u)break;let x=-1,d=1/0;for(let S=1;S<t-1;S++){if(i[S])continue;const A=e[S];if(!A)continue;const p=u.distanceTo(A);p<d&&(d=p,x=S)}if(x===-1)break;l(x)}if(s.push(t-1),s.length!==t)return null;let r=!1;for(let u=0;u<t;u++)if(s[u]!==u){r=!0;break}if(!r)return null;const h=se(e),f=qe(e,s),a=Math.max(1e-6,h*1e-4);return f+a<h?s:null}g(Ee,"computeChamferRailOrder");function qe(e,c){if(!Array.isArray(e)||!Array.isArray(c)||c.length<2)return 0;let n=0;for(let o=1;o<c.length;o++){const t=e[c[o-1]],i=e[c[o]];!t||!i||(n+=t.distanceTo(i))}return n}g(qe,"polylineLengthFromOrder");function _e(e,c){let n=0;for(let o=1;o<e.length;o++){const t=e[o].distanceTo(e[o-1]);if(n+t>=c){const i=(c-n)/t;return new y().lerpVectors(e[o-1],e[o],i)}n+=t}return e[e.length-1].clone()}g(_e,"pointAtArcLength");function Be({railP:e,railA:c,railB:n,normalsA:o,normalsB:t,tangents:i,inflate:s}){if(!Number.isFinite(s)||s===0)return null;const l=Math.min(e.length,c.length,n.length,o.length,t.length,i.length);if(l<2)return null;const r=new Array(l),h=new Array(l),f=new Array(l),a=new y,u=new y,x=new y;for(let d=0;d<l;d++){const S=e[d],A=c[d],p=n[d],v=o[d],V=t[d];if(r[d]=Pe(S,v,V,s),!A||!p){h[d]=A?A.clone():new y,f[d]=p?p.clone():new y;continue}const C=i[d];if(!C||C.lengthSq()<1e-14){h[d]=A.clone(),f[d]=p.clone();continue}if(x.copy(C).normalize(),a.copy(p).sub(A),a.lengthSq()<1e-18){h[d]=A.clone(),f[d]=p.clone();continue}u.crossVectors(a,x);const L=u.length();if(L<1e-18){h[d]=A.clone(),f[d]=p.clone();continue}u.multiplyScalar(1/L),h[d]=oe(A,v,u,s),f[d]=oe(p,V,u,s)}return{railP:r,railA:h,railB:f}}g(Be,"inflateChamferRails");function Pe(e,c,n,o){if(!e)return new y;if(!c||!n)return e.clone();const t=c.clone().normalize(),i=n.clone().normalize(),s=t.clone().add(i),l=1+t.dot(i);return Math.abs(l)<1e-9||s.lengthSq()<1e-18?e.clone():e.clone().addScaledVector(s,o/l)}g(Pe,"shiftEdgePoint");function oe(e,c,n,o){if(!e)return new y;if(!c||!n)return e.clone();const t=c.clone().normalize(),i=n.clone().normalize(),s=t.sub(i.clone().multiplyScalar(i.dot(t))),l=s.lengthSq();return l<1e-18?e.clone():e.clone().addScaledVector(s,o/l)}g(oe,"translatePointWithinPlane");function Ie(e,c,n,o,t,i){const s=Math.min(n.length,o.length,t.length);if(s<2)return;const l=`${c}_SIDE_A`,r=`${c}_SIDE_B`,h=`${c}_BEVEL`,f=g((a,u,x,d,S)=>{e.addTriangle(a,w(u),w(d),w(S)),e.addTriangle(a,w(u),w(S),w(x))},"link");for(let a=0;a<s-1;a++)f(l,n[a],n[a+1],o[a],o[a+1]),f(r,n[a],n[a+1],t[a],t[a+1]),f(h,o[a],o[a+1],t[a],t[a+1]);if(i){const a=s-1,u=0;f(l,n[a],n[u],o[a],o[u]),f(r,n[a],n[u],t[a],t[u]),f(h,o[a],o[u],t[a],t[u])}else e.addTriangle(`${c}_CAP0`,w(n[0]),w(o[0]),w(t[0])),e.addTriangle(`${c}_CAP1`,w(n[s-1]),w(t[s-1]),w(o[s-1]))}g(Ie,"buildChamferPrismNamed");export{ee as ChamferSolid};
@@ -1,4 +1,4 @@
1
- var z=Object.defineProperty;var o=(e,t)=>z(e,"name",{value:t,configurable:!0});import{q as D}from"./featureDialogs-Dw07GP5f.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=`
1
+ var z=Object.defineProperty;var o=(e,t)=>z(e,"name",{value:t,configurable:!0});import{q as D}from"./featureDialogs-DEpvCr2m.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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}o(w,"escapeHtml");function M(){if(y)return;y=!0;const e=document.createElement("style");e.textContent=`
@@ -1 +1 @@
1
- var m=Object.defineProperty;var i=(e,t)=>m(e,"name",{value:t,configurable:!0});import"./modulepreload-polyfill-BdX5DvLD.js";import{F as p}from"./FeatureRegistry-C8QUptOR.js";import{r as c}from"./dialogCapturePageFactory-C8ZgGbz3.js";import"./featureDialogs-Dw07GP5f.js";import"./browserStorage-CvgF8ovw.js";import"./preload-helper-ZNr0Qq7Q.js";import"./Tube-OTYPNFqf.js";import"./chamfer-CQEYwOuD.js";import"./fillet-C6-sxYCV.js";import"./deepClone-Dj59xCHB.js";const u=new p,f=u.features.filter(Boolean).map(e=>{const t=a(e.longName,e.featureName,e.name,"Feature"),r=a(e.shortName,e.featureShortName,t,"Feature"),o=e&&typeof e.inputParamsSchema=="object"?e.inputParamsSchema:{},n=l(o,r);return{displayName:t,shortName:r,captureName:t,schema:o,initialParams:n}});c({title:"Feature Dialog Reference",description:"Dialogs are rendered live using SchemaForm. Use the automated capture script to export PNGs.",entries:f});function a(...e){for(const t of e){if(t==null&&t!==0)continue;const r=String(t).trim();if(r.length)return r}return"Feature"}i(a,"pickName");function l(e,t){if(!e||typeof e!="object")return{};let r=null;if(Object.prototype.hasOwnProperty.call(e,"id")?r="id":Object.prototype.hasOwnProperty.call(e,"featureID")&&(r="featureID"),!r)return{};const o=String(t||"feature").replace(/[^a-z0-9._-]+/gi,"_");return{[r]:`${o}-capture`}}i(l,"buildFeatureParams");
1
+ var m=Object.defineProperty;var i=(e,t)=>m(e,"name",{value:t,configurable:!0});import"./modulepreload-polyfill-BdX5DvLD.js";import{F as p}from"./FeatureRegistry-CbzxapvH.js";import{r as c}from"./dialogCapturePageFactory-DHAJd9no.js";import"./featureDialogs-DEpvCr2m.js";import"./browserStorage-CvgF8ovw.js";import"./preload-helper-ZNr0Qq7Q.js";import"./Tube-BXbVhwOj.js";import"./chamfer-DRqXmQEN.js";import"./fillet-D-ZkRPFl.js";import"./deepClone-Dj59xCHB.js";const u=new p,f=u.features.filter(Boolean).map(e=>{const t=a(e.longName,e.featureName,e.name,"Feature"),r=a(e.shortName,e.featureShortName,t,"Feature"),o=e&&typeof e.inputParamsSchema=="object"?e.inputParamsSchema:{},n=l(o,r);return{displayName:t,shortName:r,captureName:t,schema:o,initialParams:n}});c({title:"Feature Dialog Reference",description:"Dialogs are rendered live using SchemaForm. Use the automated capture script to export PNGs.",entries:f});function a(...e){for(const t of e){if(t==null&&t!==0)continue;const r=String(t).trim();if(r.length)return r}return"Feature"}i(a,"pickName");function l(e,t){if(!e||typeof e!="object")return{};let r=null;if(Object.prototype.hasOwnProperty.call(e,"id")?r="id":Object.prototype.hasOwnProperty.call(e,"featureID")&&(r="featureID"),!r)return{};const o=String(t||"feature").replace(/[^a-z0-9._-]+/gi,"_");return{[r]:`${o}-capture`}}i(l,"buildFeatureParams");