forgecad 0.10.0 → 0.10.2
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/assets/{AdminPage-DwYHz72L.js → AdminPage-CHY6ZN-p.js} +1 -1
- package/dist/assets/{BenchmarkPage-a9_f-1US.js → BenchmarkPage-BcRT5iGN.js} +1 -1
- package/dist/assets/{BlogPage-DodHpvmf.js → BlogPage-BssBbnb-.js} +1 -1
- package/dist/assets/{DocsPage-B5LePEuj.js → DocsPage-DsvdiRNK.js} +33 -2
- package/dist/assets/{EditorApp-QXsAISLR.js → EditorApp-Bfd3jbtC.js} +185 -44
- package/dist/assets/{EmbedViewer-DdEHGUMU.js → EmbedViewer-D5t8WamV.js} +3 -3
- package/dist/assets/{LandingPageProofDriven-yhhOodbf.js → LandingPageProofDriven-DbN7o-Be.js} +1 -1
- package/dist/assets/{LegalPage-5RbKRGYK.js → LegalPage-DNGrrY0p.js} +1 -1
- package/dist/assets/{PricingPage-E3Rma7aV.js → PricingPage-Nczr3pRz.js} +1 -1
- package/dist/assets/{SettingsPage-BJZcM97j.js → SettingsPage-DZlyu4d4.js} +1 -1
- package/dist/assets/{app-DSYrDg0V.js → app-C9ct2hRD.js} +1752 -474
- package/dist/assets/{app-CE3sYcV7.css → app-CjsbDlb7.css} +143 -0
- package/dist/assets/{scalar-sampling-budget-o90NSNmF.js → backendInit-ymjonyQp.js} +85756 -78750
- package/dist/assets/cli/{render-ZMHR9HkV.js → render-B_0lQwKU.js} +71 -193
- package/dist/assets/{constructionHistoryWorker-AwMMWSxg.js → constructionHistoryWorker-CZ42Dksy.js} +8058 -1225
- package/dist/assets/{evalWorker-DbNs7Dkp.js → evalWorker-C2pm8LHP.js} +23037 -15821
- package/dist/assets/{forgecad_geometry-Dgceylq9.js → forgecad_geometry-BlMtqluF.js} +120 -1
- package/dist/assets/{forgecad_geometry_bg-dD4RNQF1.wasm → forgecad_geometry_bg-BllP_WiL.wasm} +0 -0
- package/dist/assets/{inspectWorker-CZsCFtQT.js → inspectWorker-D5T5VbfK.js} +31375 -32603
- package/dist/assets/{jointPose-DO6mnXn_.js → jointPose-4r8ed8_5.js} +1 -1
- package/dist/assets/{manifold-BU-tJwQh.js → manifold-5PP1eGLN.js} +1 -1
- package/dist/assets/{manifold-fy2MV7K1.js → manifold-C4r6B-XY.js} +2 -2
- package/dist/assets/{manifold-BGlQBBH9.js → manifold-DjBkyIc8.js} +1 -1
- package/dist/assets/{reportWorker-DO6hcQbh.js → reportWorker-CwenM7wB.js} +46620 -44936
- package/dist/cli/render.html +1 -1
- package/dist/docs/index.html +2 -2
- package/dist/docs-raw/CLI.md +43 -16
- package/dist/docs-raw/generated/assembly.md +71 -6
- package/dist/docs-raw/generated/concepts.md +17 -3
- package/dist/docs-raw/generated/core.md +10 -3
- package/dist/docs-raw/generated/output.md +14 -43
- package/dist/docs-raw/generated/runtime-names.md +4 -4
- package/dist/docs-raw/generated/sdf.md +2 -2
- package/dist/docs-raw/guides/simready-quickstart.md +173 -0
- package/dist/docs-raw/simulation-workflow.md +273 -0
- package/dist/index.html +2 -2
- package/dist/sitemap.xml +25 -13
- package/dist-cli/{check-compiler-JTVBITCR.js → check-compiler-SP7FAL7R.js} +1 -1
- package/dist-cli/{check-query-propagation-3FFLSMVN.js → check-query-propagation-BRLSHP22.js} +1 -1
- package/dist-cli/{chunk-OAN5T4XD.js → chunk-RQQ42YCP.js} +51209 -43456
- package/dist-cli/forgecad.js +5783 -1691
- package/dist-cli/{forgecad_geometry-QOQIIP53.js → forgecad_geometry-7TVSNVUB.js} +119 -0
- package/dist-cli/forgecad_geometry_bg.wasm +0 -0
- package/dist-skill/CONTEXT.md +107 -68
- package/dist-skill/docs/API/core/concepts.md +2 -2
- package/dist-skill/docs/CLI.md +43 -16
- package/dist-skill/docs/generated/assembly.md +67 -6
- package/dist-skill/docs/generated/core.md +10 -3
- package/dist-skill/docs/generated/output.md +14 -43
- package/dist-skill/docs/generated/runtime-names.md +4 -4
- package/dist-skill/docs/generated/sdf.md +2 -2
- package/examples/api/gyroid-voronoi-blend.forge.js +1 -1
- package/examples/api/organic-noise-sculpture.forge.js +1 -1
- package/examples/api/sdf-circular-array-knurling.forge.js +1 -1
- package/examples/api/{sdf-custom-raymarch.forge.js → sdf-custom-field-mesh-preview.forge.js} +3 -4
- package/examples/api/sdf-materialize-tree.forge.js +2 -2
- package/examples/api/sdf-plain-return.forge.js +3 -2
- package/examples/api/sdf-shapes.forge.js +2 -2
- package/examples/api/sdf-surface-basket-weave.forge.js +2 -2
- package/examples/generative/twisted-lattice-tower.forge.js +1 -1
- package/examples/generative/voronoi-lampshade.forge.js +1 -1
- package/examples/robotics/README.md +46 -0
- package/examples/robotics/scout-cam-rover-simready/README.md +119 -0
- package/examples/robotics/scout-cam-rover-simready/lib/dims.js +140 -0
- package/examples/robotics/scout-cam-rover-simready/main.forge.js +343 -0
- package/examples/robotics/scout-cam-rover-simready/parts/body.forge.js +304 -0
- package/examples/robotics/scout-cam-rover-simready/parts/chassis.forge.js +320 -0
- package/examples/robotics/scout-cam-rover-simready/parts/hardware.forge.js +21 -0
- package/examples/robotics/scout-cam-rover-simready/parts/turret.forge.js +70 -0
- package/examples/robotics/scout-cam-rover-simready/parts/wheel.forge.js +116 -0
- package/examples/robotics/simready-asset-crate.forge.js +79 -0
- package/examples/robotics/simready-diff-drive-rover.forge.js +141 -0
- package/examples/robotics/simready-parallel-gripper.forge.js +102 -0
- package/package.json +2 -2
- package/dist/assets/manifold-CzYf_iub.js +0 -3023
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import { D as DoubleSide,
|
|
5
|
-
import { m as mergeViewportRenderSceneStates, v as validateJointOverrides, b as buildBaseJointValues, p as parseRenderSceneCliSpec, g as getSceneObjectTreePath } from "../jointPose-
|
|
4
|
+
import { D as DoubleSide, a as Scene, bx as BoxGeometry, c2 as MeshStandardMaterial, a5 as BackSide, b8 as PointLight, M as Mesh, ab as MeshBasicMaterial, cJ as localAabbPlaneRelation, i as Vector2, cK as ShapeUtils, cL as analyzePhysicalConnectivity, h as Vector3, a0 as Matrix4, cM as Frustum, J as Box3, a1 as MathUtils, cN as meshContactDataFor, cO as AabbSpatialIndex, cP as detectPhysicalContact, cQ as resolveThicknessInspectionOptions, R as Raycaster, cR as thicknessColor, cS as thicknessClass, b0 as BufferAttribute, cT as roughnessClassForAngle, cU as resolveRoughnessInspectionOptions, cV as roughnessColorForAngle, cW as roughnessScoreForAngle, cI as initBackendForEvaluation, f as Color, bb as COMPARISON_COLORS, az as resolveForgeRenderStyle, bG as getRenderStylePreset, ay as setParamOverrides, bm as runScript, cs as scanProxyGridForBounds, cX as Group, bf as shapeToGeometry, bn as MeshPhysicalMaterial, bE as AdditiveBlending, bJ as scanMaterialShellColor, cY as createScanProxyGeometry, aP as LineBasicMaterial, bI as NormalBlending, bo as LineSegments, P as PerspectiveCamera, cp as DEFAULT_VIEW_CONFIG, bt as worldAuthorPlaneToLocal, cZ as resolveSectionHatchMetrics, cA as buildGeometryComparisonPointCloud, cy as triangleSoupFromMeshes, O as OrthographicCamera, l as ShaderMaterial, bP as ZEBRA_STRIPE_FRAGMENT_SHADER, bQ as ZEBRA_STRIPE_VERTEX_SHADER, bK as ZEBRA_STRIPE_SOFTNESS, bL as ZEBRA_STRIPE_SCALE, bM as ZEBRA_LIGHT_COLOR, bN as ZEBRA_DARK_COLOR, bO as ZEBRA_ACCENT_COLOR, bF as geometryWithVisibleVertexColors, c_ as intersectWithPlane, c$ as setActiveBackend, W as WebGLRenderer, A as ACESFilmicToneMapping, d as SRGBColorSpace, d0 as parseCameraCliSpec, d1 as PMREMGenerator, b1 as CanvasTexture, b2 as Object3D, b3 as FogExp2, b4 as Fog, b5 as AmbientLight, b9 as DirectionalLight, b6 as HemisphereLight, aJ as findJointAnimationClip, q as Plane, bT as SURFACE_FIELD_FRAGMENT_SHADER, bU as SURFACE_FIELD_VERTEX_SHADER, bS as scanMaterialLayerStyles, bR as SCAN_PROXY_LAYER_STYLES, aK as resolveJointAnimation, aL as resolveJointViewValues, aO as BufferGeometry, bZ as ROUGHNESS_COLORS, d2 as PointsMaterial, d3 as Points, ba as heatPointsForSide, d4 as analyzeCollisionIntersections, d5 as serializeCollisionFinding, d6 as summarizeThicknessSamples, bY as THICKNESS_GRADIENT_COLORS, d7 as THICKNESS_COLORS, b7 as SpotLight, c6 as CylinderGeometry, d8 as TorusGeometry, bW as CatmullRomCurve3, bX as TubeGeometry, cE as resolveScalarSceneSampleBudget, bg as buildComparisonHeatPatchGeometry, bh as EdgesGeometry, d9 as SphereGeometry, da as ConeGeometry, bc as comparisonHeatDepthTest, bd as comparisonHeatEdgeOpacity, be as comparisonHeatPatchOpacity, cG as comparisonCandidateContextOpacity, db as DEFAULT_COMPARISON_CANDIDATE_OPACITY } from "../backendInit-ymjonyQp.js";
|
|
5
|
+
import { m as mergeViewportRenderSceneStates, v as validateJointOverrides, b as buildBaseJointValues, p as parseRenderSceneCliSpec, g as getSceneObjectTreePath } from "../jointPose-4r8ed8_5.js";
|
|
6
6
|
const CAD_MATERIAL_PROPS = {
|
|
7
7
|
color: 6003669,
|
|
8
8
|
metalness: 0.05,
|
|
@@ -18,10 +18,6 @@ const EDGE_MATERIAL_PROPS = {
|
|
|
18
18
|
transparent: true,
|
|
19
19
|
opacity: 0.6
|
|
20
20
|
};
|
|
21
|
-
async function init() {
|
|
22
|
-
await initSolverWasm();
|
|
23
|
-
await initKernel();
|
|
24
|
-
}
|
|
25
21
|
class RoomEnvironment extends Scene {
|
|
26
22
|
constructor() {
|
|
27
23
|
super();
|
|
@@ -2011,7 +2007,7 @@ function summarizeSceneGeometry(entries) {
|
|
|
2011
2007
|
const max = [-Infinity, -Infinity, -Infinity];
|
|
2012
2008
|
let volume = 0;
|
|
2013
2009
|
for (const entry of entries) {
|
|
2014
|
-
const bb = entry.shape ? entry.shape.boundingBox() :
|
|
2010
|
+
const bb = entry.shape ? entry.shape.boundingBox() : null;
|
|
2015
2011
|
if (!bb) continue;
|
|
2016
2012
|
for (let axis = 0; axis < 3; axis += 1) {
|
|
2017
2013
|
min[axis] = Math.min(min[axis], bb.min[axis]);
|
|
@@ -2030,14 +2026,6 @@ function summarizeSceneGeometry(entries) {
|
|
|
2030
2026
|
}
|
|
2031
2027
|
return { bbox: { min, max }, volume };
|
|
2032
2028
|
}
|
|
2033
|
-
function padSdfBounds(bounds) {
|
|
2034
|
-
const diagonal = Math.hypot(bounds.max[0] - bounds.min[0], bounds.max[1] - bounds.min[1], bounds.max[2] - bounds.min[2]);
|
|
2035
|
-
const pad = Math.max(1, diagonal * 0.04);
|
|
2036
|
-
return {
|
|
2037
|
-
min: [bounds.min[0] - pad, bounds.min[1] - pad, bounds.min[2] - pad],
|
|
2038
|
-
max: [bounds.max[0] + pad, bounds.max[1] + pad, bounds.max[2] + pad]
|
|
2039
|
-
};
|
|
2040
|
-
}
|
|
2041
2029
|
function rendererContextKeyFor(pixelRatio) {
|
|
2042
2030
|
const antialias = pixelRatio <= 1.25;
|
|
2043
2031
|
return `aa:${antialias ? "1" : "0"};preserve:0;logDepth:0`;
|
|
@@ -2115,98 +2103,6 @@ function getStudioEnvironment(r) {
|
|
|
2115
2103
|
pmrem.dispose();
|
|
2116
2104
|
return studioEnvTexture;
|
|
2117
2105
|
}
|
|
2118
|
-
const BLACK_RGB = [0, 0, 0];
|
|
2119
|
-
const MAX_SDF_CLIP_PLANES = 8;
|
|
2120
|
-
function clamp01(value) {
|
|
2121
|
-
return Math.min(1, Math.max(0, value));
|
|
2122
|
-
}
|
|
2123
|
-
function colorToRgb(value, fallback = "#5b9bd5") {
|
|
2124
|
-
const color = new Color(value || fallback);
|
|
2125
|
-
return [color.r, color.g, color.b];
|
|
2126
|
-
}
|
|
2127
|
-
function setSdfClipPlaneUniforms(target, clippingPlanes) {
|
|
2128
|
-
const count = Math.min(clippingPlanes.length, MAX_SDF_CLIP_PLANES);
|
|
2129
|
-
for (let i = 0; i < MAX_SDF_CLIP_PLANES; i += 1) {
|
|
2130
|
-
const plane = clippingPlanes[i];
|
|
2131
|
-
target[i].set((plane == null ? void 0 : plane.normal.x) ?? 0, (plane == null ? void 0 : plane.normal.y) ?? 0, (plane == null ? void 0 : plane.normal.z) ?? 0, (plane == null ? void 0 : plane.constant) ?? 0);
|
|
2132
|
-
}
|
|
2133
|
-
return count;
|
|
2134
|
-
}
|
|
2135
|
-
function createSdfRaymarchRuntime(entry, clippingPlanes) {
|
|
2136
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
2137
|
-
if (!entry.sdf) {
|
|
2138
|
-
throw new Error("Internal render error: createSdfRaymarchRuntime() requires an SDF entry.");
|
|
2139
|
-
}
|
|
2140
|
-
const sdf = entry.sdf;
|
|
2141
|
-
const bounds = padSdfBounds(sdf.bounds);
|
|
2142
|
-
const materialAlpha = ((_a = sdf.materialProps) == null ? void 0 : _a.opacity) ?? 1;
|
|
2143
|
-
const leaf = {
|
|
2144
|
-
node: sdf.node,
|
|
2145
|
-
color: colorToRgb(entry.color ?? sdf.colorHex),
|
|
2146
|
-
alpha: clamp01(Math.min(entry.opacity, materialAlpha)),
|
|
2147
|
-
emissive: ((_b = sdf.materialProps) == null ? void 0 : _b.emissive) ? colorToRgb(sdf.materialProps.emissive, "#000000") : BLACK_RGB,
|
|
2148
|
-
emissiveIntensity: ((_c = sdf.materialProps) == null ? void 0 : _c.emissiveIntensity) ?? 0,
|
|
2149
|
-
metalness: clamp01(((_d = sdf.materialProps) == null ? void 0 : _d.metalness) ?? 0.05),
|
|
2150
|
-
roughness: clamp01(((_e = sdf.materialProps) == null ? void 0 : _e.roughness) ?? 0.35),
|
|
2151
|
-
clearcoat: clamp01(((_f = sdf.materialProps) == null ? void 0 : _f.clearcoat) ?? 0.1),
|
|
2152
|
-
clearcoatRoughness: clamp01(((_g = sdf.materialProps) == null ? void 0 : _g.clearcoatRoughness) ?? 0.4),
|
|
2153
|
-
transmission: clamp01(((_h = sdf.materialProps) == null ? void 0 : _h.transmission) ?? 0),
|
|
2154
|
-
reflectivity: clamp01(((_i = sdf.materialProps) == null ? void 0 : _i.reflectivity) ?? 0.5)
|
|
2155
|
-
};
|
|
2156
|
-
const clipPlaneUniforms = Array.from({ length: MAX_SDF_CLIP_PLANES }, () => new Vector4());
|
|
2157
|
-
const material = new ShaderMaterial({
|
|
2158
|
-
vertexShader: SDF_RAYMARCH_PROXY_VERTEX_SHADER,
|
|
2159
|
-
fragmentShader: buildSdfRaymarchFragmentShader([leaf]),
|
|
2160
|
-
side: BackSide,
|
|
2161
|
-
transparent: leaf.alpha < 1 || leaf.transmission > 0,
|
|
2162
|
-
depthTest: true,
|
|
2163
|
-
depthWrite: leaf.alpha >= 1 && leaf.transmission <= 0,
|
|
2164
|
-
uniforms: {
|
|
2165
|
-
uCameraMatrixWorld: { value: new Matrix4() },
|
|
2166
|
-
uViewProjectionMatrix: { value: new Matrix4() },
|
|
2167
|
-
uSceneMin: { value: new Vector3() },
|
|
2168
|
-
uSceneMax: { value: new Vector3() },
|
|
2169
|
-
uClipPlaneCount: { value: 0 },
|
|
2170
|
-
uClipPlanes: { value: clipPlaneUniforms },
|
|
2171
|
-
uHoverLeafIndex: { value: -1 },
|
|
2172
|
-
uHoverColor: { value: new Vector3() },
|
|
2173
|
-
uHoverIntensity: { value: 0 },
|
|
2174
|
-
uIsOrthographic: { value: 0 }
|
|
2175
|
-
}
|
|
2176
|
-
});
|
|
2177
|
-
const size = [
|
|
2178
|
-
Math.max(bounds.max[0] - bounds.min[0], 1e-3),
|
|
2179
|
-
Math.max(bounds.max[1] - bounds.min[1], 1e-3),
|
|
2180
|
-
Math.max(bounds.max[2] - bounds.min[2], 1e-3)
|
|
2181
|
-
];
|
|
2182
|
-
const center = [
|
|
2183
|
-
(bounds.min[0] + bounds.max[0]) * 0.5,
|
|
2184
|
-
(bounds.min[1] + bounds.max[1]) * 0.5,
|
|
2185
|
-
(bounds.min[2] + bounds.max[2]) * 0.5
|
|
2186
|
-
];
|
|
2187
|
-
const mesh = new Mesh(new BoxGeometry(...size), material);
|
|
2188
|
-
mesh.position.set(center[0], center[1], center[2]);
|
|
2189
|
-
mesh.frustumCulled = false;
|
|
2190
|
-
return {
|
|
2191
|
-
mesh,
|
|
2192
|
-
material,
|
|
2193
|
-
runtime: { bounds, material, clippingPlanes, clipPlaneUniforms }
|
|
2194
|
-
};
|
|
2195
|
-
}
|
|
2196
|
-
function updateSdfRaymarchUniforms(session) {
|
|
2197
|
-
const viewProjection = new Matrix4().multiplyMatrices(session.camera.projectionMatrix, session.camera.matrixWorldInverse);
|
|
2198
|
-
const isOrthographic = session.camera.isOrthographicCamera ? 1 : 0;
|
|
2199
|
-
for (const renderable of session.renderables) {
|
|
2200
|
-
const sdf = renderable.sdfRaymarch;
|
|
2201
|
-
if (!sdf) continue;
|
|
2202
|
-
sdf.material.uniforms.uCameraMatrixWorld.value.copy(session.camera.matrixWorld);
|
|
2203
|
-
sdf.material.uniforms.uViewProjectionMatrix.value.copy(viewProjection);
|
|
2204
|
-
sdf.material.uniforms.uSceneMin.value.set(sdf.bounds.min[0], sdf.bounds.min[1], sdf.bounds.min[2]);
|
|
2205
|
-
sdf.material.uniforms.uSceneMax.value.set(sdf.bounds.max[0], sdf.bounds.max[1], sdf.bounds.max[2]);
|
|
2206
|
-
sdf.material.uniforms.uClipPlaneCount.value = setSdfClipPlaneUniforms(sdf.clipPlaneUniforms, sdf.clippingPlanes);
|
|
2207
|
-
sdf.material.uniforms.uIsOrthographic.value = isOrthographic;
|
|
2208
|
-
}
|
|
2209
|
-
}
|
|
2210
2106
|
function applyDirectionCamera(session, dir, distanceOverride) {
|
|
2211
2107
|
const d = normalizeCameraDirection(dir);
|
|
2212
2108
|
const fov = session.camera instanceof PerspectiveCamera ? session.camera.fov : 45;
|
|
@@ -2222,7 +2118,6 @@ function applyDirectionCamera(session, dir, distanceOverride) {
|
|
|
2222
2118
|
}
|
|
2223
2119
|
function renderCurrentRgb(session) {
|
|
2224
2120
|
const r = getRenderer(session.size, session.pixelRatio);
|
|
2225
|
-
updateSdfRaymarchUniforms(session);
|
|
2226
2121
|
r.render(session.scene, session.camera);
|
|
2227
2122
|
return captureRenderedPng(session.size);
|
|
2228
2123
|
}
|
|
@@ -2423,7 +2318,6 @@ function renderSessionCoverageImageData(session, color) {
|
|
|
2423
2318
|
() => withSolidOnlyVisibility(
|
|
2424
2319
|
session,
|
|
2425
2320
|
() => withTemporarySceneBackground(session, new Color(0), () => {
|
|
2426
|
-
updateSdfRaymarchUniforms(session);
|
|
2427
2321
|
r.clear(true, true, true);
|
|
2428
2322
|
r.render(session.scene, session.camera);
|
|
2429
2323
|
return captureRenderedImageData(session.size);
|
|
@@ -2737,7 +2631,6 @@ function renderCurrentDepth(session) {
|
|
|
2737
2631
|
const png = withSolidOnlyVisibility(
|
|
2738
2632
|
session,
|
|
2739
2633
|
() => withTemporarySceneBackground(session, new Color(0), () => {
|
|
2740
|
-
updateSdfRaymarchUniforms(session);
|
|
2741
2634
|
r.render(session.scene, session.camera);
|
|
2742
2635
|
return captureRenderedPng(session.size);
|
|
2743
2636
|
})
|
|
@@ -2774,7 +2667,6 @@ function renderCurrentNormals(session) {
|
|
|
2774
2667
|
return withSolidOnlyVisibility(
|
|
2775
2668
|
session,
|
|
2776
2669
|
() => withTemporarySceneBackground(session, new Color(0), () => {
|
|
2777
|
-
updateSdfRaymarchUniforms(session);
|
|
2778
2670
|
r.render(session.scene, session.camera);
|
|
2779
2671
|
return captureRenderedPng(session.size);
|
|
2780
2672
|
})
|
|
@@ -2805,7 +2697,6 @@ function renderCurrentZebra(session) {
|
|
|
2805
2697
|
return withSolidOnlyVisibility(
|
|
2806
2698
|
session,
|
|
2807
2699
|
() => withTemporarySceneBackground(session, new Color(0), () => {
|
|
2808
|
-
updateSdfRaymarchUniforms(session);
|
|
2809
2700
|
r.render(session.scene, session.camera);
|
|
2810
2701
|
return captureRenderedPng(session.size);
|
|
2811
2702
|
})
|
|
@@ -2899,7 +2790,6 @@ function renderCurrentMask(session) {
|
|
|
2899
2790
|
const png = withSolidOnlyVisibility(
|
|
2900
2791
|
session,
|
|
2901
2792
|
() => withTemporarySceneBackground(session, new Color(0), () => {
|
|
2902
|
-
updateSdfRaymarchUniforms(session);
|
|
2903
2793
|
r.render(session.scene, session.camera);
|
|
2904
2794
|
return captureRenderedPng(session.size);
|
|
2905
2795
|
})
|
|
@@ -3202,7 +3092,6 @@ function renderCurrentRig(session) {
|
|
|
3202
3092
|
session.scene.add(group);
|
|
3203
3093
|
try {
|
|
3204
3094
|
const png = withTemporarySceneBackground(session, new Color(132105), () => {
|
|
3205
|
-
updateSdfRaymarchUniforms(session);
|
|
3206
3095
|
r.render(session.scene, session.camera);
|
|
3207
3096
|
return captureRenderedPng(session.size);
|
|
3208
3097
|
});
|
|
@@ -3243,9 +3132,7 @@ function baseObjectIdForConnectivityEntry(entryId, renderableIds) {
|
|
|
3243
3132
|
}
|
|
3244
3133
|
function buildThicknessRaycastConnectivityContext(session) {
|
|
3245
3134
|
const report = analyzeSessionConnectivity(session);
|
|
3246
|
-
const renderableById = new Map(
|
|
3247
|
-
session.renderables.filter((renderable) => !renderable.sdfRaymarch).map((renderable) => [renderable.id, renderable])
|
|
3248
|
-
);
|
|
3135
|
+
const renderableById = new Map(session.renderables.map((renderable) => [renderable.id, renderable]));
|
|
3249
3136
|
const renderableIds = new Set(renderableById.keys());
|
|
3250
3137
|
const neighborIdsByObjectId = /* @__PURE__ */ new Map();
|
|
3251
3138
|
for (const edge of report.edges) {
|
|
@@ -3326,7 +3213,6 @@ function renderCurrentConnectivity(session, rawReport) {
|
|
|
3326
3213
|
const png = withSolidOnlyVisibility(
|
|
3327
3214
|
session,
|
|
3328
3215
|
() => withTemporarySceneBackground(session, new Color(0), () => {
|
|
3329
|
-
updateSdfRaymarchUniforms(session);
|
|
3330
3216
|
r.render(session.scene, session.camera);
|
|
3331
3217
|
return captureRenderedPng(session.size);
|
|
3332
3218
|
})
|
|
@@ -3420,7 +3306,6 @@ function renderCurrentDistance(session) {
|
|
|
3420
3306
|
const png = withSolidOnlyVisibility(
|
|
3421
3307
|
session,
|
|
3422
3308
|
() => withTemporarySceneBackground(session, new Color(0), () => {
|
|
3423
|
-
updateSdfRaymarchUniforms(session);
|
|
3424
3309
|
r.render(session.scene, session.camera);
|
|
3425
3310
|
return captureRenderedPng(session.size);
|
|
3426
3311
|
})
|
|
@@ -3551,7 +3436,6 @@ function renderCurrentFloating(session) {
|
|
|
3551
3436
|
});
|
|
3552
3437
|
try {
|
|
3553
3438
|
const png = withTemporarySceneBackground(session, new Color(0), () => {
|
|
3554
|
-
updateSdfRaymarchUniforms(session);
|
|
3555
3439
|
r.render(session.scene, session.camera);
|
|
3556
3440
|
return captureRenderedPng(session.size);
|
|
3557
3441
|
});
|
|
@@ -3669,7 +3553,6 @@ function renderCurrentCollisions(session) {
|
|
|
3669
3553
|
const png = withSolidOnlyVisibility(
|
|
3670
3554
|
session,
|
|
3671
3555
|
() => withTemporarySceneBackground(session, new Color(0), () => {
|
|
3672
|
-
updateSdfRaymarchUniforms(session);
|
|
3673
3556
|
r.render(session.scene, session.camera);
|
|
3674
3557
|
return captureRenderedPng(session.size);
|
|
3675
3558
|
})
|
|
@@ -3692,7 +3575,7 @@ function inspectionOptionsKey(value) {
|
|
|
3692
3575
|
return JSON.stringify(value ?? {});
|
|
3693
3576
|
}
|
|
3694
3577
|
function scalarInspectableObjectCount(session) {
|
|
3695
|
-
return session.renderables.
|
|
3578
|
+
return session.renderables.length;
|
|
3696
3579
|
}
|
|
3697
3580
|
function withSceneSampleBudget(session, options, explicitMaxSamplesPerObject) {
|
|
3698
3581
|
const sampleBudget = resolveScalarSceneSampleBudget({
|
|
@@ -3774,7 +3657,6 @@ function renderScalarPointOverlays(session, overlays) {
|
|
|
3774
3657
|
return withSolidOnlyVisibility(
|
|
3775
3658
|
session,
|
|
3776
3659
|
() => withTemporarySceneBackground(session, new Color(0), () => {
|
|
3777
|
-
updateSdfRaymarchUniforms(session);
|
|
3778
3660
|
r.render(session.scene, session.camera);
|
|
3779
3661
|
return captureRenderedPng(session.size);
|
|
3780
3662
|
})
|
|
@@ -3805,10 +3687,6 @@ function getSessionThicknessInspection(session, rawOptions) {
|
|
|
3805
3687
|
const raycastConnectivity = buildThicknessRaycastConnectivityContext(session);
|
|
3806
3688
|
session.renderables.forEach((renderable, index) => {
|
|
3807
3689
|
const sourceObject = byId.get(renderable.id);
|
|
3808
|
-
if (renderable.sdfRaymarch) {
|
|
3809
|
-
warnings.push(`${renderable.name}: SDF raymarch objects are not included in mesh thickness inspection.`);
|
|
3810
|
-
return;
|
|
3811
|
-
}
|
|
3812
3690
|
const analysis = analyzeThicknessGeometry(renderable.solid.geometry, options, {
|
|
3813
3691
|
connectedGeometries: connectedThicknessGeometriesFor(raycastConnectivity, renderable)
|
|
3814
3692
|
});
|
|
@@ -3906,10 +3784,6 @@ function getSessionRoughnessInspection(session, rawOptions) {
|
|
|
3906
3784
|
const points = [];
|
|
3907
3785
|
const overlays = [];
|
|
3908
3786
|
session.renderables.forEach((renderable, index) => {
|
|
3909
|
-
if (renderable.sdfRaymarch) {
|
|
3910
|
-
warnings.push(`${renderable.name}: SDF raymarch objects are not included in mesh roughness inspection.`);
|
|
3911
|
-
return;
|
|
3912
|
-
}
|
|
3913
3787
|
const analysis = analyzeRoughnessGeometry(renderable.solid.geometry, options);
|
|
3914
3788
|
const bbox = bboxFromGeometry(analysis.geometry);
|
|
3915
3789
|
const sourceObject = byId.get(renderable.id);
|
|
@@ -5007,7 +4881,6 @@ function renderCaptureFrame(session, opts) {
|
|
|
5007
4881
|
captureMark("capsMs");
|
|
5008
4882
|
const r = getRenderer(session.size, session.pixelRatio);
|
|
5009
4883
|
session.scene.updateMatrixWorld(true);
|
|
5010
|
-
updateSdfRaymarchUniforms(session);
|
|
5011
4884
|
r.render(session.scene, session.camera);
|
|
5012
4885
|
captureMark("renderMs");
|
|
5013
4886
|
const png = captureRenderedImage(session.size, (opts == null ? void 0 : opts.imageFormat) === "jpeg" ? "jpeg" : "png", (opts == null ? void 0 : opts.jpegQuality) ?? 0.96);
|
|
@@ -5096,7 +4969,7 @@ Available renderable objects: ${available}`;
|
|
|
5096
4969
|
return "No visible renderable objects found.";
|
|
5097
4970
|
}
|
|
5098
4971
|
function createSession(code, opts) {
|
|
5099
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
4972
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
5100
4973
|
const size = (opts == null ? void 0 : opts.size) ?? 1024;
|
|
5101
4974
|
const pixelRatio = (opts == null ? void 0 : opts.pixelRatio) ?? 1;
|
|
5102
4975
|
const debug = createCaptureDebugLogger(opts == null ? void 0 : opts.debug);
|
|
@@ -5143,20 +5016,32 @@ function createSession(code, opts) {
|
|
|
5143
5016
|
}
|
|
5144
5017
|
const focus = (opts == null ? void 0 : opts.focus) ?? null;
|
|
5145
5018
|
const hide = (opts == null ? void 0 : opts.hide) ?? null;
|
|
5146
|
-
const
|
|
5019
|
+
const mappedEntries = result.objects.map((obj) => {
|
|
5147
5020
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
5148
5021
|
return {
|
|
5149
5022
|
source: obj,
|
|
5150
5023
|
shape: obj.shape || (obj.sketch ? obj.sketch.extrude(1) : null),
|
|
5151
|
-
sdf: obj.sdf ?? null,
|
|
5152
5024
|
color: ((_b2 = (_a2 = requestedSceneState == null ? void 0 : requestedSceneState.objects) == null ? void 0 : _a2[obj.id]) == null ? void 0 : _b2.color) ?? obj.color,
|
|
5153
5025
|
materialProps: obj.materialProps,
|
|
5154
5026
|
opacity: MathUtils.clamp(((_d2 = (_c2 = requestedSceneState == null ? void 0 : requestedSceneState.objects) == null ? void 0 : _c2[obj.id]) == null ? void 0 : _d2.opacity) ?? ((_e2 = obj.materialProps) == null ? void 0 : _e2.opacity) ?? 1, 0, 1),
|
|
5155
5027
|
visible: ((_g2 = (_f2 = requestedSceneState == null ? void 0 : requestedSceneState.objects) == null ? void 0 : _f2[obj.id]) == null ? void 0 : _g2.visible) !== false && isFocusVisible(obj, focus, hide)
|
|
5156
5028
|
};
|
|
5157
|
-
})
|
|
5029
|
+
});
|
|
5030
|
+
const sdfOnlyNames = mappedEntries.filter((entry) => entry.shape == null && entry.visible && entry.source.sdf).map((entry) => entry.source.name);
|
|
5031
|
+
if (sdfOnlyNames.length > 0) {
|
|
5032
|
+
return {
|
|
5033
|
+
ok: false,
|
|
5034
|
+
error: `CLI rendering is mesh-based and cannot raymarch raw SDF fields. ${sdfOnlyNames.length} object(s) returned raw SDFs without mesh geometry: ${sdfOnlyNames.map((name) => `"${name}"`).join(", ")}.
|
|
5035
|
+
Fix one:
|
|
5036
|
+
- Mesh the field in-script: return toShape(mySdf) (or mySdf.toShape())
|
|
5037
|
+
- Export the raw field instead: forgecad export implicit <model.forge.js>`
|
|
5038
|
+
};
|
|
5039
|
+
}
|
|
5040
|
+
const objs = mappedEntries.filter(
|
|
5041
|
+
(entry) => entry.shape != null
|
|
5042
|
+
);
|
|
5158
5043
|
if (objs.length === 0) {
|
|
5159
|
-
return { ok: false, error: "No renderable shape
|
|
5044
|
+
return { ok: false, error: "No mesh-backed renderable shape returned" };
|
|
5160
5045
|
}
|
|
5161
5046
|
const visibleObjs = objs.filter((entry) => entry.visible);
|
|
5162
5047
|
if (visibleObjs.length === 0) {
|
|
@@ -5166,8 +5051,7 @@ function createSession(code, opts) {
|
|
|
5166
5051
|
totalObjects: result.objects.length,
|
|
5167
5052
|
renderableObjects: objs.length,
|
|
5168
5053
|
visibleObjects: visibleObjs.length,
|
|
5169
|
-
shapeObjects: visibleObjs.filter((entry) => entry.shape != null).length
|
|
5170
|
-
sdfObjects: visibleObjs.filter((entry) => entry.sdf != null).length
|
|
5054
|
+
shapeObjects: visibleObjs.filter((entry) => entry.shape != null).length
|
|
5171
5055
|
});
|
|
5172
5056
|
const boundsObjs = selectRenderSceneBoundsEntries(objs);
|
|
5173
5057
|
const objectVisibility = new Map(objs.map((entry) => [entry.source.id, entry.visible]));
|
|
@@ -5237,6 +5121,24 @@ function createSession(code, opts) {
|
|
|
5237
5121
|
} else {
|
|
5238
5122
|
addRenderStyleLights(scene, renderStyle);
|
|
5239
5123
|
}
|
|
5124
|
+
const sceneStyleIgnoredFeatures = [];
|
|
5125
|
+
if (sceneConfig) {
|
|
5126
|
+
if (!respectAuthoredSceneStyle) {
|
|
5127
|
+
if (sceneConfig.background != null) sceneStyleIgnoredFeatures.push("background");
|
|
5128
|
+
if (sceneConfig.lights != null) sceneStyleIgnoredFeatures.push("lights");
|
|
5129
|
+
if (sceneConfig.environment != null) sceneStyleIgnoredFeatures.push("environment");
|
|
5130
|
+
if (sceneConfig.fog != null) sceneStyleIgnoredFeatures.push("fog");
|
|
5131
|
+
if (sceneConfig.postProcessing != null) sceneStyleIgnoredFeatures.push("post-processing");
|
|
5132
|
+
if (sceneConfig.ground != null) sceneStyleIgnoredFeatures.push("ground");
|
|
5133
|
+
} else {
|
|
5134
|
+
if (sceneConfig.environment != null) sceneStyleIgnoredFeatures.push("environment");
|
|
5135
|
+
if (sceneConfig.ground != null) sceneStyleIgnoredFeatures.push("ground");
|
|
5136
|
+
if (((_c = sceneConfig.postProcessing) == null ? void 0 : _c.bloom) || ((_d = sceneConfig.postProcessing) == null ? void 0 : _d.vignette) || ((_e = sceneConfig.postProcessing) == null ? void 0 : _e.grain)) {
|
|
5137
|
+
sceneStyleIgnoredFeatures.push("post-processing (except toneMappingExposure)");
|
|
5138
|
+
}
|
|
5139
|
+
}
|
|
5140
|
+
}
|
|
5141
|
+
const authoredSceneStyleIgnored = !respectAuthoredSceneStyle && sceneStyleIgnoredFeatures.length > 0;
|
|
5240
5142
|
const sceneSummary = summarizeSceneGeometry(boundsObjs);
|
|
5241
5143
|
debug("session:summary", {
|
|
5242
5144
|
bbox: sceneSummary.bbox,
|
|
@@ -5255,7 +5157,7 @@ function createSession(code, opts) {
|
|
|
5255
5157
|
const distance = perspectiveCameraDistanceForBounds(bbox, [DEFAULT_FIXED_DIR.x, DEFAULT_FIXED_DIR.y, DEFAULT_FIXED_DIR.z], {
|
|
5256
5158
|
fovDeg: fov
|
|
5257
5159
|
});
|
|
5258
|
-
const cameraFov = ((
|
|
5160
|
+
const cameraFov = ((_f = requestedSceneState == null ? void 0 : requestedSceneState.camera) == null ? void 0 : _f.fov) ?? ((_g = sceneConfig == null ? void 0 : sceneConfig.camera) == null ? void 0 : _g.fov) ?? fov;
|
|
5259
5161
|
try {
|
|
5260
5162
|
if (opts == null ? void 0 : opts.cameraToken) {
|
|
5261
5163
|
if (requestedSceneState == null ? void 0 : requestedSceneState.camera) {
|
|
@@ -5283,17 +5185,17 @@ function createSession(code, opts) {
|
|
|
5283
5185
|
} catch (err) {
|
|
5284
5186
|
return { ok: false, error: err instanceof Error ? err.message : String(err) };
|
|
5285
5187
|
}
|
|
5286
|
-
const joints = ((
|
|
5287
|
-
const jointCouplings = ((
|
|
5188
|
+
const joints = ((_h = result.jointsView) == null ? void 0 : _h.enabled) === false ? [] : ((_i = result.jointsView) == null ? void 0 : _i.joints) ?? [];
|
|
5189
|
+
const jointCouplings = ((_j = result.jointsView) == null ? void 0 : _j.enabled) === false ? [] : ((_k = result.jointsView) == null ? void 0 : _k.couplings) ?? [];
|
|
5288
5190
|
try {
|
|
5289
5191
|
validateJointOverrides(result.jointsView, (opts == null ? void 0 : opts.jointOverrides) ?? {});
|
|
5290
5192
|
} catch (err) {
|
|
5291
5193
|
return { ok: false, error: err instanceof Error ? err.message : String(err) };
|
|
5292
5194
|
}
|
|
5293
|
-
const transformJoints = ((
|
|
5294
|
-
const transformJointCouplings = ((
|
|
5295
|
-
const animationClips = ((
|
|
5296
|
-
const defaultAnimation = ((
|
|
5195
|
+
const transformJoints = ((_l = result.jointsView) == null ? void 0 : _l.motionSource) === "assembly" ? [] : joints;
|
|
5196
|
+
const transformJointCouplings = ((_m = result.jointsView) == null ? void 0 : _m.motionSource) === "assembly" ? [] : jointCouplings;
|
|
5197
|
+
const animationClips = ((_n = result.jointsView) == null ? void 0 : _n.enabled) === false ? [] : ((_o = result.jointsView) == null ? void 0 : _o.animations) ?? [];
|
|
5198
|
+
const defaultAnimation = ((_p = result.jointsView) == null ? void 0 : _p.defaultAnimation) ?? null;
|
|
5297
5199
|
let selectedAnimation;
|
|
5298
5200
|
let sweep = null;
|
|
5299
5201
|
let cutawayBase = null;
|
|
@@ -5343,8 +5245,7 @@ function createSession(code, opts) {
|
|
|
5343
5245
|
total: visibleObjs.length,
|
|
5344
5246
|
id: obj.source.id,
|
|
5345
5247
|
name: objectLabel,
|
|
5346
|
-
hasShape: Boolean(obj.shape)
|
|
5347
|
-
hasSdf: Boolean(obj.sdf)
|
|
5248
|
+
hasShape: Boolean(obj.shape)
|
|
5348
5249
|
});
|
|
5349
5250
|
const applicableCutPlanes = activeCutPlanes.filter((cutPlane) => !isObjectExcludedFromCutPlane(obj.source, cutPlane)).map(toClippingPlane);
|
|
5350
5251
|
if (sweep && !isObjectExcludedFromCutPlane(obj.source, { normal: sweep.normal, offset: sweep.from })) {
|
|
@@ -5359,9 +5260,8 @@ function createSession(code, opts) {
|
|
|
5359
5260
|
let shell;
|
|
5360
5261
|
let scanProxy;
|
|
5361
5262
|
let wireMaterial;
|
|
5362
|
-
let sdfRaymarch;
|
|
5363
5263
|
let sectionMesh = null;
|
|
5364
|
-
|
|
5264
|
+
{
|
|
5365
5265
|
const geometryStart = performance.now();
|
|
5366
5266
|
const geo = shapeToGeometry(obj.shape);
|
|
5367
5267
|
debug("renderable:geometry", {
|
|
@@ -5369,8 +5269,8 @@ function createSession(code, opts) {
|
|
|
5369
5269
|
id: obj.source.id,
|
|
5370
5270
|
name: objectLabel,
|
|
5371
5271
|
ms: Number((performance.now() - geometryStart).toFixed(1)),
|
|
5372
|
-
triangles: Math.floor((((
|
|
5373
|
-
edgeSegments: Math.floor((((
|
|
5272
|
+
triangles: Math.floor((((_q = geo.solid.getAttribute("position")) == null ? void 0 : _q.count) ?? 0) / 3),
|
|
5273
|
+
edgeSegments: Math.floor((((_r = geo.edges.getAttribute("position")) == null ? void 0 : _r.count) ?? 0) / 2)
|
|
5374
5274
|
});
|
|
5375
5275
|
const materialDefaults = renderStylePreset.material;
|
|
5376
5276
|
const surfaceField = renderStylePreset.surfaceField;
|
|
@@ -5471,27 +5371,6 @@ function createSession(code, opts) {
|
|
|
5471
5371
|
});
|
|
5472
5372
|
wire = new LineSegments(geo.edges, wireMaterial);
|
|
5473
5373
|
sectionMesh = sweep ? buildSectionMeshPayload(obj.source.id, obj.shape, debug, objectLabel) : null;
|
|
5474
|
-
} else if (obj.sdf) {
|
|
5475
|
-
const sdfStart = performance.now();
|
|
5476
|
-
const sdfRenderable = createSdfRaymarchRuntime(obj, applicableCutPlanes);
|
|
5477
|
-
debug("renderable:sdf", {
|
|
5478
|
-
index: renderableIndex + 1,
|
|
5479
|
-
id: obj.source.id,
|
|
5480
|
-
name: objectLabel,
|
|
5481
|
-
ms: Number((performance.now() - sdfStart).toFixed(1))
|
|
5482
|
-
});
|
|
5483
|
-
solid = sdfRenderable.mesh;
|
|
5484
|
-
solidMaterial = sdfRenderable.material;
|
|
5485
|
-
sdfRaymarch = sdfRenderable.runtime;
|
|
5486
|
-
wireMaterial = new LineBasicMaterial({
|
|
5487
|
-
...EDGE_MATERIAL_PROPS,
|
|
5488
|
-
color: parseColor(obj.color, EDGE_MATERIAL_PROPS.color),
|
|
5489
|
-
transparent: true,
|
|
5490
|
-
opacity: 0
|
|
5491
|
-
});
|
|
5492
|
-
wire = new LineSegments(new BufferGeometry(), wireMaterial);
|
|
5493
|
-
} else {
|
|
5494
|
-
continue;
|
|
5495
5374
|
}
|
|
5496
5375
|
root.add(solid);
|
|
5497
5376
|
if (shell) root.add(shell);
|
|
@@ -5515,8 +5394,7 @@ function createSession(code, opts) {
|
|
|
5515
5394
|
sourceColor: obj.color ?? "#5b9bd5",
|
|
5516
5395
|
opacity: obj.opacity,
|
|
5517
5396
|
sectionMesh,
|
|
5518
|
-
sectionCapGroup
|
|
5519
|
-
...sdfRaymarch ? { sdfRaymarch } : {}
|
|
5397
|
+
sectionCapGroup
|
|
5520
5398
|
});
|
|
5521
5399
|
}
|
|
5522
5400
|
const renderableById = new Map(renderables.map((renderable) => [renderable.id, renderable]));
|
|
@@ -5530,7 +5408,7 @@ function createSession(code, opts) {
|
|
|
5530
5408
|
{ bodyShape: () => new EmptyInspectionShape() }
|
|
5531
5409
|
) : null;
|
|
5532
5410
|
const connectivityEntries = (connectivityBodyInput == null ? void 0 : connectivityBodyInput.entries) ?? [];
|
|
5533
|
-
const groundOffset = Number.isFinite((
|
|
5411
|
+
const groundOffset = Number.isFinite((_s = sceneConfig == null ? void 0 : sceneConfig.ground) == null ? void 0 : _s.offset) ? sceneConfig.ground.offset : 0;
|
|
5534
5412
|
const floatingGroundZ = bbox.min[2] - groundOffset;
|
|
5535
5413
|
let sceneConfigCameraState = null;
|
|
5536
5414
|
if ((sceneConfig == null ? void 0 : sceneConfig.camera) && !(requestedSceneState == null ? void 0 : requestedSceneState.camera)) {
|
|
@@ -5559,7 +5437,7 @@ function createSession(code, opts) {
|
|
|
5559
5437
|
} : null;
|
|
5560
5438
|
const cameraSpec = sceneConfigCameraState && (opts == null ? void 0 : opts.capture) === "section-sweep" ? fitCameraStateToBounds(sceneConfigCameraState, bbox, cameraFov) : (requestedSceneState == null ? void 0 : requestedSceneState.camera) ?? cutawayCameraState ?? sceneConfigCameraState;
|
|
5561
5439
|
const cameraRig = buildCameraRig(center, distance, maxDim, cameraSpec, cameraFov);
|
|
5562
|
-
const explicitCameraFov = (cameraSpec == null ? void 0 : cameraSpec.fov) ?? ((
|
|
5440
|
+
const explicitCameraFov = (cameraSpec == null ? void 0 : cameraSpec.fov) ?? ((_t = sceneConfig == null ? void 0 : sceneConfig.camera) == null ? void 0 : _t.fov);
|
|
5563
5441
|
if (explicitCameraFov && cameraRig.camera instanceof PerspectiveCamera) {
|
|
5564
5442
|
cameraRig.camera.fov = explicitCameraFov;
|
|
5565
5443
|
cameraRig.camera.updateProjectionMatrix();
|
|
@@ -5594,7 +5472,7 @@ function createSession(code, opts) {
|
|
|
5594
5472
|
jointCouplings,
|
|
5595
5473
|
transformJoints,
|
|
5596
5474
|
transformJointCouplings,
|
|
5597
|
-
jointOverlayConfig: ((
|
|
5475
|
+
jointOverlayConfig: ((_u = result.viewConfig) == null ? void 0 : _u.jointOverlay) ?? DEFAULT_VIEW_CONFIG.jointOverlay,
|
|
5598
5476
|
animationClips,
|
|
5599
5477
|
defaultAnimation,
|
|
5600
5478
|
selectedAnimation,
|
|
@@ -5608,7 +5486,9 @@ function createSession(code, opts) {
|
|
|
5608
5486
|
sweep,
|
|
5609
5487
|
cutaway,
|
|
5610
5488
|
captureDefaults: (sceneConfig == null ? void 0 : sceneConfig.capture) ?? null,
|
|
5611
|
-
renderStyle
|
|
5489
|
+
renderStyle,
|
|
5490
|
+
authoredSceneStyleIgnored,
|
|
5491
|
+
sceneStyleIgnoredFeatures
|
|
5612
5492
|
};
|
|
5613
5493
|
debug("session:renderables:end", { renderables: renderables.length });
|
|
5614
5494
|
setSessionMode(session, "solid");
|
|
@@ -5617,8 +5497,7 @@ function createSession(code, opts) {
|
|
|
5617
5497
|
debug("session:ready");
|
|
5618
5498
|
return { ok: true, session };
|
|
5619
5499
|
}
|
|
5620
|
-
|
|
5621
|
-
await init();
|
|
5500
|
+
function setup() {
|
|
5622
5501
|
setActiveBackend(CLI_DEFAULT_BACKEND);
|
|
5623
5502
|
window.__forgeCaptureCapabilities = CAPTURE_RUNTIME_CAPABILITIES;
|
|
5624
5503
|
window.__forgeReady = true;
|
|
@@ -5646,9 +5525,8 @@ window.__forgeRender = async (code, opts) => {
|
|
|
5646
5525
|
const requestedChannelList = (opts == null ? void 0 : opts.channels) ?? ["rgb"];
|
|
5647
5526
|
const requestedChannels = new Set(requestedChannelList);
|
|
5648
5527
|
await emitInspectProgress(opts, { type: "session-start" });
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
}
|
|
5528
|
+
const activeBackend = (opts == null ? void 0 : opts.activeBackend) ?? CLI_DEFAULT_BACKEND;
|
|
5529
|
+
await initBackendForEvaluation(activeBackend);
|
|
5652
5530
|
const built = createSession(code, {
|
|
5653
5531
|
size: (opts == null ? void 0 : opts.size) || 1024,
|
|
5654
5532
|
pixelRatio: (opts == null ? void 0 : opts.pixelRatio) || 1,
|
|
@@ -5656,7 +5534,7 @@ window.__forgeRender = async (code, opts) => {
|
|
|
5656
5534
|
allFiles: opts == null ? void 0 : opts.allFiles,
|
|
5657
5535
|
binaryFiles: opts == null ? void 0 : opts.binaryFiles,
|
|
5658
5536
|
fileName: opts == null ? void 0 : opts.fileName,
|
|
5659
|
-
activeBackend
|
|
5537
|
+
activeBackend,
|
|
5660
5538
|
background: opts == null ? void 0 : opts.background,
|
|
5661
5539
|
camera: opts == null ? void 0 : opts.camera,
|
|
5662
5540
|
cameraSpec: opts == null ? void 0 : opts.cameraSpec,
|
|
@@ -5688,9 +5566,8 @@ window.__forgeRender = async (code, opts) => {
|
|
|
5688
5566
|
disposeSession(session);
|
|
5689
5567
|
return { ok: false, error: "comparison evidence requires --compare-with <reference> or compareWith(path) in the model." };
|
|
5690
5568
|
}
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
}
|
|
5569
|
+
const comparisonBackend = comparisonReference.activeBackend ?? activeBackend;
|
|
5570
|
+
await initBackendForEvaluation(comparisonBackend);
|
|
5694
5571
|
const referenceBuilt = createSession(comparisonReference.code, {
|
|
5695
5572
|
size: (opts == null ? void 0 : opts.size) || 1024,
|
|
5696
5573
|
pixelRatio: (opts == null ? void 0 : opts.pixelRatio) || 1,
|
|
@@ -5698,7 +5575,7 @@ window.__forgeRender = async (code, opts) => {
|
|
|
5698
5575
|
allFiles: comparisonReference.allFiles,
|
|
5699
5576
|
binaryFiles: comparisonReference.binaryFiles,
|
|
5700
5577
|
fileName: comparisonReference.fileName,
|
|
5701
|
-
activeBackend:
|
|
5578
|
+
activeBackend: comparisonBackend,
|
|
5702
5579
|
background: opts == null ? void 0 : opts.background,
|
|
5703
5580
|
renderStyle: opts == null ? void 0 : opts.renderStyle,
|
|
5704
5581
|
scanGranularity: opts == null ? void 0 : opts.scanGranularity,
|
|
@@ -6026,16 +5903,17 @@ window.__forgeRender = async (code, opts) => {
|
|
|
6026
5903
|
method: "bbox-frustum-v1",
|
|
6027
5904
|
views: framingViews
|
|
6028
5905
|
},
|
|
5906
|
+
authoredSceneStyleIgnored: session.authoredSceneStyleIgnored,
|
|
5907
|
+
sceneStyleIgnoredFeatures: session.sceneStyleIgnoredFeatures,
|
|
6029
5908
|
verifications: session.verifications
|
|
6030
5909
|
};
|
|
6031
5910
|
};
|
|
6032
5911
|
window.__forgeCaptureInit = async (code, opts) => {
|
|
6033
5912
|
var _a;
|
|
6034
5913
|
destroyCaptureSession();
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
}
|
|
6038
|
-
const built = createSession(code, opts);
|
|
5914
|
+
const activeBackend = (opts == null ? void 0 : opts.activeBackend) ?? CLI_DEFAULT_BACKEND;
|
|
5915
|
+
await initBackendForEvaluation(activeBackend);
|
|
5916
|
+
const built = createSession(code, { ...opts, activeBackend });
|
|
6039
5917
|
if (!built.ok) {
|
|
6040
5918
|
return built;
|
|
6041
5919
|
}
|