@constructorfleet/sketchforge-engine 1.26.0 → 1.28.0
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/cadAnalysis.d.ts +94 -0
- package/dist/cadAnalysis.d.ts.map +1 -0
- package/dist/cadAnalysis.js +157 -0
- package/dist/cadAnalysis.js.map +1 -0
- package/dist/cadBakeMetadata.d.ts +11 -2
- package/dist/cadBakeMetadata.d.ts.map +1 -1
- package/dist/cadBakeMetadata.js +9 -0
- package/dist/cadBakeMetadata.js.map +1 -1
- package/dist/cadProjection.d.ts.map +1 -1
- package/dist/cadProjection.js.map +1 -1
- package/dist/cadSection.d.ts.map +1 -1
- package/dist/cadShell.d.ts +143 -0
- package/dist/cadShell.d.ts.map +1 -0
- package/dist/cadShell.js +313 -0
- package/dist/cadShell.js.map +1 -0
- package/dist/cadSolids.d.ts.map +1 -1
- package/dist/cadSolids.js +18 -1
- package/dist/cadSolids.js.map +1 -1
- package/dist/cutBrepFrameMigration.d.ts +46 -0
- package/dist/cutBrepFrameMigration.d.ts.map +1 -0
- package/dist/cutBrepFrameMigration.js +105 -0
- package/dist/cutBrepFrameMigration.js.map +1 -0
- package/dist/cutterPadding.d.ts.map +1 -1
- package/dist/domain/cameraProjection.js.map +1 -1
- package/dist/domain/sketchforge.d.ts +31 -1
- package/dist/domain/sketchforge.d.ts.map +1 -1
- package/dist/editorHistory.d.ts.map +1 -1
- package/dist/editorHistory.js.map +1 -1
- package/dist/engine.d.ts +3 -3
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +156 -78
- package/dist/engine.js.map +1 -1
- package/dist/exactBooleanParts.d.ts +4 -2
- package/dist/exactBooleanParts.d.ts.map +1 -1
- package/dist/exactBooleanParts.js +7 -3
- package/dist/exactBooleanParts.js.map +1 -1
- package/dist/exactBooleanSolids.d.ts.map +1 -1
- package/dist/gearProfile.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/loftProfile.d.ts +1 -1
- package/dist/loftProfile.d.ts.map +1 -1
- package/dist/loftProfile.js.map +1 -1
- package/dist/meshEdgeProjection.d.ts +104 -0
- package/dist/meshEdgeProjection.d.ts.map +1 -0
- package/dist/meshEdgeProjection.js +439 -0
- package/dist/meshEdgeProjection.js.map +1 -0
- package/dist/meshImport.d.ts.map +1 -1
- package/dist/meshImport.js +2 -20
- package/dist/meshImport.js.map +1 -1
- package/dist/meshMassProperties.d.ts +92 -0
- package/dist/meshMassProperties.d.ts.map +1 -0
- package/dist/meshMassProperties.js +570 -0
- package/dist/meshMassProperties.js.map +1 -0
- package/dist/meshSection.d.ts +44 -0
- package/dist/meshSection.d.ts.map +1 -0
- package/dist/meshSection.js +154 -0
- package/dist/meshSection.js.map +1 -0
- package/dist/meshShellOverlap.d.ts +75 -0
- package/dist/meshShellOverlap.d.ts.map +1 -0
- package/dist/meshShellOverlap.js +797 -0
- package/dist/meshShellOverlap.js.map +1 -0
- package/dist/meshShellSolids.d.ts +44 -0
- package/dist/meshShellSolids.d.ts.map +1 -0
- package/dist/meshShellSolids.js +116 -0
- package/dist/meshShellSolids.js.map +1 -0
- package/dist/nodeSvgDomParser.d.ts +3 -0
- package/dist/nodeSvgDomParser.d.ts.map +1 -0
- package/dist/nodeSvgDomParser.js +53 -0
- package/dist/nodeSvgDomParser.js.map +1 -0
- package/dist/parametricRecompute.d.ts.map +1 -1
- package/dist/parametricRecompute.js +63 -10
- package/dist/parametricRecompute.js.map +1 -1
- package/dist/placementWorkplane.d.ts.map +1 -1
- package/dist/placementWorkplane.js.map +1 -1
- package/dist/projectAssets.d.ts +1 -1
- package/dist/projectStore.d.ts +1 -1
- package/dist/projectStore.d.ts.map +1 -1
- package/dist/projectStore.js +23 -2
- package/dist/projectStore.js.map +1 -1
- package/dist/revolveRequests.d.ts +57 -1
- package/dist/revolveRequests.d.ts.map +1 -1
- package/dist/revolveRequests.js +103 -4
- package/dist/revolveRequests.js.map +1 -1
- package/dist/sceneExport.d.ts +6 -0
- package/dist/sceneExport.d.ts.map +1 -1
- package/dist/sceneExport.js +6 -2
- package/dist/sceneExport.js.map +1 -1
- package/dist/serverCadInterference.d.ts +8 -45
- package/dist/serverCadInterference.d.ts.map +1 -1
- package/dist/serverCadInterference.js +21 -43
- package/dist/serverCadInterference.js.map +1 -1
- package/dist/serverCadOperations.d.ts +73 -4
- package/dist/serverCadOperations.d.ts.map +1 -1
- package/dist/serverCadOperations.js +356 -71
- package/dist/serverCadOperations.js.map +1 -1
- package/dist/serverCadProjection.d.ts +14 -1
- package/dist/serverCadProjection.d.ts.map +1 -1
- package/dist/serverCadProjection.js +135 -13
- package/dist/serverCadProjection.js.map +1 -1
- package/dist/serverCadProperties.d.ts +14 -7
- package/dist/serverCadProperties.d.ts.map +1 -1
- package/dist/serverCadProperties.js +60 -24
- package/dist/serverCadProperties.js.map +1 -1
- package/dist/serverCadSection.d.ts +21 -1
- package/dist/serverCadSection.d.ts.map +1 -1
- package/dist/serverCadSection.js +157 -43
- package/dist/serverCadSection.js.map +1 -1
- package/dist/serverCadShell.d.ts +7 -94
- package/dist/serverCadShell.d.ts.map +1 -1
- package/dist/serverCadShell.js +25 -272
- package/dist/serverCadShell.js.map +1 -1
- package/dist/serverCadThickness.d.ts +8 -8
- package/dist/serverCadThickness.d.ts.map +1 -1
- package/dist/serverCadThickness.js +15 -42
- package/dist/serverCadThickness.js.map +1 -1
- package/dist/serverShapeBooleans.d.ts +75 -0
- package/dist/serverShapeBooleans.d.ts.map +1 -1
- package/dist/serverShapeBooleans.js +251 -9
- package/dist/serverShapeBooleans.js.map +1 -1
- package/dist/serverShapeGroups.js.map +1 -1
- package/dist/serverStepExplode.d.ts +1 -2
- package/dist/serverStepExplode.d.ts.map +1 -1
- package/dist/serverStepExplode.js +15 -148
- package/dist/serverStepExplode.js.map +1 -1
- package/dist/shapeBounds.d.ts.map +1 -1
- package/dist/shapeCatalog.d.ts.map +1 -1
- package/dist/shapeCatalog.js +1 -0
- package/dist/shapeCatalog.js.map +1 -1
- package/dist/shapeRequests.d.ts +13 -0
- package/dist/shapeRequests.d.ts.map +1 -1
- package/dist/shapeRequests.js +14 -0
- package/dist/shapeRequests.js.map +1 -1
- package/dist/sketchCadProfile.d.ts +13 -0
- package/dist/sketchCadProfile.d.ts.map +1 -1
- package/dist/sketchCadProfile.js +108 -0
- package/dist/sketchCadProfile.js.map +1 -1
- package/dist/sketchCadSweep.js.map +1 -1
- package/dist/sketchEdgeSegmentLineage.d.ts +32 -0
- package/dist/sketchEdgeSegmentLineage.d.ts.map +1 -0
- package/dist/sketchEdgeSegmentLineage.js +49 -0
- package/dist/sketchEdgeSegmentLineage.js.map +1 -0
- package/dist/sketchEdgeSegmentLineageKernel.d.ts +83 -0
- package/dist/sketchEdgeSegmentLineageKernel.d.ts.map +1 -0
- package/dist/sketchEdgeSegmentLineageKernel.js +125 -0
- package/dist/sketchEdgeSegmentLineageKernel.js.map +1 -0
- package/dist/sketchFaceDraftKernel.d.ts +16 -9
- package/dist/sketchFaceDraftKernel.d.ts.map +1 -1
- package/dist/sketchFaceDraftKernel.js +19 -11
- package/dist/sketchFaceDraftKernel.js.map +1 -1
- package/dist/sketchRevolve.d.ts +13 -0
- package/dist/sketchRevolve.d.ts.map +1 -1
- package/dist/sketchRevolve.js +4 -1
- package/dist/sketchRevolve.js.map +1 -1
- package/dist/skfProject.d.ts +1 -1
- package/dist/skfProject.d.ts.map +1 -1
- package/dist/skfProject.js +63 -4
- package/dist/skfProject.js.map +1 -1
- package/dist/sphereTessellation.d.ts.map +1 -1
- package/dist/stepAssemblyExplode.d.ts +45 -0
- package/dist/stepAssemblyExplode.d.ts.map +1 -0
- package/dist/stepAssemblyExplode.js +195 -0
- package/dist/stepAssemblyExplode.js.map +1 -0
- package/dist/stepAssemblyHierarchy.js.map +1 -1
- package/dist/stepComponentMetadata.d.ts +1 -1
- package/dist/stepComponentMetadata.d.ts.map +1 -1
- package/dist/stepComponentMetadata.js +93 -39
- package/dist/stepComponentMetadata.js.map +1 -1
- package/dist/stepExport.d.ts +14 -1
- package/dist/stepExport.d.ts.map +1 -1
- package/dist/stepExport.js +81 -32
- package/dist/stepExport.js.map +1 -1
- package/dist/stepImportCommon.d.ts +4 -1
- package/dist/stepImportCommon.d.ts.map +1 -1
- package/dist/stepImportCommon.js +7 -6
- package/dist/stepImportCommon.js.map +1 -1
- package/dist/stlImport.js.map +1 -1
- package/dist/support/cadModifierTypes.d.ts +100 -1
- package/dist/support/cadModifierTypes.d.ts.map +1 -1
- package/dist/support/i18n/LocalizedError.d.ts.map +1 -1
- package/dist/support/i18n/locales/en/messages.json +42 -2
- package/dist/support/i18n/locales.d.ts.map +1 -1
- package/dist/support/lib/appTheme.d.ts.map +1 -1
- package/dist/support/lib/materialPresets.js.map +1 -1
- package/dist/support/lib/measurementUnits.d.ts.map +1 -1
- package/dist/support/lib/operator-configuration.json +13 -1
- package/dist/support/lib/operatorConfiguration.d.ts +5 -5
- package/dist/support/lib/workplaneGrid.js.map +1 -1
- package/dist/svgImport.d.ts +2 -0
- package/dist/svgImport.d.ts.map +1 -1
- package/dist/svgImport.js +7 -0
- package/dist/svgImport.js.map +1 -1
- package/dist/threadCatalog.js.map +1 -1
- package/dist/workplaneSettings.js.map +1 -1
- package/dist/workplaneShapes.d.ts +2 -2
- package/dist/workplaneShapes.d.ts.map +1 -1
- package/dist/workplaneShapes.js.map +1 -1
- package/package.json +7 -6
|
@@ -1,54 +1,32 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Exact, bounded interference checks between positioned project solids.
|
|
3
|
+
*
|
|
4
|
+
* The analysis itself lives in `cadAnalysis`, which the editor's CAD worker
|
|
5
|
+
* shares; this places the stored shapes and runs it on the server's kernel.
|
|
6
|
+
*/
|
|
2
7
|
import { withCadKernel } from "./serverCadKernel.js";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
const CONTACT_EPSILON_MM = 1e-7;
|
|
7
|
-
function overlapsWithinClearance(a, b, clearance) {
|
|
8
|
-
const dx = Math.max(0, b.xmin - a.xmax, a.xmin - b.xmax);
|
|
9
|
-
const dy = Math.max(0, b.ymin - a.ymax, a.ymin - b.ymax);
|
|
10
|
-
const dz = Math.max(0, b.zmin - a.zmax, a.zmin - b.zmax);
|
|
11
|
-
return Math.hypot(dx, dy, dz) <= clearance;
|
|
12
|
-
}
|
|
8
|
+
import { placedSolid } from "./serverShapeBooleans.js";
|
|
9
|
+
import { interferenceBetweenSolids, interferenceRequestRefusal } from "./cadAnalysis.js";
|
|
10
|
+
export { INTERFERENCE_METHOD, MAX_INTERFERENCE_CANDIDATES, MAX_INTERFERENCE_SHAPES, } from "./cadAnalysis.js";
|
|
13
11
|
/**
|
|
14
12
|
* Check all selected visible non-cutter solids. Work is bounded before OCCT
|
|
15
13
|
* distance calculations; exceeding either cap refuses the entire request.
|
|
16
14
|
*/
|
|
17
15
|
export async function checkInterference(shapes, request = {}) {
|
|
18
16
|
const clearance = request.clearance ?? 0;
|
|
19
|
-
if (!Number.isFinite(clearance) || clearance < 0)
|
|
20
|
-
return { ok: false, refusal: { reason: "invalid_clearance" } };
|
|
21
17
|
const ids = request.ids ? new Set(request.ids) : null;
|
|
22
18
|
const selected = shapes.filter((shape) => !shape.hidden && !shape.hole && (!ids || ids.has(shape.id)));
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (candidates.length > MAX_INTERFERENCE_CANDIDATES) {
|
|
36
|
-
return { ok: false, refusal: { reason: "too_many_candidates", limit: MAX_INTERFERENCE_CANDIDATES, given: candidates.length } };
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
const pairs = [];
|
|
40
|
-
for (const [i, j] of candidates) {
|
|
41
|
-
const gap = await cad.distanceBetween(solids[i], solids[j]);
|
|
42
|
-
if (gap > clearance + CONTACT_EPSILON_MM)
|
|
43
|
-
continue;
|
|
44
|
-
const overlapVolume = gap <= CONTACT_EPSILON_MM
|
|
45
|
-
? Math.max(0, await cad.getVolume(await cad.common(solids[i], solids[j])))
|
|
46
|
-
: 0;
|
|
47
|
-
const hasMeshInput = [selected[i], selected[j]].some((shape) => (shape.importedMesh?.positions?.length ?? 0) >= 9);
|
|
48
|
-
pairs.push({ a: { id: selected[i].id, name: selected[i].name }, b: { id: selected[j].id, name: selected[j].name }, gap, overlapVolume, precision: hasMeshInput ? "tessellated" : "exact" });
|
|
49
|
-
}
|
|
50
|
-
pairs.sort((a, b) => a.gap - b.gap || b.overlapVolume - a.overlapVolume || a.a.id.localeCompare(b.a.id));
|
|
51
|
-
return { ok: true, value: { shapesChecked: selected.length, candidatePairsChecked: candidates.length, clearance, method: "OCCT exact distance and common volume; AABB candidate prefilter", pairs } };
|
|
52
|
-
});
|
|
19
|
+
// Refuse before the kernel is even reached: an oversized request costs nothing.
|
|
20
|
+
const refusal = interferenceRequestRefusal(selected.length, clearance);
|
|
21
|
+
if (refusal)
|
|
22
|
+
return { ok: false, refusal };
|
|
23
|
+
return withCadKernel((cad) => interferenceBetweenSolids(cad, selected.map((shape) => {
|
|
24
|
+
// Built here rather than in `solidFor`, because which representation a
|
|
25
|
+
// solid came from is only known once it has been built: whether a
|
|
26
|
+
// boolean result's B-rep passed its check (#541), or a group record's
|
|
27
|
+
// members fell back to their triangles. The pair's precision says so.
|
|
28
|
+
const { solid, provenance } = placedSolid(cad, shape);
|
|
29
|
+
return { id: shape.id, name: shape.name, tessellated: provenance.precision === "tessellated", solid };
|
|
30
|
+
}), (operand) => operand.solid, clearance));
|
|
53
31
|
}
|
|
54
32
|
//# sourceMappingURL=serverCadInterference.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverCadInterference.js","sourceRoot":"","sources":["../src/serverCadInterference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,sEAAsE;QACtE,sEAAsE;QACtE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACtD,OAAO,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,UAAU,CAAC,SAAS,KAAK,aAAa,EAAE,KAAK,EAAE,CAAC;IACxG,CAAC,CAAC,EACF,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,EAC1B,SAAS,CACV,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
* talks to `self.postMessage` and is close to upstream's, and prising it apart
|
|
13
13
|
* would conflict with every upstream change to it. What is shared instead is
|
|
14
14
|
* the result format, so a shape filleted here is indistinguishable in the
|
|
15
|
-
* editor from one filleted there
|
|
15
|
+
* editor from one filleted there -- and, through `meshShellSolids`, how a mesh
|
|
16
|
+
* of several closed shells becomes one solid, so the two agree on which meshes
|
|
17
|
+
* with internal voids are solids (#527).
|
|
16
18
|
*/
|
|
17
19
|
import type { EvolutionData, OcctKernel, ShapeHandle } from "occt-wasm";
|
|
18
20
|
import type { SketchProfile, WorkplaneShape } from "./domain/sketchforge.js";
|
|
@@ -48,6 +50,28 @@ export declare class ServerCadError extends Error {
|
|
|
48
50
|
constructor(message: string, status?: number);
|
|
49
51
|
}
|
|
50
52
|
export type { SketchFaceDraftRequest } from "./sketchFaceDraftKernel.js";
|
|
53
|
+
/**
|
|
54
|
+
* How far a retained sketch output has been resized since it was swept: its
|
|
55
|
+
* drawn dimensions over the ones its source geometry was built at.
|
|
56
|
+
*/
|
|
57
|
+
export declare function sketchResizeFactors(shape: WorkplaneShape): {
|
|
58
|
+
width: number;
|
|
59
|
+
depth: number;
|
|
60
|
+
height: number;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* A sketch extrusion whose exact solid is still its bare sweep -- no draft,
|
|
64
|
+
* treatment or shell -- has its B-rep stored at the size it was drawn. A resize
|
|
65
|
+
* since then lives only in its dimensions, so its exact solid at the size it is
|
|
66
|
+
* shown is its profile scaled by that resize and extruded to its height, the
|
|
67
|
+
* rebuild `applySketchFaceDraft` makes (#452 for width and depth; #546 fixed
|
|
68
|
+
* the engine handing a height-resized extrusion to it at twice its height).
|
|
69
|
+
* Null when there is no resize to apply, or the solid is something else.
|
|
70
|
+
*
|
|
71
|
+
* Without this, a fillet, chamfer or shell of a resized extrusion was built
|
|
72
|
+
* from the B-rep as drawn and stored back at the original size (#539).
|
|
73
|
+
*/
|
|
74
|
+
export declare function resizedSketchExtrusionProfile(shape: WorkplaneShape): SketchProfile | null;
|
|
51
75
|
/**
|
|
52
76
|
* Whether the kernel considers a shape sound.
|
|
53
77
|
*
|
|
@@ -58,8 +82,17 @@ export type { SketchFaceDraftRequest } from "./sketchFaceDraftKernel.js";
|
|
|
58
82
|
* own check, so the two paths agree about what a usable result is.
|
|
59
83
|
*/
|
|
60
84
|
export declare function cadResultIsValid(cad: OcctKernel, shape: ShapeHandle): boolean;
|
|
61
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* A solid sewn from a flat list of triangle corners, which is how a stored mesh arrives.
|
|
87
|
+
*
|
|
88
|
+
* A mesh made of several closed shells -- a part with a sealed internal void,
|
|
89
|
+
* or separate bodies -- is built one shell at a time and put back together by
|
|
90
|
+
* nesting (#501). Sewn all at once, OCCT got a shell inside a shell, could make
|
|
91
|
+
* no one solid of it, and refused a watertight part outright.
|
|
92
|
+
*/
|
|
62
93
|
export declare function solidFromMeshPositions(cad: OcctKernel, positions: number[]): ShapeHandle;
|
|
94
|
+
/** The exact path's refusal for a mesh error the kernel-free measures throw; anything else unchanged. */
|
|
95
|
+
export declare function asServerCadError(error: unknown): unknown;
|
|
63
96
|
/**
|
|
64
97
|
* Whether a treated result has the shape's rotation baked into its geometry.
|
|
65
98
|
*
|
|
@@ -97,7 +130,9 @@ export declare function localSolidForShape(cad: OcctKernel, shape: WorkplaneShap
|
|
|
97
130
|
* reads the same predicate.
|
|
98
131
|
*
|
|
99
132
|
* For stored geometry this is the local solid with only its mirror applied:
|
|
100
|
-
* the rotation stays on the shape, which is where it already was.
|
|
133
|
+
* the rotation stays on the shape, which is where it already was. A resized
|
|
134
|
+
* bare sketch extrusion is the exception: it is rebuilt at its drawn size
|
|
135
|
+
* (`resizedSketchExtrusionProfile`), since its stored B-rep is not.
|
|
101
136
|
*
|
|
102
137
|
* Mirrored either way, because the result is stored with the shape's mirror
|
|
103
138
|
* flags cleared. Building it unmirrored handed back the unmirrored shape and
|
|
@@ -137,6 +172,40 @@ export declare function applyBakedMirror(shape: WorkplaneShape, axis: "x" | "y"
|
|
|
137
172
|
export declare function applyEdgeTreatment(shape: WorkplaneShape, treatment: ServerCadTreatment): Promise<ServerCadResult>;
|
|
138
173
|
/** Count currently chamferable/filletable edges without preserving topology indexes. */
|
|
139
174
|
export declare function allEdgeTreatmentEdgeCount(shape: WorkplaneShape, _kind: ServerCadTreatment["kind"]): Promise<number>;
|
|
175
|
+
/**
|
|
176
|
+
* Whether `placedSolidForShape` builds this shape as the exact solid of its
|
|
177
|
+
* revolve rather than sewing its stored mesh, which is what measuring it
|
|
178
|
+
* reports as its precision.
|
|
179
|
+
*/
|
|
180
|
+
export declare function hasExactRevolveSolid(shape: WorkplaneShape): boolean;
|
|
181
|
+
/**
|
|
182
|
+
* The angle a mesh of a result built from these shapes may turn through
|
|
183
|
+
* between facets, so that it is no coarser than the finest exact revolve
|
|
184
|
+
* among them, or undefined when none is one.
|
|
185
|
+
*
|
|
186
|
+
* Before a revolve was exact, a cut through it was made from its faceted
|
|
187
|
+
* sweep, so the stored result was exactly as fine as its `sides` asked. The
|
|
188
|
+
* exact result is meshed at a fixed chord height instead, which on a small
|
|
189
|
+
* ring is coarser than the sweep it replaced and ignores `sides` altogether.
|
|
190
|
+
* A group record is searched through, since it is cut as its members.
|
|
191
|
+
*
|
|
192
|
+
* Twice the sweep's facet angle, because OCCT's angular deflection bounds the
|
|
193
|
+
* turn between a facet's normal and the surface's, half a facet each way: at
|
|
194
|
+
* this value a full circle gets `sides` facets, the sweep's own count, and a
|
|
195
|
+
* 64-sided ring cut in half meshes to the 260 triangles its sweep gave.
|
|
196
|
+
*/
|
|
197
|
+
export declare function exactRevolveAngularDeflection(shapes: readonly WorkplaneShape[]): number | undefined;
|
|
198
|
+
/**
|
|
199
|
+
* The exact solid of a plain revolve, full turn or partial sweep, in the frame
|
|
200
|
+
* its stored mesh is drawn in -- centred on the mesh's box in X and Z, base at
|
|
201
|
+
* Y=0, at its drawn size -- or null when it has none (#523).
|
|
202
|
+
*
|
|
203
|
+
* That frame is what lets the caller place it exactly as the mesh is placed.
|
|
204
|
+
* The axis comes from the stored record rather than from the solid's own box,
|
|
205
|
+
* because a faceted partial sweep's box is not the exact sweep's box, and
|
|
206
|
+
* centring on the wrong one moves the solid off its axis.
|
|
207
|
+
*/
|
|
208
|
+
export declare function exactRevolveLocalSolid(cad: OcctKernel, shape: WorkplaneShape): ShapeHandle | null;
|
|
140
209
|
/**
|
|
141
210
|
* The solid `GET /edges` numbers and a fillet or chamfer rounds.
|
|
142
211
|
*
|
|
@@ -174,7 +243,7 @@ export declare function applySketchFaceDraft(shape: WorkplaneShape, request: Ske
|
|
|
174
243
|
export declare function meshedCadResult(cad: OcctKernel, result: ShapeHandle, sourceShape?: WorkplaneShape, lineage?: {
|
|
175
244
|
sourceFaceHashes: number[];
|
|
176
245
|
evolution: EvolutionData;
|
|
177
|
-
}, sourceSolid?: ShapeHandle): ServerCadResult;
|
|
246
|
+
}, sourceSolid?: ShapeHandle, angularDeflection?: number): ServerCadResult;
|
|
178
247
|
/**
|
|
179
248
|
* The shape as it stands after a treatment.
|
|
180
249
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverCadOperations.d.ts","sourceRoot":"","sources":["../src/serverCadOperations.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+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